Re: [SQL] rewriting values with before trigger - Mailing list pgsql-general

From elein
Subject Re: [SQL] rewriting values with before trigger
Date
Msg-id 200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net
Whole thread Raw
In response to Re: [SQL] rewriting values with before trigger  (Robert Treat <xzilla@users.sourceforge.net>)
Responses Re: [SQL] rewriting values with before trigger  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-general
I don't think this is a bug at all.
Argument creation has to come before the execution
of the function.  That in this case the argument is a row type
doesn't matter.  It has nothing to do with the content of the
function and everything to do with creating the row NEW.
How can you possibly assign a value to NEW.bar if NEW as
a whole does not exist?

What are you really trying to do here?  Maybe setting the
table column's default to NULL will achieve what you want.

elein

On Thursday 24 April 2003 12:49, Robert Treat wrote:
> On Thu, 2003-04-24 at 15:35, Dennis Gearon wrote:
> > Well,
> >     does ''::INT do anything valuable?
>
>     not in 7.3+, and given my original problem involves timestamps, not in
> 7.2 either.
>
> >     change column to a string, convert to INTS on the way out, STRINGS on
> > the way in? use an external language to make transitions.
>
> yeah, I've thought of some other crazy ways to get around this, but the
> problem is due to a bug in the application side. I was hoping I could
> write a quick hack (like adding a rule/trigger) to get around this until
> the app was fixed, but I'm not going to make my side a kludge when it
> isn't one now.
>
>
> Robert Treat
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
----------------------------------------------------------------------------------------
elein@varlena.com     Database Consulting     www.varlena.com
              I have always depended on the [QA] of strangers.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Factoring where clauses through UNIONS take 2
Next
From: elein
Date:
Subject: Re: Storing sequence numbers for later use