pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: elein <elein@sbcglobal.net>
To: Robert Treat <xzilla@users.sourceforge.net>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] rewriting values with before trigger
Date: Thu, 24 Apr 2003 17:28:28 -0700
Message-ID: <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net> (raw)
In-Reply-To: <1051213745.4752.572.camel@camel>
References: <1051201544.4753.522.camel@camel>
	<3EA83C95.8070404@cvc.net>
	<1051213745.4752.572.camel@camel>


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.




view thread (18+ messages)  latest in thread

Message-ID: <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net>
Permalink:  ../200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net/
Also on:    postgresql.org/message-id/200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net

 · 

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: elein@sbcglobal.net, xzilla@users.sourceforge.net, josh@agliodbs.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] rewriting values with before trigger
  In-Reply-To: <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net>

* 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