473,788 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interval literal not ANSI compliant

The Postgres INTERVAL literal is not compliant with
the ANSI 2003 SQL Spec. Here's the Postgres way:

# select INTERVAL '45 DAY';
interval
----------
45 days
(1 row)

The spec. says

<interval literal> ::= INTERVAL [ <sign> ] <interval
string> <interval qualifier>

<interval string> ::= <quote> <unquoted interval
string> <quote>

Note specifically that the quotes only enclose the
number, not the interval qualifier. So Postgres
interval literals should be

# select INTERVAL '45' DAY;
interval
----------
00:00:00
(1 row)

Note that Postgres accepts the ANSI form but then
interprets it completely incorrectly. IMHO this is
much worse than rejecting the ANSI form. Are there
plans to fix this? I am using 7.4.3.

_______________ _______________ _
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 23 '05 #1
1 1994
Ed Smith <ed*******@yaho o.com> writes:
The Postgres INTERVAL literal is not compliant with
the ANSI 2003 SQL Spec.
Yup.
Are there plans to fix this?


Step right up and have at it. Tom Lockhart was working on migrating the
datetime support to be more like the (IMHO quite bizarre) spec syntax,
but he lost interest and dropped out of the project awhile back.
I don't think any of the rest of the current developers care much about
this point. But we'd accept a patch, as long as it was reasonably
cleanly coded (ie, supportable into the future).

The interval datatype needs love in other ways --- for instance, in my
opinion it really ought to store months/days/seconds internally not
just months/seconds, so as to avoid surprising behavior at DST
transitions. (The existing representation effectively assumes that a
day is always the same number of seconds, which is wrong on DST
transition days.) But this area is not high on the list of interests
of any active PG developers. We need somebody to take ownership of the
problem.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #2

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

Similar topics

4
3004
by: Lynn | last post by:
On a form I have Date_Start Date_End I have a new Date_Start1 Date_End1 which the use inputs. I need to validate that Date_Start1 and Date_End1 are a date range entirely separate from Date_Start and Date_End i.e. no overlapping
100
7028
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We are discussing whether this newsgroup should focus on 100% ANSI C or simply topics related to the C language in the real world. There is a C standard which is defined by an international committee. People who write compilers refer to this in...
4
5398
by: songkv | last post by:
Hi, I am trying to reassign an array of char to a string literal by calling a function. In the function I use pointer-to-pointer since I want to reassign the "string array pointer" to the string literal. But the second printf seems to give me garbage. Any advise on what I am doing wrong? Thanx
5
1703
by: RK | last post by:
I need to compile a library of C code with pre-ANSI C functions using MS ..NET 2003. The functions are declared something like this: int myFunction(p) double p; { int x; code here... return x; }
2
6754
by: Phil Lee | last post by:
What's the general opinion on which of these to choose? I see that the SoapDocumentServiceAttribute defaults to literal/wrapped, but this article - http://msdn.microsoft.com/msdnmag/issues/05/06/ServiceStation/ - says "it probably makes the most sense to use document/literal/bare". In a BasicProfile1_1 compliant web service should one definitely be chosen over the other?
1
10984
by: ehchn1 | last post by:
Hi, Just curious. Would you use ANSI style table joining or the 'old fashion' table joining; especially if performance is the main concern? What I meant is illustrated below: ANSI Style select * from a join b on a.id = b.id
83
11644
by: sunny | last post by:
Hi All What is C99 Standard is all about. is it portable, i mean i saw -std=C99 option in GCC but there is no such thing in VC++.? which one is better ANSI C / C99? can i know the major difference between C99 & ANSI C standards?
8
2700
by: xmllmx | last post by:
It seems true, but I can't find any exact statement on this in the C or C++ standard. The C and C++ standard states: "__FILE_ The presumed name of the source file (a character string literal)." However, what the term "character string literal" means is not exactly defined. It can be interpreted as a string "C:\\HelloWorld.cpp" or a
2
2778
by: h03Ein | last post by:
Hi! during my search on tokens in ANSI C I have found following specification for string literals based on regular expression in site http://www.lysator.liu.se/c/ANSI-C-grammar-l.html : L?\"(\\.|)*\" which L stands for . can anyone explain what does it mean ? I know regex but I can't understand this specification. why L? . does it mean following input is correct: s"\a" for string literals. or what's exactly (\\.|) means. and so on......
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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
10364
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...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
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...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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
5398
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...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.