pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: the6campbells <the6campbells@gmail.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: data type of projected item in a union not correct
Date: Mon, 24 Sep 2012 20:29:12 -0400
Message-ID: <1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.com> (raw)
In-Reply-To: <CAFEjsq6LYuK-gtJmg3fa+QLmOr7fsRvUErrbZSQC=jADuXnRfg@mail.gmail.com>
References: <CAFEjsq6LYuK-gtJmg3fa+QLmOr7fsRvUErrbZSQC=jADuXnRfg@mail.gmail.com>

On Sep 24, 2012, at 19:43, the6campbells <the6campbells@gmail.com> wrote:

> Database 9.0.4
> Driver PostgreSQL 9.1 JDBC4 (build 902)
> 
> 
> The following projection is not described with the expected type+precision as one would expect from ISO-SQL
> 
> Is this a known Postgres bug, quirk or ....
> 
> t1.c1 char(32)
> t2.c1 varchar(32)
> 
> select t1.c1 returns precision of 32
> select t2.c1 returned precision of 32
> 
> 
> t1.c1
> union
> t2.c1
> 
> t2.c1
> union
> t1.c1
> 
> returns precision 2147483647
> 
> 

From the description here

http://www.postgresql.org/docs/9.2/interactive/typeconv-union-case.html

I infer that since the two types are not the same they are both converted to the preferred base type "text" which while it should have an undefined precision instead is reported to have an arbitrary large precision.

What result do you feel it should report and for what reason?

David J.





view thread (4+ messages)  latest in thread

Message-ID: <1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.com>
Permalink:  ../1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.com/
Also on:    postgresql.org/message-id/1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: polobo@yahoo.com, the6campbells@gmail.com
  Subject: Re: data type of projected item in a union not correct
  In-Reply-To: <1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.com>
  References: <CAFEjsq6LYuK-gtJmg3fa+QLmOr7fsRvUErrbZSQC=jADuXnRfg@mail.gmail.com> <1373D8CF-EC10-4AF4-AC37-9887476D4FC2@yahoo.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