Re: [HACKERS] Numeric with '-' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Numeric with '-'
Date
Msg-id 965.951282751@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Numeric with '-'  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: [HACKERS] Numeric with '-'  (Peter Eisentraut <e99re41@DoCS.UU.SE>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
>> Remember that constants of random types like "line segment" have to
>> start out as character literals

> A constant of type line segment looks like this:
> LSEG 'whatever'
> This is an obvious extension of the standard. (Also note that this is
> *not* a cast.)

Yes it is.  On what grounds would you assert that it isn't?  Certainly
not on the basis of what comes out of gram.y; all three of these
produce exactly the same parsetree:LSEG 'whatever''whatever'::LSEGCAST('whatever' AS LSEG)

> It seems that for the benefit of a small crowd -- those actually using
> geometric types and being too lazy to type their literals in the above
> manner -- we are creating all sorts of problems for two much larger
> crowds

Au contraire.  The real issue here is how to decide which numeric type
to use for an undecorated but numeric-looking literal token.  I don't
think that's a non-mainstream problem, and I definitely don't think
that telling the odd-datatype crowd to take a hike will help fix it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Beta for 4:30AST ... ?
Next
From: "Roberto Cornacchia"
Date:
Subject: about 7.0 LIMIT optimization