Re: Timestamp Datatype Changing automatically to Timestamp without time zone

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Rajdeep Das <sendrajster(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Timestamp Datatype Changing automatically to Timestamp without time zone
Date: 2009-06-30 14:40:43
Message-ID: dcc563d10906300740o64e25f07pe36e91e4d81466be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Jun 30, 2009 at 1:13 AM, Rajdeep Das<sendrajster(at)gmail(dot)com> wrote:
> Dear Sir/Madam,
> This is important and I need your help here.
> I have taken a dump of my database from the old version of pg viz.8.1, using
> pg_dump command. In the db I have a table with a column of datatype
> 'timestamp'. Now, when I try to restore it on the new pg version 8.3, the
> datatype of the column is getting altered to 'timestamp with no time zone'.
> This change is causing my SQL to fail as TO_TIMESTAMP function is reporting
> error.
> Please suggest me the cause of this automatic datatype change. Also, tell me
> how to make my TO_TIMESTAMP and other data functions work.

If I remember correctly, the sql standard says that timestamp, alone,
means timestamp without timezone. But prior to 8.1 pgsql implemented
timestamp as timestamp with timezone. I'm guessing you're getting
bitten by that. You'd probably have to edit the db dump to change the
ddl declarations of timestamp to timestamptz.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2009-06-30 14:45:20 Re: Timestamp Datatype Changing automatically to Timestamp without time zone
Previous Message Isabella Ghiurea 2009-06-30 14:38:17 configure PG clients for DNS