Re: NUMERIC key word

Lists: pgsql-patches
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Subject: NUMERIC key word
Date: 2008-01-29 15:07:38
Message-ID: 200801291607.41066.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

In 8.3, it appears that NUMERIC doesn't need to be a key word any longer. See
attached patch. Was there a reason this was kept in the parser? Otherwise
we could remove it in 8.4.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Attachment Content-Type Size
numeric-unspecial.patch text/x-diff 1.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: NUMERIC key word
Date: 2008-01-29 18:20:27
Message-ID: 23408.1201630827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> In 8.3, it appears that NUMERIC doesn't need to be a key word any longer. See
> attached patch. Was there a reason this was kept in the parser? Otherwise
> we could remove it in 8.4.

The reason it was kept was to override the search path --- unqualified
NUMERIC will always be taken as pg_catalog.numeric even if you have some
other type "numeric" in front of it. I believe we had concluded that this
behavior is required by the SQL spec. In any case, it would be kinda
weird for DECIMAL to have that behavior and NUMERIC not.

regards, tom lane


From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: NUMERIC key word
Date: 2008-02-10 22:42:20
Message-ID: 1202683340.6078.46.camel@goldbach
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Tue, 2008-01-29 at 13:20 -0500, Tom Lane wrote:
> The reason it was kept was to override the search path --- unqualified
> NUMERIC will always be taken as pg_catalog.numeric even if you have some
> other type "numeric" in front of it.

It should be possible to implement this behavior without requiring
NUMERIC to be a keyword, though.

-Neil


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: NUMERIC key word
Date: 2008-02-10 23:37:12
Message-ID: 11544.1202686632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> On Tue, 2008-01-29 at 13:20 -0500, Tom Lane wrote:
>> The reason it was kept was to override the search path --- unqualified
>> NUMERIC will always be taken as pg_catalog.numeric even if you have some
>> other type "numeric" in front of it.

> It should be possible to implement this behavior without requiring
> NUMERIC to be a keyword, though.

Perhaps we could find some other, even uglier kludge ... I doubt it
would be an improvement. Is there any particular reason NUMERIC
*shouldn't* be a keyword? It's called out as a <reserved word> by
the spec, after all. (In fact, I seem to recall that it was exactly
that point that made us decide that the implicit conversion to
pg_catalog.numeric was appropriate.)

regards, tom lane