From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jerry Day <jerry_day@esri.com>
Cc: 'Bruce Momjian' <pgman@candle.pha.pa.us>
Cc: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgresql.org>
Subject: Re: Problems with PQfmod() returning -1 on varchar f
Date: Mon, 04 Apr 2005 21:43:18 -0400
Message-ID: <4852.1112665398@sss.pgh.pa.us> (raw)
In-Reply-To: <491DC5F3D279CD4EB4B157DDD62237F406ABE859@zipwire.esri.com>
References: <491DC5F3D279CD4EB4B157DDD62237F406ABE859@zipwire.esri.com>
Jerry Day <jerry_day@esri.com> writes:
> Thanks for your quick response. The column in question is defined as 'DATA
> VARCHAR(20) NOT NULL'. The issue occurs when this is referenced in a fairly
> complex query, such as:
> SELECT data,int16_col,int64_col,float32_col,float64_col,
> date_col,row_id
> FROM
> (SELECT b.data,b.int16_col,b.int64_col,
> b.float3_col,b.float64_col,b.date_col,b.row_id
> FROM table1 b
> LEFT JOIN
> (SELECT *
> FROM table3
> ) d ON b.ROW_ID = d.ROW_ID
> WHERE d.ROW_ID IS NULL
> UNION ALL
> SELECT a.data,a.int16_col,a.int64_col,a.float32_col,
> a.float6_col,a.date_col,a.row_id
> FROM table2 a
> LEFT JOIN
> (SELECT *
> FROM table3
> ) d ON (a.ROW_ID = d.ROW_ID)
> WHERE d.ROW_ID IS NULL
> ) V__282 LIMIT 0;
The UNION will drop the typmod, even if both its inputs have the same
typmod. See e.g.
http://archives.postgresql.org/pgsql-general/2005-04/msg00204.php
This is on the agenda to look at for 8.1 ...
regards, tom lane
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-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, jerry_day@esri.com, pgman@candle.pha.pa.us
Subject: Re: Problems with PQfmod() returning -1 on varchar f
In-Reply-To: <4852.1112665398@sss.pgh.pa.us>
* 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