Re: [HACKERS] Adding a nullable DOMAIN column w/ CHECK

2014-09-07 Thread Tom Lane
Noah Misch writes: > On Sun, Sep 07, 2014 at 01:06:04PM -0400, Tom Lane wrote: >> This objection could be met by doing a precheck to verify that the table >> contains at least one live row. That's pretty ugly and personally I'm not >> sure it's necessary, but I think there's room to argue that it

Re: [HACKERS] Adding a nullable DOMAIN column w/ CHECK

2014-09-07 Thread Noah Misch
On Sun, Sep 07, 2014 at 01:06:04PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Sat, Sep 06, 2014 at 02:01:32AM +0200, Marko Tiikkaja wrote: > >> To do this optimization we do have to assume that CHECKs in > >> DOMAINs are at least STABLE, but I don't see that as a problem; > >> those should

Re: [HACKERS] Adding a nullable DOMAIN column w/ CHECK

2014-09-07 Thread Tom Lane
Noah Misch writes: > On Sat, Sep 06, 2014 at 02:01:32AM +0200, Marko Tiikkaja wrote: >> To do this optimization we do have to assume that CHECKs in >> DOMAINs are at least STABLE, but I don't see that as a problem; >> those should be IMMUTABLE anyway, I think. > The system has such assumptions al

Re: [HACKERS] Adding a nullable DOMAIN column w/ CHECK

2014-09-06 Thread Noah Misch
On Sat, Sep 06, 2014 at 02:01:32AM +0200, Marko Tiikkaja wrote: > First of all, sorry about breaking the thread; I don't subscribe to > -general so I can't copy the original email. This is in response to > the problem here: > http://www.postgresql.org/message-id/CACfv+p+8dToaR7h06_M_YMjpV5Na-CQq7

[HACKERS] Adding a nullable DOMAIN column w/ CHECK

2014-09-05 Thread Marko Tiikkaja
Hi, First of all, sorry about breaking the thread; I don't subscribe to -general so I can't copy the original email. This is in response to the problem here: http://www.postgresql.org/message-id/CACfv+p+8dToaR7h06_M_YMjpV5Na-CQq7kN=kgjq_k84h7u...@mail.gmail.com Attached is a very ugly proof