pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitri Fuerle <ffo2lp@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Question regarding triggers
Date: Mon, 20 Oct 2003 06:00:58 -0700 (PDT)
Message-ID: <20031020130058.61589.qmail@web60210.mail.yahoo.com> (raw)

 
   I'm writing a trigger but running into problems.  My problem is that I can not determine anyway to tell what fields are in the *new* record.  Without knowing what fields are there I get runtime errors if that's not what is being updated example:
 
CREATE FUNCTION "public"."check_shipment" () RETURNS trigger AS'
begin
    If new.shipment_type_id = 4 then
        --do something
    end if;
    return new;
end;
 
in the above example everything works if shipment_type_id is being updated.  If it is not I will receive a run-time error because shipment_type_id is not part of the record new.
 
Please help,
Dmitri
 



---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

view thread (6+ messages)  latest in thread

Message-ID: <20031020130058.61589.qmail@web60210.mail.yahoo.com>
Permalink:  ../20031020130058.61589.qmail@web60210.mail.yahoo.com/
Also on:    postgresql.org/message-id/20031020130058.61589.qmail@web60210.mail.yahoo.com

 · 

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: ffo2lp@yahoo.com
  Subject: Re: Question regarding triggers
  In-Reply-To: <20031020130058.61589.qmail@web60210.mail.yahoo.com>

* 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