Re: [GENERAL] timestamps, formatting, and internals

2012-06-03 Thread Mark Morgan Lloyd
Jasen Betts wrote: On 2012-05-29, David Salisbury wrote: On 5/27/12 12:25 AM, Jasen Betts wrote: The query: "show integer_datetimes;" should return 'on' which means timestamps are microsecond precision if it returns 'off' your database was built with floating point timstamps and equality test

Re: [GENERAL] timestamps, formatting, and internals

2012-06-02 Thread Jasen Betts
On 2012-05-30, David Salisbury wrote: > > > On 5/30/12 9:42 AM, Adrian Klaver wrote: >> Think I realize where the confusion is now. When Jasen mentioned integer >> datetimes he was referring to the internal storage format Postgres uses >> to record the datetime value. Via the magic of programming(

Re: [GENERAL] timestamps, formatting, and internals

2012-06-02 Thread Jasen Betts
On 2012-05-29, David Salisbury wrote: > > > On 5/27/12 12:25 AM, Jasen Betts wrote: >> The query: "show integer_datetimes;" should return 'on' which means >> timestamps are microsecond precision if it returns 'off' your database >> was built with floating point timstamps and equality tests will be

Re: [GENERAL] timestamps, formatting, and internals

2012-05-30 Thread Adrian Klaver
On 05/30/2012 01:48 PM, David Salisbury wrote: On 5/30/12 9:42 AM, Adrian Klaver wrote: Think I realize where the confusion is now. When Jasen mentioned integer datetimes he was referring to the internal storage format Postgres uses to record the datetime value. Via the magic of programming(ot

Re: [GENERAL] timestamps, formatting, and internals

2012-05-30 Thread David Salisbury
On 5/30/12 9:42 AM, Adrian Klaver wrote: Think I realize where the confusion is now. When Jasen mentioned integer datetimes he was referring to the internal storage format Postgres uses to record the datetime value. Via the magic of programming(others will have to fill that part in) the interna

Re: [GENERAL] timestamps, formatting, and internals

2012-05-30 Thread Adrian Klaver
On 05/29/2012 07:08 PM, Adrian Klaver wrote: On 05/29/2012 04:28 PM, David Salisbury wrote: On 5/27/12 12:25 AM, Jasen Betts wrote: The query: "show integer_datetimes;" should return 'on' which means timestamps are microsecond precision if it returns 'off' your database was built with floatin

Re: [GENERAL] timestamps, formatting, and internals

2012-05-29 Thread Adrian Klaver
On 05/29/2012 04:28 PM, David Salisbury wrote: > > > On 5/27/12 12:25 AM, Jasen Betts wrote: >> The query: "show integer_datetimes;" should return 'on' which means >> timestamps are microsecond precision if it returns 'off' your database >> was built with floating point timstamps and equality tes

Re: [GENERAL] timestamps, formatting, and internals

2012-05-29 Thread David Salisbury
On 5/27/12 12:25 AM, Jasen Betts wrote: The query: "show integer_datetimes;" should return 'on' which means timestamps are microsecond precision if it returns 'off' your database was built with floating point timstamps and equality tests will be unreliable, I find that rather interesting. I

Re: [GENERAL] timestamps, formatting, and internals

2012-05-26 Thread Jasen Betts
On 2012-05-18, David Salisbury wrote: > So one question I have is if there a way to set PG in the way Oracle does it.. probably not. > set nls_date_format = '...' so I can query and see exactly what PG is > seeing, > even to the microseconds? set datestyle to 'ISO'; > Is there a config p

Re: [GENERAL] timestamps, formatting, and internals

2012-05-20 Thread Tom Lane
David Salisbury writes: > Actually, figured I'd post the whole function, painful as it > might be for anyone to read. If anyone sees something that's a bit > of a risk ( like perhaps the whole thing ;) Well, I don't know exactly what's causing your issue, but I see a few things that seem rather

Re: [GENERAL] timestamps, formatting, and internals

2012-05-19 Thread Adrian Klaver
On 05/19/2012 10:34 AM, David Salisbury wrote: CCing the list. On 5/19/12 8:12 AM, Adrian Klaver wrote: I hope no one looks further into the problem as the case is closed. It was a coding problem and not a time matchup problem. Late Friday afternoons just aren't my most shining moments. ;

Re: [GENERAL] timestamps, formatting, and internals

2012-05-19 Thread Adrian Klaver
On 05/18/2012 04:19 PM, David Salisbury wrote: I'm trying to debug an intermittent problem I'm seeing in one of our rollup scripts. I'll try to summarize. A table has a measured_at field, of which I calculate another time value based on that field and a longitude value, called solar_noon, and I

Re: [GENERAL] timestamps, formatting, and internals

2012-05-18 Thread David Salisbury
Oh.. and while I'm polluting this list (sorry) it's a timestamp field without a time zone. thanks for any ideas, -Dave -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] timestamps, formatting, and internals

2012-05-18 Thread David Salisbury
Actually, figured I'd post the whole function, painful as it might be for anyone to read. If anyone sees something that's a bit of a risk ( like perhaps the whole thing ;) On 5/18/12 5:19 PM, David Salisbury wrote: I'm trying to debug an intermittent problem I'm seeing in one of our rollup sc

Re: [GENERAL] timestamps in Australia

2010-11-03 Thread Tom Lane
Jasen Betts writes: > set timezone to 'Australia/Sydney'; > set timezone_abbreviations to 'Australia'; > set datestyle to 'SQL,DMY'; > select '2011-04-03 > 01:00'::timestamptz+generate_series(0,3)*'1h'::interval,generate_series(0,3); > notice how the middle two look the same. > (this is Austra

Re: [GENERAL] timestamps, epoch and time zones

2010-01-22 Thread Alberto Colombo
can get it to work. Regards Alberto -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Sam Mason Sent: 22 January 2010 12:25 To: pgsql-general@postgresql.org Subject: Re: [GENERAL] timestamps, epoch and time zones On F

Re: [GENERAL] timestamps, epoch and time zones

2010-01-22 Thread Sam Mason
On Fri, Jan 22, 2010 at 11:45:30AM -, Alberto Colombo wrote: > select extract(epoch from timestamp 'epoch'); > > date_part > --- > -3600 > > Shouldn't that be zero? My timezone is Europe/London (but does it > matter?). Writing "timestamp" like that says that you want the time

Re: [GENERAL] timestamps-accuracy

2008-05-09 Thread Martijn van Oosterhout
On Fri, May 09, 2008 at 04:59:30AM -0400, Justin wrote: > generail this don't hurt us but we have some needs with data coming from > manufacturing testing applications that needs to keep the timestamps to > .000,000,001 aka 1 nano second. > what would be the easiest way to do this? I would sug

Re: [GENERAL] Timestamps

2006-12-05 Thread Richard Huxton
Peter Bauer wrote: Hi all, i have a Debian Server here which is using an NTP server for time synchronization. At the DST shifts, the server time is correctly set. In the database on the server i have a table with a column which contains timestamps but the type of the column is char(30). I'm as

Re: [GENERAL] timestamps

2004-05-25 Thread Tom Allison
Doug McNaught wrote: Tom Allison <[EMAIL PROTECTED]> writes: How would I specify a field that's to be updated to current_time everytime the row is created/altered? Create a trigger. There are some good examples in the PL/pgSQL docs. Is there some way to put this 'update' property into the table

Re: [GENERAL] timestamps

2004-05-25 Thread Doug McNaught
Tom Allison <[EMAIL PROTECTED]> writes: > How would I specify a field that's to be updated to current_time > everytime the row is created/altered? Create a trigger. There are some good examples in the PL/pgSQL docs. > Is there some way to put this 'update' property into the table instead > of r

Re: [GENERAL] timestamps

2004-05-25 Thread Larry Rosenman
--On Tuesday, May 25, 2004 20:52:22 -0400 Tom Allison <[EMAIL PROTECTED]> wrote: How would I specify a field that's to be updated to current_time everytime the row is created/altered? Is there some way to put this 'update' property into the table instead of running some query to do it? You are l

Re: [GENERAL] timestamps

1999-02-24 Thread jose' soares
[EMAIL PROTECTED] ha scritto: > I'm trying to create a column that defaults to the current time and date. I > tried the SQLServer like syntax below but potgresql choked: > > CREATE TABLE clicks ( > avo_userid varchar (10) NOT NULL , > link_id int NOT NULL , > the_time timestamp NOT

Re: [GENERAL] timestamps

1999-02-24 Thread Anatoly K. Lasareff
> "s" == strawman <[EMAIL PROTECTED]> writes: s> I'm trying to create a column that defaults to the current time and date. I s> tried the SQLServer like syntax below but potgresql choked: s> CREATE TABLE clicks ( s> avo_userid varchar (10) NOT NULL , s> link_id int NOT NULL , s> the_t