Roy Badami wrote:
> Tom> Feel like hacking the code?
> Hmm, in principle I might take a look some time; in reality it's
> unlikely I'll have time any time soon...
> There are some design issues involved, though. If you have the type
> modifier, do you isnist on SQL syntax in the string?
> ie do you accept
> select interval '1 day 1 hour' day to second
> Personally I think it would be a bad idea to allow hybrid SQL/postgres
> syntax like this.
I am wondering why we allow the 'interval' data type specification to be
after the string. It seems this should be written as:
select interval day to second '1 day 1 hour'
However, we don't support that syntax, only the one with the
Timestamp does it logically with 'time zone':
test=> select timestamp with time zone '2004-01-01';
test=> select timestamp '2004-01-01' with time zone;
ERROR: syntax error at or near "with" at character 31
So, I am thinking we should allow something like this:
interval day to second '1' hour
where the 'day to second' is the interval data type specification and
'hour' is the data value specification.
I realize this might break backward compatibility but we never
documented that syntax and we need to use it to be consistent with the
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
In response to
pgsql-bugs by date
|Next:||From: Roy Badami||Date: 2005-03-20 14:20:09|
|Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,|
|Previous:||From: David B.||Date: 2005-03-20 06:21:54|
|Subject: pl/pgsql doesn't load|