Question on Rules

From: <mgould(at)isstrucksoftware(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Question on Rules
Date: 2012-02-18 10:16:54
Message-ID: 20120218031654.c760ddbd7c0975bc4b045766db7d895c.0a3d13320c.wbe@email16.secureserver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am creating a rule which will copy a record when it is changed to a
audittable. My question is that the first column is a UUID data type
with a defined as auditaccessorid uuid DEFAULT
isscontrib.uuid_generate_v4() NOT NULL,

Right now I've got that set to NULL to allow the parser to "compile".
What value should I have in here since I want a newly created UUID?

CREATE RULE log_accessor AS ON UPDATE TO iss.accessor
WHERE NEW.* <> OLD.*
DO INSERT INTO iss.auditaccessor VALUES (NULL,
'C',
new.loaddtlid,
new.seqno,
new.billable,
new.payind,
new.code,
new.description,
new.ref,
new.tractororcarrierflag,
new.tractororcarrierno,
new.tractorpct,
new.charge,
new.type,
new.checkdate,
new.checkno,
new.processed,
new.itemflag,
new.tractortermloc,
new.cost,
new.batchno,
new.editdatetime,
new.edituser);

Best Regards,

Michael Gould
Intermodal Software Solutions, LLC
904-226-0978

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrey Chursin 2012-02-18 11:39:02 Full text search ranking: ordering using index and proximiti ranking with OR queries
Previous Message premanand 2012-02-18 09:18:23 Re: MySQL search query is not executing in Postgres DB