Re: [GENERAL] Date with time zone

2009-11-30 Thread Martijn van Oosterhout
On Mon, Nov 30, 2009 at 01:51:33AM -0300, Eduardo Piombino wrote: Analysis of the extra complications added by DST's does not add anything, yet, to the point I'm trying to make, regardless the lack of such cases in practice. The major problem with timezone support in SQL is that they basically

Re: [GENERAL] Date with time zone

2009-11-30 Thread Adrian Klaver
On Sunday 29 November 2009 8:51:33 pm Eduardo Piombino wrote: Just sharing some thoughts. 1. That current date datatype is actually an abstract definition of a time range. Since it is not localized (put in any time zone), it defines a time range going from 00:00:00 hs to 23:59:59. hs of

Re: [GENERAL] Date with time zone

2009-11-30 Thread Eduardo Piombino
On Mon, Nov 30, 2009 at 7:22 AM, Martijn van Oosterhout klep...@svana.orgwrote: On Mon, Nov 30, 2009 at 01:51:33AM -0300, Eduardo Piombino wrote: Analysis of the extra complications added by DST's does not add anything, yet, to the point I'm trying to make, regardless the lack of such cases

Re: [GENERAL] Date with time zone

2009-11-29 Thread Eduardo Piombino
On Sat, Nov 28, 2009 at 8:55 PM, Adrian Klaver akla...@comcast.net wrote: On Saturday 28 November 2009 3:41:42 pm Eduardo Piombino wrote: Hi Adrian, thanks for your answer. I see current criteria and all the SQL-standard compliance policy, but wouldn't it still make sense to be able to

Re: [GENERAL] Date with time zone

2009-11-29 Thread Adrian Klaver
On Sunday 29 November 2009 2:38:43 pm Eduardo Piombino wrote: On Sat, Nov 28, 2009 at 8:55 PM, Adrian Klaver akla...@comcast.net wrote: On Saturday 28 November 2009 3:41:42 pm Eduardo Piombino wrote: Hi Adrian, thanks for your answer. I see current criteria and all the SQL-standard

Re: [GENERAL] Date with time zone

2009-11-29 Thread Eduardo Piombino
On Sun, Nov 29, 2009 at 8:23 PM, Adrian Klaver akla...@comcast.net wrote: On Sunday 29 November 2009 2:38:43 pm Eduardo Piombino wrote: On Sat, Nov 28, 2009 at 8:55 PM, Adrian Klaver akla...@comcast.net wrote: On Saturday 28 November 2009 3:41:42 pm Eduardo Piombino wrote: Hi Adrian,

[GENERAL] Date with time zone

2009-11-28 Thread Eduardo Piombino
Hello list, this is my first msg here. I hope this is the correct place for this subject, I couldn't find any more specific list for this. This thought had been bugging me for some time now and I thought it was time to share it with you pg gurus. Why in god's sake is there not a date with time

Re: [GENERAL] Date with time zone

2009-11-28 Thread Adrian Klaver
On Saturday 28 November 2009 3:43:02 am Eduardo Piombino wrote: Hello list, this is my first msg here. I hope this is the correct place for this subject, I couldn't find any more specific list for this. This thought had been bugging me for some time now and I thought it was time to share it

Re: [GENERAL] Date with time zone

2009-11-28 Thread Eduardo Piombino
Hi Adrian, thanks for your answer. I see current criteria and all the SQL-standard compliance policy, but wouldn't it still make sense to be able to store a date reference, along with a time zone reference? Wouldn't it be useful, wouldn't it be elegant? If i just want to store a reference to Dec

Re: [GENERAL] Date with time zone

2009-11-28 Thread Adrian Klaver
On Saturday 28 November 2009 3:41:42 pm Eduardo Piombino wrote: Hi Adrian, thanks for your answer. I see current criteria and all the SQL-standard compliance policy, but wouldn't it still make sense to be able to store a date reference, along with a time zone reference? Wouldn't it be

Re: [GENERAL] Date with time zone

2009-11-28 Thread Tom Lane
Eduardo Piombino drak...@gmail.com writes: I see current criteria and all the SQL-standard compliance policy, but wouldn't it still make sense to be able to store a date reference, along with a time zone reference? Wouldn't it be useful, wouldn't it be elegant? It seems pretty ill-defined to

Re: [GENERAL] Date with time zone

2009-11-28 Thread silly8888
Speaking of timestamps, I think it would be convenient to have a single-word alias for timestamp with time zone. This is the date type I use almost exclusively and its name is annoyingly big. On Sat, Nov 28, 2009 at 6:57 PM, Tom Lane t...@sss.pgh.pa.us wrote: Eduardo Piombino drak...@gmail.com

Re: [GENERAL] Date with time zone

2009-11-28 Thread Scott Marlowe
timestamptz On Sat, Nov 28, 2009 at 7:25 PM, silly silly8...@gmail.com wrote: Speaking of timestamps, I think it would be convenient to have a single-word alias for timestamp with time zone. This is the date type I use almost exclusively and its name is annoyingly big. On Sat, Nov 28,

Re: [GENERAL] Date with time zone

2009-11-28 Thread Scott Marlowe
On Sat, Nov 28, 2009 at 4:57 PM, Tom Lane t...@sss.pgh.pa.us wrote: Eduardo Piombino drak...@gmail.com writes: I see current criteria and all the SQL-standard compliance policy, but wouldn't it still make sense to be able to store a date reference, along with a time zone reference? Wouldn't

[GENERAL] date and time

2008-03-24 Thread Alain Roger
Hi, i have a stored procedure (a function) in which i must generate a date/time stamp. for that i use select * from now(); and store the result into a column table. is there a easier way to do that ? i tried to store directly now(); result but without success. thx. -- Alain

Re: [GENERAL] date and time

2008-03-24 Thread Raymond O'Donnell
On 24/03/2008 14:35, Alain Roger wrote: for that i use select * from now(); and store the result into a column table. is there a easier way to do that ? i tried to store directly now(); result but without success. Can you show us the full SQL statement? You could also use CURRENT_TIMESTAMP

Re: [GENERAL] date and time

2008-03-24 Thread Alain Roger
Hi Ray, yes for sure. Here it is: SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg; if (existing_email 0) then { result = false; } else { result = true; INSERT INTO cust_portal.tmp_newsletterreg VALUES (

Re: [GENERAL] date and time

2008-03-24 Thread Adrian Klaver
On Monday 24 March 2008 7:35 am, Alain Roger wrote: Hi, i have a stored procedure (a function) in which i must generate a date/time stamp. for that i use select * from now(); and store the result into a column table. is there a easier way to do that ? i tried to store directly now();

Re: [GENERAL] date and time

2008-03-24 Thread Thomas Kellerer
Alain Roger wrote on 24.03.2008 15:45: SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg; if (existing_email 0) then { result = false; } else { result = true; INSERT INTO cust_portal.tmp_newsletterreg VALUES (

Re: [GENERAL] date and time

2008-03-24 Thread Raymond O'Donnell
On 24/03/2008 14:45, Alain Roger wrote: INSERT INTO cust_portal.tmp_newsletterreg VALUES ( nextval( 'tmp_newsletterreg_nlreg_id_seq' ), email, session, SELECT CURRENT_TIMESTAMP; ) Hi Alain, That won't work; you just need ... values ( email, session, CURRENT_TIMESTAMP)

Re: [GENERAL] date and time

2008-03-24 Thread Alain Roger
So thanks a lot to everybody... so here is the result. 1. the semicolon was missing after the INSERT as wrote Raymond. 2. CURRENT_TIMESTAMP works great 3. i use pl/pgsql as language thanks again. Alain On Mon, Mar 24, 2008 at 3:56 PM, Thomas Kellerer [EMAIL PROTECTED] wrote: Alain Roger wrote

Re: [GENERAL] date and time

2008-03-24 Thread Tony Caduto
Alain Roger wrote: Hi, i have a stored procedure (a function) in which i must generate a date/time stamp. for that i use select * from now(); and store the result into a column table. is there a easier way to do that ? i tried to store directly now(); result but without success. Do you