From: | "postgresql" <pgsql(at)symcom(dot)com> |
---|---|
To: | "PgSQL-SQL" <pgsql-sql(at)postgresql(dot)org> |
Subject: | problem with date and to_char |
Date: | 2002-01-09 16:17:07 |
Message-ID: | 200201091601.g09G1nB17973@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I am a little stumped.
postgresql 7.1.3
suse linux 7
I have a database with
CREATE TABLE "fc_communication" (
"acode" character varying(12),
"conversation" text,
"contactdate" date
CREATE TABLE "comm_date" (
"lastcontact" timestamp with time zone DEFAULT 'now' NOT NULL,
Constraint "comm_date_pkey" Primary Key ("lastcontact")
When I update fc_communication I also (without a trigger) update
comm_date with a sep
update comm_date set lastcontact = 'now';
it works beautifully if I do a psql
'select * from comm_date;'
2002-01-08 16:16:03
I always get the last moment that someone updated the communications file
however what I want to do is:
SELECT to_char(lastcontact, 'Month DD, YYYY HH:MM') from comm_date;
January 08, 2002 04:01
why is this 04:01?
Every time I do this I get the very first date (that no longer exists).
Why do I get different results. I expect 'select *' is the base and
everything else is a varient.
Ted
tedpet(at)symcom(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Torbj=?ISO-8859-1?B?9g==?=rn Andersson | 2002-01-09 16:41:26 | Re: Nested loops and $13 |
Previous Message | Roberto Mello | 2002-01-09 16:04:33 | Re: Porting Oracle Packages |