Re: Timestamp output - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Timestamp output
Date
Msg-id GNELIHDDFBOCMGBFGEFOOEJBCBAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: Timestamp output  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Timestamp output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > Although I know of this problem, I would also be interested in the fix.
> > I know that you can declare a column of type timestamp(0) to get the old
> > format, but how do you change an existing column?
>
> Officially, it's not supported.  Unofficially, you can always hack
> pg_attribute.atttypmod, which is where precision info is stored.
> Observe the following example:
>
> regression=# create table foo (f1 timestamp, f2 timestamp(0));
> CREATE
> regression=# \d foo
>                    Table "foo"
>  Column |            Type             | Modifiers
> --------+-----------------------------+-----------
>  f1     | timestamp with time zone    |
>  f2     | timestamp(0) with time zone |

Hmmm...it seems to me that an easier way is to edit the pg_dump from the
previous version to add (0) in everywhere.  Why don't we put that in the
'please be aware of these incompatibilites' section of HISTORY?

Chris



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: About referential integrity.
Next
From: Edward Murray
Date:
Subject: Left Outer Join Question