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

From: Farid Zidan <farid(at)zidsoft(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
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 18:18:43
Message-ID: 4C094383.2090205@zidsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Kevin,<br>
<br>
I strongly disagree with your analysis of this issue. Like I said, this
syntax works with 9 different databases, so obviously whatever
PosgreSQL query procesor is doing in this case is not the desired
behavior.<br>
<br>
To ensure PosgreSQL success, the query processor must behave in a
compliant manner with established standards whether those standards are
set by SQL ISO specs or are de facto standards.<br>
<br>
It is too much asking developers to change their sql to overcome
implementation-dependent side-effects of PostgreSQL query processor. If
a simple SQL statement works on 9+ different databases, then it should
also work in PostreSQL with no need for developers to special-code for
PostgreSQL. Very basic feature is converting a string literal to a
datetime/timestamp value and developers should not do <i>any</i>
special coding to accomplish this simple conversion. '2010-04-30
00:00:00' should convert to timestamp in PostgreSQL with no other flags
or syntax
decoration (it already does except when 'distinct' is used).<br>
<br>
Compatibility is very high on desired features for a DBMS and is a
requirement for smooth porting of applications from other databases to
PostreSQL and cross-dbms applications. It really boils down to making
it work, technical details are what developers love and I am sure
PostgreSQL developers can make this simple sql insert work on PostreSQL
just like all the other developers have done for the other DBMSs.<br>
<br>
Anyway, I have reported this issue because I encountered it and it
negatively impacts my project. I don't
expect it to be fixed right now, that's something that PostgreSQL
developers can debate and prioritize. I only ask that this issue is
identified, since it does not work in my case when the target dbms is
PostgreSQL and I am sure it can impact other developers projects and it
would need to be addressed at
some point in the future with a solution where it just work like it
does in all the other DBMSs.<br>
<br>
Farid<br>
<br>
<br>
On 6/4/2010 1:36 PM, Kevin Grittner wrote:
<blockquote cite="mid:4C08F33E0200002500031FBA(at)gw(dot)wicourts(dot)gov"
type="cite">
<blockquote type="cite">
<pre wrap="">Farid Zidan <a class="moz-txt-link-rfc2396E" href="mailto:farid(at)zidsoft(dot)com">&lt;farid(at)zidsoft(dot)com&gt;</a> wrote:
</pre>
</blockquote>
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">can be eliminated by appropriately handling the distinct keyword
and does not have to occur.
</pre>
</blockquote>
<pre wrap="">
Based on previous discussions around our approaching data types, I
don't think any of the regular PostgreSQL developers are likely to
agree with you; but if you see a way to make it work, feel free to
submit a patch. See this page for the process:

<a class="moz-txt-link-freetext" href="http://wiki.postgresql.org/wiki/Submitting_a_Patch">http://wiki.postgresql.org/wiki/Submitting_a_Patch</a>

</pre>
<blockquote type="cite">
<pre wrap="">The ISO-datetime string literal format I am using the most
general/standard for datetime/timestamp and is not the issue here.
</pre>
</blockquote>
<pre wrap="">
The format in your string literal is the portable one; however, a
timestamp literal requires the TIMESTAMP keyword ahead of the string
literal, which you have chosen to omit. Did you try the query with
a proper timestamp literal, as I suggested, against all these
databases? If using standard syntax works, why not use it?

</pre>
<blockquote type="cite">
<pre wrap="">The 'distinct' keyword is causing the error.
</pre>
</blockquote>
<pre wrap="">
No, non-standard syntax is causing the error in the case of
DISTINCT, because our extension to the standard does not cover that
case, even though it covers the other. There are good reasons for
that, which you'll probably discover in short order if you work on a
patch for the issue.

-Kevin

</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Signature</title>
<meta name="author" content="Farid Z">
<font size="-1"><a href="http://www.zidsoft.com/">www.zidsoft.com</a>
CompareData: &nbsp;</font><font size="-1">compare
and synchronize SQL DBMS data </font><font size="-1">visually </font><font
size="-1">between two databases
using ODBC drivers</font>
</div>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 4.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2010-06-04 18:53:17 Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Previous Message Kevin Grittner 2010-06-04 17:36:14 Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail