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

From Peter Eisentraut
Subject Re: [HACKERS] Numeric with '-'
Date
Msg-id Pine.LNX.4.21.0002230151000.415-100000@localhost.localdomain
Whole thread Raw
In response to Re: [HACKERS] Numeric with '-'  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Numeric with '-'
List pgsql-hackers
On 2000-02-21, Tom Lane mentioned:

> > Is there a good reason that a character literal is unknown? I'm sure the
> > reasons lie somewhere in the extensible type system, but if I wanted it to
> > be something else explicitly then I would have written DATE 'yesterday'.
> 
> 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.)

The semantics of SQL throughout are that if I write something of the form
quote-characters-quote, it's a character literal. No questions asked. Now
if I pass a character literal to a datetimeish function, it's on obvious
cast. If I pass it to a geometry function, it's an obvious cast. If I pass
it to a generic function, it's a character string.

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: those trying to use their databases in an normal manner with
strings and numbers, and those trying develop for this database that never
know what type a literal is, when it should be obvious. I am definitely
for a close examination of this one.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Beta for 4:30AST ... ?
Next
From: Peter Eisentraut
Date:
Subject: Re: Splitting distributions (Was: Re: [HACKERS] ECPG / Release)