Re: [SQL] Using a rule as a trigger.

2001-01-10 Thread Stephan Szabo
As someone else said a serial is probably easier, but a trigger is probably a better bet than a rule for this purpose. Using a plpgsql before insert trigger will do it. On Wed, 10 Jan 2001, Andrew Higgs wrote: > Hi all, > > I have looked at some previous posting and thought that I had found

Re: [SQL] Using a rule as a trigger.

2001-01-10 Thread Tulio Oliveira
Andrew Higgs wrote: > > Hi all, > > I have looked at some previous posting and thought that I had found > exactly what I need. What I need is to insert an id (from a sequence) > when a new record is inserted. The following example almost does what I > need : > > CREATE TABLE topics (id int, to

[SQL] Using a rule as a trigger.

2001-01-10 Thread Andrew Higgs
Hi all, I have looked at some previous posting and thought that I had found exactly what I need. What I need is to insert an id (from a sequence) when a new record is inserted. The following example almost does what I need : CREATE TABLE topics (id int, topic varchar(50), descriotion text);