Skip to content

Commit 20ce8c7

Browse files
[skip ci]
[skip ci]
1 parent 5983987 commit 20ce8c7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pg-identity-func-trig-seq.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,27 @@ DECLARE
202202
column_name TEXT;
203203
column_value TEXT;
204204
payload_items TEXT[];
205+
pguserval TEXT;
205206
uniquecolumn TEXT;
206207
logtime TEXT;
207208
payloadseqid INTEGER;
208209
BEGIN
210+
211+
pguserval := (SELECT current_user);
212+
if pguserval = 'pgsyncuser' then
213+
RAISE notice 'pgsyncuser name : %', pguserval;
214+
215+
CASE TG_OP
216+
WHEN 'INSERT', 'UPDATE' THEN
217+
rec := NEW;
218+
WHEN 'DELETE' THEN
219+
rec := OLD;
220+
ELSE
221+
RAISE EXCEPTION 'Unknown TG_OP: "%". Should not occur!', TG_OP;
222+
END CASE;
223+
return rec;
224+
end if;
225+
209226
CASE TG_OP
210227
WHEN 'INSERT', 'UPDATE' THEN
211228
rec := NEW;

0 commit comments

Comments
 (0)