Обсуждение: timestamp() broken in 7.2.4?

Поиск
Список
Период
Сортировка

timestamp() broken in 7.2.4?

От
Holger Marzen
Дата:
In 7.1.3 I can use

  select timestamp(date '2001-01-01', time '00:00');

but in 7.2.4 I get

  db1=# select timestamp(date '2001-01-01', time '00:00');
  ERROR:  parser: parse error at or near "date"

I get the same error when using actual columns in actual tables. Both
PostgreSQL versions are compiled from source on a Intel Linux box.

--
PGP/GPG Key-ID:
http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xB5A1AFE1

Re: timestamp() broken in 7.2.4?

От
Ian Barwick
Дата:
On Friday 27 June 2003 00:47, Holger Marzen wrote:
> In 7.1.3 I can use
>
>   select timestamp(date '2001-01-01', time '00:00');
>
> but in 7.2.4 I get
>
>   db1=# select timestamp(date '2001-01-01', time '00:00');
>   ERROR:  parser: parse error at or near "date"

changed in 7.2, see:
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=release-7-2.html

"The timestamp(), time(), and interval() functions are no longer available.
Instead of timestamp(), use timestamp 'string' or CAST. "

-> something like:
  select timestamp '2001-01-01 00:00';
should work


Ian Barwick
barwick@gmx.net

Re: timestamp() broken in 7.2.4?

От
Stephan Szabo
Дата:
On Fri, 27 Jun 2003, Holger Marzen wrote:

> In 7.1.3 I can use
>
>   select timestamp(date '2001-01-01', time '00:00');
>
> but in 7.2.4 I get
>
>   db1=# select timestamp(date '2001-01-01', time '00:00');
>   ERROR:  parser: parse error at or near "date"

To be closer to the standard, timestamp() became a reference to the
datatype with a given precision (given in the parens).  You can still get
at the functions with "timestamp"(...), but I think you can also use
date '2001-01-01' + time '00:00' as well.


Solved: timestamp() broken in 7.2.4?

От
Holger Marzen
Дата:
On Thu, 26 Jun 2003, Stephan Szabo wrote:

> On Fri, 27 Jun 2003, Holger Marzen wrote:
>
> > In 7.1.3 I can use
> >
> >   select timestamp(date '2001-01-01', time '00:00');
> >
> > but in 7.2.4 I get
> >
> >   db1=# select timestamp(date '2001-01-01', time '00:00');
> >   ERROR:  parser: parse error at or near "date"
>
> To be closer to the standard, timestamp() became a reference to the
> datatype with a given precision (given in the parens).  You can still get
> at the functions with "timestamp"(...), but I think you can also use
> date '2001-01-01' + time '00:00' as well.

Ah, I see. My condition

where interface = 'ppp0' and
      age(current_timestamp, date + time) < '1 hour'

works now. I can simply add the columns date and time. Cool.



--
PGP/GPG Key-ID:
http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xB5A1AFE1