Re: [SQL] Is there any way to stop triggers from cycling?

2006-03-09 Thread Richard Huxton
Josh Berkus wrote: Folks, I'm experimenting with a set of triggers to automagically maintain ltrees-organized tables. I almost have it working, except for a pesky problem with re-ordering groups. The idea is that I want to set up a set of triggers such that: a) If the user moves item (1) to

[SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Flávio Suguimoto
Hi all, I have a problem in a trigger that disable all the triggers of a table. This error occurs randomly and my guess is that occurs when i have a lot of concurrents inserts in the table participation. The error is : RelationBuildTriggers: 2 record(s) not found for rel participation I search

[SQL]

2006-03-09 Thread Klay Martens
Hi all. I am new to postgres, so I am still learning the basics. In Sequel Server, one can set up a function to return a table eg:   CREATE FUNCTION [dbo].[AuthCodes] (@CLIENTID INT)  RETURNS @AuthCodes TABLE (     [ID] INT,     AUTHCODE VARCHAR(100),   

Re: [SQL]

2006-03-09 Thread Leif B. Kristensen
On Thursday 09 March 2006 14:35, Klay Martens wrote: >Hi all. > > >I am new to postgres, so I am > still learning the basics. > > >In Sequel Server, one can set > up a function to return a table eg: > > >  > > >CREATE FUNCTION > [dbo].[AuthCodes] (@CLIENTID INT)  > > > >RETURNS @AuthCodes > TABLE

Re: [SQL]

2006-03-09 Thread A. Kretschmer
am 09.03.2006, um 15:35:45 +0200 mailte Klay Martens folgendes: > > > Hi all. > > > I am new to postgres, so I am still > learning the basics. Please, write in plain ASCII. Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47215, D1: 0160/7141639 GnuPG-ID 0x3FF

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Alvaro Herrera
Flávio Suguimoto wrote: > Hi all, > > I have a problem in a trigger that disable all the triggers of a table. This > error occurs randomly and my guess is that occurs when i have a lot of > concurrents inserts in the table participation. > > The error is : RelationBuildTriggers: 2 record(s) not

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Flávio Suguimoto
Thanks Alvaro, I know that is a hack but i don't have (that i know) other way to disable a trigger. The reason that i need to disable is that trigger will be called recursively. Let explain better my case, the trigger that i sent the code is called after inserts in table participation but itself

Re: [SQL]

2006-03-09 Thread Richard Huxton
Klay Martens wrote: Hi all. I am new to postgres, so I am still learning the basics. In Sequel Server, one can set up a function to return a table eg: CREATE FUNCTION [dbo].[AuthCodes] (@CLIENTID INT) RETURNS @AuthCodes TABLE [snip] and then use select into or insert to populate the tabl

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Flávio Suguimoto
Hi Richard, I have that trigger running on AFTER INSERT of participation table. That trigger inserts 3 new record for each line i inserted in participation. I guess the problem is in these two statement: EXECUTE ''update pg_class set reltriggers=0 where relname = '' || quote_literal(tablename);

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Richard Huxton
Flávio Suguimoto wrote: Hi Richard, I have that trigger running on AFTER INSERT of participation table. That trigger inserts 3 new record for each line i inserted in participation. Yes, but WHY? What problem are you trying to solve. Presumably there is some difference between the first "parti

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Flávio Suguimoto
Thanks Richard, Until the last version of my application i couldn't know which record is different of another. But i saw that someone created a new column and i guess that i could know if its the first one or ther other 3... Thank you very much... -Original Message- From: [EMAIL PROTECTE

Re: [SQL] Problems with disabling triggers in Postgres 7.3.9

2006-03-09 Thread Tom Lane
=?iso-8859-1?Q?Fl=E1vio_Suguimoto?= <[EMAIL PROTECTED]> writes: > EXECUTE ''update pg_class set reltriggers = count(*) from pg_trigger where > pg_class.oid=tgrelid and relname = '' || quote_literal(tablename); This command is just plain wrong, because the aggregation is done across uncertain scope