timestamp precision with or without timezones

Started by Nonameabout 22 years ago3 messagesgeneral
Jump to latest
#1Noname
mboes@tweag.net

Hi there,

Is there a way of specifying the precision of a timestamp *with
timezone* field? It works fine for timestamps *without* timezones, but
gives me a syntax error if I try with timestamptz:

tweag=> create table tbl1 (t timestamp(0));
CREATE TABLE
tweag=> \d tbl1
Table "public.tbl1"
Column | Type | Modifiers
--------+--------------------------------+-----------
t | timestamp(3) without time zone |

tweag=> create table tbl1 (t timestamptz(0));
ERROR: syntax error at or near "(" at character 33
tweag=> create table tbl1 (t timestamp(0) without timezone);
ERROR: syntax error at or near "timezone" at character 43

TIA,

Mathieu Boespflug

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Noname (#1)
Re: timestamp precision with or without timezones

On Wed, 7 Apr 2004 mboes@tweag.net wrote:

Hi there,

Is there a way of specifying the precision of a timestamp *with
timezone* field? It works fine for timestamps *without* timezones, but

I think you can with the
timestamp(m) with time zone

(note the space between time and zone)

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: timestamp precision with or without timezones

mboes@tweag.net writes:

Is there a way of specifying the precision of a timestamp *with
timezone* field? It works fine for timestamps *without* timezone

It's
timestamp(n) with time zone
timestamp(n) without time zone
and not any other variants that might seem natural.

Don't blame us, that's what the SQL standard says ;-)

regards, tom lane