pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pedro Igor <pedroigor@aip.com.br>
To: pgsql-sql@postgresql.org
Subject: SQL QUERY
Date: Tue, 3 Dec 2002 10:43:19 -0200
Message-ID: <001001c29ac9$8f8de3e0$0b00010a@aip.com.br> (raw)

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

view thread (18+ messages)  latest in thread

Message-ID: <001001c29ac9$8f8de3e0$0b00010a@aip.com.br>
Permalink:  ../001001c29ac9$8f8de3e0$0b00010a@aip.com.br/
Also on:    postgresql.org/message-id/001001c29ac9$8f8de3e0$0b00010a@aip.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pedroigor@aip.com.br
  Subject: Re: SQL QUERY
  In-Reply-To: <001001c29ac9$8f8de3e0$0b00010a@aip.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox