Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Gavin Flower
On 03/06/15 08:40, Andreas Ulbrich wrote: On 02.06.2015 22:12, Melvin Davidson wrote: Your problem is in your design. If you do it like this: CREATE TABLE A ( p_col serial PRIMARY KEY, acol integer ); CREATE TABLE B() INHERITS (A); INSERT INTO A(acol) VALUES (1); INSERT INTO B(acol) VALUES

Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Andreas Ulbrich
On 02.06.2015 22:12, Melvin Davidson wrote: Your problem is in your design. If you do it like this: CREATE TABLE A ( p_col serial PRIMARY KEY, acol integer ); CREATE TABLE B() INHERITS (A); INSERT INTO A(acol) VALUES (1); INSERT INTO B(acol) VALUES (2); SELECT * FROM A; SELECT * FROM B; Th

Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Melvin Davidson
Your problem is in your design. If you do it like this: CREATE TABLE A ( p_col serial PRIMARY KEY, acol integer ); CREATE TABLE B() INHERITS (A); INSERT INTO A(acol) VALUES (1); INSERT INTO B(acol) VALUES (2); SELECT * FROM A; SELECT * FROM B; Then the sequence (p_col) will be UNIQUE across

Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Andreas Ulbrich
On 02.06.2015 16:20, Melvin Davidson wrote: You can use the following to list the triggers and see what functions they call. Then you can check pg_proc to see how TRUNCATE is used in prosrc. SELECT c.relname, t.tgname, p.pronameAS function_called, t.tgconstraint

Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Melvin Davidson
You can use the following to list the triggers and see what functions they call. Then you can check pg_proc to see how TRUNCATE is used in prosrc. SELECT c.relname, t.tgname, p.pronameAS function_called, t.tgconstraint AS is_constraint, CASE WHEN t.tgconstrre

Re: [GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-02 Thread Albe Laurenz
Andreas Ulbrich wrote: > I'm in a handle for a trigger for TRUNCATE. Is it possible to find out > whether the TRUNCATE TABLE ist called with CASCADE? I don't think there is. But you can find out the table where the trigger is defined and examine if any foreign key constraints are referring to it.

[GENERAL] TRIGGER TRUNCATE -- CASCADE or RESTRICT

2015-06-01 Thread Andreas Ulbrich
Salvete! I'm in a handle for a trigger for TRUNCATE. Is it possible to find out whether the TRUNCATE TABLE ist called with CASCADE? regads andreas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p