pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: postgresql <pgsql@symcom.com>
To: PgSQL-SQL <pgsql-sql@postgresql.org>
Subject: problem with date and to_char
Date: Wed, 09 Jan 2002 11:17:07 -0500
Message-ID: <200201091601.g09G1nB17973@postgresql.org> (raw)

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@symcom.com





view thread (4+ messages)  latest in thread

Message-ID: <200201091601.g09G1nB17973@postgresql.org>
Permalink:  ../200201091601.g09G1nB17973@postgresql.org/
Also on:    postgresql.org/message-id/200201091601.g09G1nB17973@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgsql@symcom.com
  Subject: Re: problem with date and to_char
  In-Reply-To: <200201091601.g09G1nB17973@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox