resolve merge from remote master
This commit is contained in:
commit
d617c1ae51
BIN
.tmux.md.swp
BIN
.tmux.md.swp
Binary file not shown.
5
cms.md
Normal file
5
cms.md
Normal file
@ -0,0 +1,5 @@
|
||||
PDMN24-1 Maintain Product Structure
|
||||
IVMN02-4 Maint Part/Plant
|
||||
IVMN14-7 Costing Sheet
|
||||
PDMN31-1 WO Production Reporting
|
||||
PDMN06 Maintain WO
|
18
install_list.md
Normal file
18
install_list.md
Normal file
@ -0,0 +1,18 @@
|
||||
dbeaver
|
||||
vs code
|
||||
bash
|
||||
vundle
|
||||
|
||||
npgsql
|
||||
pspg
|
||||
postgresql apt repo
|
||||
pgadmin
|
||||
windows postgres
|
||||
|
||||
nodejs
|
||||
|
||||
|
||||
power bi
|
||||
ms data gateway
|
||||
excel add-in
|
||||
|
@ -1,8 +1,8 @@
|
||||
DROP USER IF EXISTS api;
|
||||
DROP USER IF EXISTS report;
|
||||
|
||||
SET password_encryption = 'md5' /* ='scram' */;
|
||||
SET password_encryption = 'scram-sha-256';
|
||||
|
||||
CREATE ROLE api WITH
|
||||
CREATE ROLE report WITH
|
||||
LOGIN
|
||||
NOSUPERUSER
|
||||
NOCREATEDB
|
||||
@ -10,30 +10,30 @@ CREATE ROLE api WITH
|
||||
INHERIT
|
||||
NOREPLICATION
|
||||
CONNECTION LIMIT -1
|
||||
PASSWORD '';
|
||||
PASSWORD 'report';
|
||||
|
||||
--------------------grant--------------------------------------------------
|
||||
|
||||
GRANT USAGE ON SCHEMA tps TO api;
|
||||
GRANT USAGE ON SCHEMA lgdat TO report;
|
||||
|
||||
GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON ALL TABLES IN SCHEMA tps TO api;
|
||||
GRANT SELECT /*, UPDATE, INSERT, DELETE*/ ON ALL TABLES IN SCHEMA lgdat TO report;
|
||||
|
||||
GRANT USAGE ON ALL SEQUENCES IN SCHEMA tps TO api;
|
||||
GRANT USAGE ON ALL SEQUENCES IN SCHEMA lgdat TO report;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA tps GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON TABLES TO api;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON TABLES TO report;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA tps GRANT USAGE ON SEQUENCES TO api;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT USAGE ON SEQUENCES TO report;
|
||||
|
||||
---------------------------revoke---------------------------------------
|
||||
|
||||
REVOKE USAGE ON SCHEMA tps FROM api;
|
||||
REVOKE USAGE ON SCHEMA lgdat FROM report;
|
||||
|
||||
REVOKE USAGE ON SCHEMA tps FROM api;
|
||||
REVOKE USAGE ON SCHEMA lgdat FROM report;
|
||||
|
||||
REVOKE SELECT , UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA tps FROM api;
|
||||
REVOKE SELECT , UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA lgdat FROM report;
|
||||
|
||||
REVOKE USAGE ON ALL SEQUENCES IN SCHEMA tps FROM api;
|
||||
REVOKE USAGE ON ALL SEQUENCES IN SCHEMA lgdat FROM report;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA tps REVOKE SELECT, UPDATE, INSERT, DELETE ON TABLES FROM api;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE SELECT, UPDATE, INSERT, DELETE ON TABLES FROM report;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA tps REVOKE USAGE ON SEQUENCES FROM api;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE USAGE ON SEQUENCES FROM report;
|
||||
|
33
sql_server/error_handling.sql
Normal file
33
sql_server/error_handling.sql
Normal file
@ -0,0 +1,33 @@
|
||||
CREATE PROC RLARP.TEST AS
|
||||
|
||||
BEGIN
|
||||
PRINT 'Hi'; --non-erroring statement
|
||||
create table #temp(x varchar(255)); --create a permanent object to call outside block after error
|
||||
insert into #temp select 1/0;
|
||||
insert into #temp select 'hi'; --fill it after error
|
||||
--select * from #temp; --select it after error
|
||||
PRINT ERROR_MESSAGE(); --error message is gone
|
||||
|
||||
END;
|
||||
|
||||
begin transaction x
|
||||
declare @e int;
|
||||
DECLARE @em varchar(max);
|
||||
begin try
|
||||
EXEC RLARP.TEST;
|
||||
end TRY
|
||||
begin CATCH
|
||||
select @e = ERROR_NUMBER(), @em = ERROR_MESSAGE();
|
||||
if @e <> 0
|
||||
BEGIN
|
||||
rollback transaction x;
|
||||
print @em;
|
||||
END
|
||||
if @e = 0
|
||||
BEGIN
|
||||
commit transaction x;
|
||||
print 'ok';
|
||||
end
|
||||
end catch
|
||||
|
||||
SELECT * FROM #temp
|
Loading…
Reference in New Issue
Block a user