Re: [HACKERS] Numeric with '-'

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: bhirt(at)mobygames(dot)com, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Numeric with '-'
Date: 2000-02-23 01:21:04
Message-ID: Pine.LNX.4.21.0002230151000.415-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-23 01:21:28 Re: Splitting distributions (Was: Re: [HACKERS] ECPG / Release)
Previous Message Peter Eisentraut 2000-02-23 01:20:49 Re: [HACKERS] Beta for 4:30AST ... ?