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>
To: elein@varlena.com
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: Fri, 25 Apr 2003 11:57:02 -0700
Message-ID: <200304251902.h3PJ2X0Y108326@pimout2-ext.prodigy.net> (raw)
In-Reply-To: <200304250003.24506.xzilla@users.sourceforge.net>
References: <1051201544.4753.522.camel@camel>
	<200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net>
	<200304250003.24506.xzilla@users.sourceforge.net>


OK.  I understand what you mean.  I was really focussing
on the engine handling rather than the application behaviour.

elein

On Thursday 24 April 2003 21:03, Robert Treat wrote:
> On Thursday 24 April 2003 08:28 pm, elein wrote:
> > 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?
>
> You misunderstood. I don't think it's a bug in postgresql,  it's a bug in
> the application that is hitting against my database. When it doesn't have a
> value for the timestamp field, it either needs to drop it from the insert
> statment or convert it to null; not send a ''
>
> > What are you really trying to do here?  Maybe setting the
> > table column's default to NULL will achieve what you want.
>
> I have an application that is inserting information into a table
> periodically. Sometimes it passes in timestamps for certain fields, but
> sometimes it doesn't have any timestamp information. When it doesn't have
> information, it should send NULL. Unfortunatly the app writers wrote it to
> send ''. Default's don't work because the app is trying to post data, it's
> just not a valid datatype.  Luckily in this instance I can tell the app
> guys they have to fix thier app instead of having to muck up the database.
>
> Robert Treat

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




view thread (18+ messages)

Message-ID: <200304251902.h3PJ2X0Y108326@pimout2-ext.prodigy.net>
Permalink:  ../200304251902.h3PJ2X0Y108326@pimout2-ext.prodigy.net/
Also on:    postgresql.org/message-id/200304251902.h3PJ2X0Y108326@pimout2-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, elein@varlena.com, josh@agliodbs.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] rewriting values with before trigger
  In-Reply-To: <200304251902.h3PJ2X0Y108326@pimout2-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