473,786 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

timestamp precision with or without timezones

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.tbl 1"
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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
1 2320
mb***@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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
889
by: Jeff Boes | last post by:
Can anyone explain why this happens? (under 7.4.1) select '2004-05-27 09:00:00.500001-04' :: timestamp(0) ; timestamp --------------------- 2004-05-27 09:00:01 select '2004-05-27 09:00:00.500000-04' :: timestamp(0) ;
6
3282
by: My Deja | last post by:
what is the syntax for specifying the default values for timestamps in MySQL in the CREATE TABLE command? I have 2 timestamps, one for when the record was entered, the other for any subsequent updates. I know that the first timestamp column will be set automatically on updates, but how does the other for creation timestamp get set. My app is not generating the SQL directly so setting the value using
1
2925
by: Vilson farias | last post by:
Greetings, I was doing some tests with timestamps and intervals and I've discovered, for my surprise, that I can't set precision for resulting fields of type interval when I'm executing a query. Please follow my tests : bxs=# select CAST('10:32:14.553243' AS interval); interval ----------------- 10:32:14.553243
2
720
by: Zygo Blaxell | last post by:
I have a table with a few million rows of temperature data keyed by timestamp. I want to group these rows by timestamp intervals (e.g. every 32 seconds), compute aggregate functions on the columns, and ultimately feed the result into a graph-drawing web thingy. I'm trying a few different ways to get what seems to be the same data, and seeing some odd behavior from the query planner. The table looks like this:
67
4816
by: James Harris | last post by:
I have a requirement to store timestamps in a database. Simple enough you might think but finding a suitably general format is not easy. The specifics are 1) subsecond resolution - milliseconds or, preferably, more detailed 2) not bounded by Unix timestamp 2038 limit 3) readable in Java 4) writable portably in Perl which seems to mean that 64-bit values are out 5) readable and writable in Python
1
8066
by: gnupun | last post by:
Hi, I'm trying to compute current time for mountain standard time with daylight savings (MDT);and without DST (MST), eg: Phoenix, AZ. If I use the PHP timezone "US/Mountain", it returns MDT correctly. What is the PHP time zone for MST? Similarly, are there PHP time zones for Pacific, Central and Eastern time zones without Daylight Savings? The PHP time zones US/Pacific, US/
5
6058
Plater
by: Plater | last post by:
So I have been working with the SNTP protocol (RFC4330) And it is saying that the timestamp format of 64bits is: . 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Seconds | ...
27
5323
by: Sanjay | last post by:
Hi All, I am using pytz.common_timezones to populate the timezone combo box of some user registration form. But as it has so many timezones (around 400), it is a bit confusing to the users. Is there a smaller and more practical set? If not, some suggestions on how to handle the registration form effectively would help me a lot. thanks Sanjay
1
3384
by: t8ntboy | last post by:
I am using ASP and SQL 2005 Express. I am inserting a timestamp from an ASP page using <%=now%into a smalldatetime field. All of my timestamps are appearing without any seconds (e.g., 1/21/2008 4:02:00 PM or 1/18/2008 11:32:00 AM). When I view the source for my page is shows the date/time as 1/21/2008 4:27:31 PM, but for some reason the seconds will be converted to 1/21/2008 4:27:00 PM
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.