Re: CHECK constraint (true) causes dumps with parse errors

From: Gábor SZŰCS <surrano(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: CHECK constraint (true) causes dumps with parse errors
Date: 2005-05-21 07:16:17
Message-ID: e2ccf071050521001628a55083@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I agree it's not worth the effort, just found it "interesting" (duh)
and hastily sent a bugreport before checking upstream.

[off]
Another interesting story was 7.3 silently discarding unneeded
typecasts: create a view with a field ('a' || 'b')::varchar. The same
definition worked in 7.3 and 7.4 (both created a varchar field), but
7.3 dropped the unneeded typecast, and when dumping from 7.3 to 7.4
all these fields became text. I think 7.3 was simply "too smart for
our dumb problems" :)
[/off]

On 5/20/05, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Neil Conway <neilc(at)samurai(dot)com> writes:
> > Szűcs Gábor wrote:
> >> Check constraints:
> >> "foobar" CHECK ()
>
> > Yeah, I can repro this with current REL7_4_STABLE sources, but it looks
> > fixed in HEAD and REL8_0_STABLE.
>
> I think the reason is that 7.4 applies make_ands_implicit before storing
> the constraint, while 8.0 and up don't. I'm inclined to think it's not
> worth trying to fix in the back branches.
>
> regards, tom lane
>

--
G.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message shd 2005-05-22 01:13:04
Previous Message Tom Lane 2005-05-21 05:16:44 Re: initdb fails on ultra2 sparc64, freebsd 5.4