Skip site navigation (1) Skip section navigation (2)

Re: BUG #6612: Functions can be called inside CHECK statements

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: atrigent(at)ccs(dot)neu(dot)edu
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6612: Functions can be called inside CHECK statements
Date: 2012-04-25 14:32:33
Message-ID: 20120425143233.GA4758@depesz.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Wed, Apr 25, 2012 at 10:33:10AM +0000, atrigent(at)ccs(dot)neu(dot)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/

In response to

pgsql-bugs by date

Next:From: Greg StarkDate: 2012-04-25 14:57:08
Subject: Re: BUG #6612: Functions can be called inside CHECK statements
Previous:From: snehal maniyarDate: 2012-04-25 13:44:02
Subject: Broken Pipe Error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group