Re: Inserting / selecting rows with TIMESTAMP

From: Claire De Longchamp <cdl(at)abdmf(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Inserting / selecting rows with TIMESTAMP
Date: 2003-02-05 18:41:37
Message-ID: 3E415AE1.5020404@abdmf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thank you very much Tom. Your remark did clarify the question.
___________________________________________________________________
Tom Lane a écrit:

>Claire De Longchamp <cdl(at)abdmf(dot)com> writes:
>
>
>> Table "hre_gaz"
>> Column | Type | Modifiers
>>--------+--------------------------------+-----------
>> poste | smallint | not null
>> gaz | smallint | not null
>> temps | timestamp(0) without time zone | not null
>> valeur | integer |
>> qual | integer |
>> type | character(1) |
>>Primary key: hre_gaz_pkey
>>Triggers: RI_ConstraintTrigger_462203,
>> RI_ConstraintTrigger_462209
>>
>>
>
>
>
>>RsqaDb=# insert into hre_gaz (poste,gaz,temps,valeur,qual,type)
>>RsqaDb-# values (3,1,'1998-04-05 02:00:00'::timestamp,6,1,'S') ;
>>ERROR: Cannot insert a duplicate key into unique index hre_gaz_pkey
>>
>>
>
>What PG version is this?
>
>If it's 7.2, then I think you're getting burnt by the fact that
>::timestamp means coercion to timestamp *with* time zone. When that
>value is then coerced to timestamp without time zone, you can get funny
>behavior right around the times of daylight-savings transitions.
>In particular, I don't think '1998-04-05 02:00:00' is actually a valid
>time, at least under US DST rules --- it comes out as '03:00:00' for me.
>
>Either leave off the explicit coercion, or coerce to "timestamp without
>time zone", or update to 7.3 in which "timestamp" means "timestamp without
>time zone".
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Scott Morrison 2003-02-05 18:59:30 How can I speed up with query?
Previous Message Dinesh Visweswaraiah 2003-02-05 18:20:44 Re: SQL Intersect like problem