SQL QUERY

From: "Pedro Igor" <pedroigor(at)aip(dot)com(dot)br>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: SQL QUERY
Date: 2002-12-03 12:43:19
Message-ID: 001001c29ac9$8f8de3e0$0b00010a@aip.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have the following function:
CREATE FUNCTION public.auto_incremento() RETURNS trigger AS '
begin
new.id = (select (max(id) + 1) from teste);
return new;
end;' LANGUAGE 'plpgsql'

I created a trigger that uses this function, but i want to the function be usefull for all tables and not only to tbale teste.

Someone know how ???

Pedro Igor

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2002-12-03 13:05:23 Re: SQL QUERY
Previous Message Tomasz Myrta 2002-12-03 12:29:54 Re: recreating table and foreign keys