Received: from mta4.iol.it (mta4.iol.it [195.210.91.154]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA35279; Fri, 20 Aug 1999 17:30:53 -0400 (EDT) (envelope-from alke@iol.it) Received: from dingo.alke.it ([212.52.76.254]) by mta4.iol.it (Netscape Messaging Server 3.61) with ESMTP id AAB6846; Fri, 20 Aug 1999 23:28:54 +0200 Received: from iol.it (riccio [192.168.0.10]) by dingo.alke.it (8.8.8/8.8.8/Debian/GNU) with ESMTP id WAA11196; Fri, 20 Aug 1999 22:55:10 +0200 Message-ID: <37BDBFBA.5370AFE3@iol.it> Date: Fri, 20 Aug 1999 22:51:07 +0200 From: Alke X-Mailer: Mozilla 4.6 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" , "pgsql-general@postgresql.org" Subject: OID and PL/pgSQL trigger :-( Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hy all! I would like to use OIDs as a primary key on every table of my db, because this seem to me a very smart thing to do..... but after some experiment, I've decided to create a SERIAL field on every table, and to use it as the primary key, and to abandon OIDs... This is an example of what I whould like to write (and I can't): CREATE FUNCTION firstTable_DelCascade() RETURNS OPAQUE AS ' BEGIN DELETE FROM anotherTable WHERE anotherTable.OIDfromFirstTable = OLD.OID; RETURN OLD; END; ' LANGUAGE 'plpgsql'; Well, this can't work because OLD is of type RECORD, and type record have no OID :-( (this is what I found in the docs, about RECORD: "Only the user attributes of a table row are accessible in the row, no Oid or other system attributes (hence the row could be from a view and view rows don't have useful system attributes)" ) The main question is: can I get the OID of the OLD/NEW record in triggers? A more general question is: what is the usefulness of OIDs, if I can't use them in trigger? Paolo