Re: [SQL] rewriting values with before trigger

From: elein <elein(at)sbcglobal(dot)net>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] rewriting values with before trigger
Date: 2003-04-25 00:28:28
Message-ID: 200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql


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(at)varlena(dot)com Database Consulting www.varlena.com
I have always depended on the [QA] of strangers.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message elein 2003-04-25 01:48:47 Re: Storing sequence numbers for later use
Previous Message Tom Lane 2003-04-24 23:48:29 Re: Factoring where clauses through UNIONS take 2

Browse pgsql-sql by date

  From Date Subject
Next Message Robert Treat 2003-04-25 04:03:24 Re: [SQL] rewriting values with before trigger
Previous Message Tom Lane 2003-04-24 22:02:21 Re: [SQL] rewriting values with before trigger