pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Britt Piehler <brittp@labkey.com>
To: pgsql-sql@postgresql.org
Subject: 8.3/8.4 SQL incompatibility?
Date: Wed, 16 Dec 2009 09:31:37 -0800
Message-ID: <4B291979.9010601@labkey.com> (raw)

A generated query of ours broke on upgrade from PG 8.3.3 to 8.4.1 with 
the following error:
ERROR: failed to find conversion function from unknown to character varying
SQL state: XX000

I've narrowed it down to sub-selects in union clauses, as in the test 
script below, which runs successfully on 8.3.3, but fails on 8.4.1.  To 
reproduce:
CREATE TABLE temp.TestTable
(
    TestColumn VARCHAR(20)
);

(SELECT A.TestColumn FROM (SELECT 'TestValue' AS TestColumn FROM 
temp.TestTable) A)
UNION
(SELECT B.TestColumn FROM (SELECT TestColumn FROM temp.TestTable) B);

Adding an explicit VARCHAR cast to the 'TestValue' string literal fixes 
the issue. 

This is nearly identical to 
http://archives.postgresql.org/pgsql-hackers/2009-06/msg01356.php, but 
Tom's reply there says that query hasn't worked since 7.1, while my 
query worked in 8.3.3.  Can anyone tell me if this is a known/expected 
incompatibility, or if this is a bug?

Thanks,
Britt



view thread (2+ messages)  latest in thread

Message-ID: <4B291979.9010601@labkey.com>
Permalink:  ../4B291979.9010601@labkey.com/
Also on:    postgresql.org/message-id/4B291979.9010601@labkey.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: brittp@labkey.com
  Subject: Re: 8.3/8.4 SQL incompatibility?
  In-Reply-To: <4B291979.9010601@labkey.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox