Re: Check-out mutable functions in check constraints

2019-07-16 Thread Kyotaro Horiguchi
Hello, Thanks all! At Sat, 13 Jul 2019 11:17:32 -0400, Tom Lane wrote in <18372.1563031...@sss.pgh.pa.us> > Tomas Vondra writes: > > On Fri, Jul 12, 2019 at 07:59:13PM -0400, Tom Lane wrote: > >> I'm pretty sure this change has been proposed before, and rejected before. > >> Has anybody excavat

Re: Check-out mutable functions in check constraints

2019-07-16 Thread Kyotaro Horiguchi
Mmm. # I eventually found messages sent to me stashed in unexpcted # place. I felt I was in a void space for these days.. That's # silly! Thank you for the comment. # Putting aside the appliability(?) of this check.. At Fri, 12 Jul 2019 13:14:57 +0200, Tomas Vondra wrote in <20190712111457.ek

Re: Check-out mutable functions in check constraints

2019-07-15 Thread Robert Haas
On Sat, Jul 13, 2019 at 11:17 AM Tom Lane wrote: > If the spec is allowing this because it can be seen > to be safe, why should we not allow other cases that the user has > taken the trouble to prove to themselves are safe? (If their proof is > wrong, well, it wouldn't be the first bug in anyone'

Re: Check-out mutable functions in check constraints

2019-07-13 Thread Tom Lane
Tomas Vondra writes: > On Fri, Jul 12, 2019 at 07:59:13PM -0400, Tom Lane wrote: >> I'm pretty sure this change has been proposed before, and rejected before. >> Has anybody excavated in the archives for prior discussions? > Yes, I've done some quick searches like "volatile constraint" and so on.

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Tomas Vondra
On Fri, Jul 12, 2019 at 07:59:13PM -0400, Tom Lane wrote: Tomas Vondra writes: On Fri, Jul 12, 2019 at 02:00:25PM +0200, Pavel Stehule wrote: Mutable function are allowed in check constraint expressions but it is not right. The attached is a proposed fix for it including regression test. Ye

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Tom Lane
Tomas Vondra writes: > On Fri, Jul 12, 2019 at 02:00:25PM +0200, Pavel Stehule wrote: >>> Mutable function are allowed in check constraint expressions but >>> it is not right. The attached is a proposed fix for it including >>> regression test. > Yes, and the question is whether this is the right

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Tomas Vondra
On Fri, Jul 12, 2019 at 02:00:25PM +0200, Pavel Stehule wrote: pá 12. 7. 2019 v 13:11 odesílatel Tomas Vondra napsal: On Fri, Jul 12, 2019 at 08:55:20AM +0200, Pavel Stehule wrote: >Hi > >pá 12. 7. 2019 v 8:45 odesílatel Kyotaro Horiguchi < horikyota@gmail.com> >napsal: > >> Hello. >> >> A

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Pavel Stehule
pá 12. 7. 2019 v 13:11 odesílatel Tomas Vondra napsal: > On Fri, Jul 12, 2019 at 08:55:20AM +0200, Pavel Stehule wrote: > >Hi > > > >pá 12. 7. 2019 v 8:45 odesílatel Kyotaro Horiguchi < > horikyota@gmail.com> > >napsal: > > > >> Hello. > >> > >> As mentioned in the following message: > >> > >

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Tomas Vondra
On Fri, Jul 12, 2019 at 03:44:58PM +0900, Kyotaro Horiguchi wrote: Hello. As mentioned in the following message: https://www.postgresql.org/message-id/20190712.150527.145133646.horikyota.ntt%40gmail.com Mutable function are allowed in check constraint expressions but it is not right. The attac

Re: Check-out mutable functions in check constraints

2019-07-12 Thread Tomas Vondra
On Fri, Jul 12, 2019 at 08:55:20AM +0200, Pavel Stehule wrote: Hi pá 12. 7. 2019 v 8:45 odesílatel Kyotaro Horiguchi napsal: Hello. As mentioned in the following message: https://www.postgresql.org/message-id/20190712.150527.145133646.horikyota.ntt%40gmail.com Mutable function are allowed

Re: Check-out mutable functions in check constraints

2019-07-11 Thread Pavel Stehule
Hi pá 12. 7. 2019 v 8:45 odesílatel Kyotaro Horiguchi napsal: > Hello. > > As mentioned in the following message: > > > https://www.postgresql.org/message-id/20190712.150527.145133646.horikyota.ntt%40gmail.com > > Mutable function are allowed in check constraint expressions but > it is not right

Check-out mutable functions in check constraints

2019-07-11 Thread Kyotaro Horiguchi
Hello. As mentioned in the following message: https://www.postgresql.org/message-id/20190712.150527.145133646.horikyota.ntt%40gmail.com Mutable function are allowed in check constraint expressions but it is not right. The attached is a proposed fix for it including regression test. Other "const