pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dennis Gearon <gearond@cvc.net>
To: josh@agliodbs.com
Cc: Robert Treat <xzilla@users.sourceforge.net>
Cc: elein@varlena.com, elein <elein@sbcglobal.net>
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 10:47:35 -0700
Message-ID: <3EA974B7.4090309@cvc.net> (raw)
In-Reply-To: <200304251020.48678.josh@agliodbs.com>
References: <1051201544.4753.522.camel@camel>
	<200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net>
	<200304250003.24506.xzilla@users.sourceforge.net>
	<200304251020.48678.josh@agliodbs.com>

It's a lot of work to write the functions, but it is the best way to keep the db intact.

Josh Berkus wrote:
> Robert,
> 
> 
>>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 ''
> 
> 
> Incidentally, this sort of problem is why most of my apps are based on "push" 
> data functions.    i.e., instead of the client calling:
> INSERT INTO foo VALUES ( id, bar1, bar2, bar3 );
> it calls
> SELECT df_modify_foo ( id, bar1, bar2, bar3 );
> 
> Data-push functions allow me to do a whole array of validation and custom 
> error message return that would be impractical with triggers.   It also 
> allows me to build security checks in to the back-end, via:
> 
> SELECT df_modify_foo ( user_id, session_key, id, bar1, bar2, bar3 )
> 
> ... allowing me to check all of the following things:
> Does the user have a valid session?
> Does the user have rights to foo?
> Does the user have a lock on foo?
> Is this a new foo record, or a modified one?
> etc.
> 




view thread (18+ messages)  latest in thread

Message-ID: <3EA974B7.4090309@cvc.net>
Permalink:  ../3EA974B7.4090309@cvc.net/
Also on:    postgresql.org/message-id/3EA974B7.4090309@cvc.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: gearond@cvc.net, josh@agliodbs.com, xzilla@users.sourceforge.net, elein@sbcglobal.net, pgsql-general@postgresql.org
  Subject: Re: [SQL] rewriting values with before trigger
  In-Reply-To: <3EA974B7.4090309@cvc.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