Skip site navigation (1) Skip section navigation (2)

Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Farid Zidan" <farid(at)zidsoft(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Date: 2010-06-04 16:52:17
Message-ID: 4C08E8F10200002500031FAD@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-bugs
>Farid Zidan <farid(at)zidsoft(dot)com> wrote:
 
>> If we were strictly complying with the SQL standard,
 
> Considering the statement works in all the 9 DBMS systems+ that I
> have tested so far as mentioned above, I would say PostgreSQL is
> not compliant with SQL standard in this regard.
 
The SQL standard is a document published by the International
Standards Organization (ISO) and also adopted by the American
National Standards Institute (ANSI).  Those documents don't require
a query in either of the forms you presented to work.  Because of
the convenience factor, most database products have non-standard
extensions to omit type specification in some places.  PostgreSQL's
extensions are oriented more toward user-installable data types
(such as geometric shapes or global coordinates), so the particulars
of our non-standard extensions differ so that use of those features
is as easy as practicable.  That does result in some non-standard
extensions which work in other products not working in PostgreSQL. 
 
I think you'll find that the syntax I suggested (using the standard
timestamp literal instead of a bare character string literal) will
work in all of the databases you mentioned; if you want portable
code, it is best to follow the standard rather than some inferred
popular convention.
 
I hope this helps.
 
-Kevin

In response to

Responses

pgsql-bugs by date

Next:From: Farid ZidanDate: 2010-06-04 17:09:14
Subject: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Previous:From: Farid ZidanDate: 2010-06-04 16:23:24
Subject: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group