pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: atrigent@ccs.neu.edu
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6612: Functions can be called inside CHECK statements
Date: Wed, 25 Apr 2012 16:32:33 +0200
Message-ID: <20120425143233.GA4758@depesz.com> (raw)
In-Reply-To: <E1SMzX4-0004Is-FF@wrigleys.postgresql.org>
References: <E1SMzX4-0004Is-FF@wrigleys.postgresql.org>

On Wed, Apr 25, 2012 at 10:33:10AM +0000, atrigent@ccs.neu.edu wrote:
> Seeing as Postgres does not allow sub-queries in CHECK constraints yet, it
> doesn't make any sense to me for it to allow function calls, since functions
> can perform queries. Additionally, if a function is called from a check
> constraint and that function executes a query, the change that caused the
> check constraint to fire does not appear to be "visible" to the query.
> Therefore, calling functions in check constraints does not have the ability
> to check whether that change is valid, making it mostly useless.

I fail to see how's that a bug. Using functions in check has uses, and
the fact that you don't suit your particular case (or you don't know how
to make them suit your case) is not a bug in Pg.

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/



view thread (9+ messages)  latest in thread

Message-ID: <20120425143233.GA4758@depesz.com>
Permalink:  ../20120425143233.GA4758@depesz.com/
Also on:    postgresql.org/message-id/20120425143233.GA4758@depesz.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: depesz@depesz.com, atrigent@ccs.neu.edu
  Subject: Re: BUG #6612: Functions can be called inside CHECK statements
  In-Reply-To: <20120425143233.GA4758@depesz.com>
  References: <E1SMzX4-0004Is-FF@wrigleys.postgresql.org> <20120425143233.GA4758@depesz.com>

* 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