pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Output from 'timestamp' column!?
2+ messages / 2 participants
[nested] [flat]

* Output from 'timestamp' column!?
@ 2000-05-02 22:01 Jack Zhu <jzhu@netcom-sys.com>
  2000-05-03 13:53 ` Re: Output from 'timestamp' column!? Banghe <banghe@baileylink.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Jack Zhu @ 2000-05-02 22:01 UTC (permalink / raw)
  To: pgsql-admin

Hi, all:

PostgreSQL 7 Beta 5 on Red hat Linux 6.0

We have a a table which has a column col_a with 'timestamp' data type. When
insert time value to this column, we use format which is 'MM/DD/YYYY
HH24:MI:SS' (such as '05/01/2000 13:20:02'). Insertion is OK.

But when we try to read this column, the output is '05/01/2000
13:20:02.20-04', which is not what we need. We don't need the '.20-04' part
of the output, that is nano second and time zone part.

Is there any ways that make the output doesn't contain the nano second and
time zone part?

Thnx a lot!

Jack




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Output from 'timestamp' column!?
  2000-05-02 22:01 Output from 'timestamp' column!? Jack Zhu <jzhu@netcom-sys.com>
@ 2000-05-03 13:53 ` Banghe <banghe@baileylink.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Banghe @ 2000-05-03 13:53 UTC (permalink / raw)
  To: Jack Zhu <jzhu@netcom-sys.com>; +Cc: pgsql-admin

You just need to cut this column. e.g. use perl you can use:
new_column = substr(old_column, 0,  19)

Or you can use the function to convert to what you want  when you select this
column from the table. Check functions

--
Banghe

Jack Zhu wrote:

> Hi, all:
>
> PostgreSQL 7 Beta 5 on Red hat Linux 6.0
>
> We have a a table which has a column col_a with 'timestamp' data type. When
> insert time value to this column, we use format which is 'MM/DD/YYYY
> HH24:MI:SS' (such as '05/01/2000 13:20:02'). Insertion is OK.
>
> But when we try to read this column, the output is '05/01/2000
> 13:20:02.20-04', which is not what we need. We don't need the '.20-04' part
> of the output, that is nano second and time zone part.
>
> Is there any ways that make the output doesn't contain the nano second and
> time zone part?
>
> Thnx a lot!
>
> Jack




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-05-03 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02 22:01 Output from 'timestamp' column!? Jack Zhu <jzhu@netcom-sys.com>
2000-05-03 13:53 ` Banghe <banghe@baileylink.net>

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