Converting a timestamp to a time

From: Mark Morgan Lloyd <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk>
To: pgsql-general(at)PostgreSQL(dot)org
Subject: Converting a timestamp to a time
Date: 2006-11-05 08:45:39
Message-ID: 454DA4B3.5A6F4B49@telemetry.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm in the middle of moving a production database from 7.1 to 8.1 and have hit a
slight problem.

On the old system I've got a query including

datastamp AS datastamp, date(datastamp ) as datadate,
time(datastamp ) as datatime, status, -- etc.

This is actually generated on the client to possibly include timezone
correction. Obviously this has worked fine for a number of years on 7.1, but 8.1
is objecting to the time() cast.

What is the correct (or even any :-) way of converting a timestamp into a time
(without timezone etc.)?

Any suggestions would be much appreciated.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-11-05 10:03:24 Re: explosion of tiny tables representing multiple
Previous Message stig erikson 2006-11-05 07:56:46 Re: opening a channel between two postgreSQL-servers?