Re: Timestamp output

From: "Robert Treat" <robertt(at)auctionsolutions(dot)com>
To: "Matteo Beccati" <m(dot)beccati(at)crpsoftware(dot)it>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Timestamp output
Date: 2002-02-26 20:16:16
Message-ID: AMENJOLMNKAEOIGHHILBAEDFCIAA.robertt@auctionsolutions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

More info:

CREATE TABLE "stamp" (
"param_none" timestamp,
"param2" timestamp(2),
"param0" timestamp(0)
);

insert into stamp values ('now','now','now');

this should give you a good idea how the new timestamping works, and you'll
need to change your column data type accordingly. (You probably should
verify your data entry still works correctly after you do that!)

The one thing I don't get is that this seems to create fields that are
"timestamp with timezone", but they should be "timestamp without timezone"
(timestamptz vs. timestamp)

When I tried to create a column of type timestamptz(2) it errors out, though
I can create timestamptz columns... is this a bug or am I misinterpreting
the docs?

(btw you can specify a type of "timestamp(n) without time zone" if you
really need it)

Robert

> -----Original Message-----
> From: Robert Treat [mailto:robertt(at)auctionsolutions(dot)com]
> Sent: Tuesday, February 26, 2002 2:35 PM
> To: Matteo Beccati; pgsql-general(at)postgresql(dot)org
> Subject: RE: [GENERAL] Timestamp output
>
>
> Well, I know the source of your problems, if not the solution...
>
> (from the docs) time, timestamp, and interval accept an optional
> precision value p which specifies the number of fractional digits
> retained in the seconds field. By default, there is no explicit
> bound on precision. The effective limit of precision is
> determined by the underlying double precision floating-point
> number used to store values (in seconds for interval and in
> seconds since 2000-01-01 for timestamp). The useful range of p is
> from 0 to about 6 for timestamp, but may be more for interval.
> The system will accept p ranging from 0 to 13.
>
> http://www7.us.postgresql.org/users-lounge/docs/7.2/postgres/datat
> ype-datetime.html
>
> I didn't see anything specific about reverting back to the old
> format, but this might help point you in the right direction
>
> Robert
>
>
> > -----Original Message-----
> > From: pgsql-general-owner(at)postgresql(dot)org
> > [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Matteo Beccati
> > Sent: Monday, February 25, 2002 12:43 PM
> > To: pgsql-general(at)postgresql(dot)org
> > Subject: [GENERAL] Timestamp output
> >
> >
> > Hi,
> >
> > I've just upgraded to 7.2, and found a big difference in timestamp
> > output. I'm using the default ISO datestyle, and newly inserted
> > timestamp output looks like that:
> >
> > 2002-02-25 16:50:49.289828+01
> >
> > What is the ".289828" which is breaking all my php scripts?
> >
> > Can I easily revert to the previous format?
> >
> > Thank you
> > --
> > Matteo Beccati
> > C.R.P. Software S.r.l.
> > http://www.crpsoftware.it/
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> >

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Peltonen 2002-02-26 20:27:58 fsync, shared_buffers and sort_mem
Previous Message Thomas T. Thai 2002-02-26 20:15:37 Re: help with getting index scan