From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | Pedro Igor <pedroigor(at)aip(dot)com(dot)br> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: SQL QUERY |
Date: | 2002-12-03 13:05:23 |
Message-ID: | Pine.LNX.4.44.0212031503390.6454-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Tue, 3 Dec 2002, Pedro Igor wrote:
> 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 ???
Take a look at sequences.
(In Addition, they are autimatically created when a column is of type
'SERIAL').
>
>
>
> Pedro Igor
>
>
>
>
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr
From | Date | Subject | |
---|---|---|---|
Next Message | Ries van Twisk | 2002-12-03 13:17:15 | [OT] Inventory systems (private) |
Previous Message | Pedro Igor | 2002-12-03 12:43:19 | SQL QUERY |