pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: 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: 24 Apr 2003 14:38:14 -0400
Message-ID: <1051209495.7747.544.camel@camel> (raw)
In-Reply-To: <200304240939.54070.josh@agliodbs.com>
References: <1051201544.4753.522.camel@camel>
	<200304240939.54070.josh@agliodbs.com>

On Thu, 2003-04-24 at 12:39, Josh Berkus wrote:
> Robert,
> 
> > Is there anyway to do be able to change the '' into NULL before data
> > validity is checked with a trigger?
> 
> What about using a RULE instead?
> 

RULE's follow this same behavior, erroring out if the data is not a
valid timestamp. (At least I've not been able to write a rule that
doesn't follow this) In fact you actually can't create the rule if you
have a where clause that isn't a proper matching datatype. 

I seem to recall a solution for folks who need '' to represent 0 in int
fields was to use triggers or rules, but I guess that really isn't
possible :-(

Robert Treat 

 




view thread (18+ messages)  latest in thread

Message-ID: <1051209495.7747.544.camel@camel>
Permalink:  ../1051209495.7747.544.camel@camel/
Also on:    postgresql.org/message-id/1051209495.7747.544.camel@camel

 · 

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

* 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