Re: datetimeField = datetimeField - '30minutes'::timespan in psql 7.0 or above

From: Joel Burton <jburton(at)scw(dot)org>
To: bangh <banghe(at)baileylink(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeremy Buchmann <jeremy(at)wellsgaming(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: datetimeField = datetimeField - '30minutes'::timespan in psql 7.0 or above
Date: 2001-04-30 15:35:56
Message-ID: Pine.LNX.4.21.0104301134290.8717-100000@olympus.scw.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2 Mar 2001, bangh wrote:

> Actually, it is not so simple.
>
> How can you do this in psql 7.0 or above?
> datetimeField = datetimeField - '30minutes'::timespan ( in psql 6.3, 6.5 you can),
>
> while if you use type timestamp, instead of datetime
> timestampField = timestampField - '30minutes'::interval
> you will get error msg.:
> No such function 'datetime_stamp' with the specified attributes
>
> --
> Banghe

> > Is there anything that datetime did that timestamp doesn't?
> >
> > Could you
> >
> > pg_dump | sed | psql
> >
> > to change the datetimes to timestamp?

Interesting. Works fine w/7.1. I don't have a 7.0 db running anywhere to
see that this fails under 7.0.

BTW, I was being far to simplistic in suggesting that
you should pipe pg_dump to sed to psql. As was pointed out,
redirect pg_dump to a file, sed/perl/edit that, then redirect from that to
psql.

HTH,
--
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2001-04-30 15:50:20 Re: datetimeField = datetimeField - '30minutes'::timespan in psql 7.0 or above
Previous Message Tom Lane 2001-04-30 14:25:50 Re: Re: disable wal