Re: Bug in PostGreSQL 8.2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in PostGreSQL 8.2
Date
Msg-id 364.1165434185@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in PostGreSQL 8.2  (Hubert FONGARNAND <informatique.internet@fiducial.fr>)
Responses Re: Bug in PostGreSQL 8.2
List pgsql-hackers
Hubert FONGARNAND <informatique.internet@fiducial.fr> writes:
> CREATE TABLE node
> (
>   node_id character varying(36) NOT NULL ,
>   node_trash integer NOT NULL DEFAULT 0,
>   CONSTRAINT pk_node PRIMARY KEY (node_id)
> ) 
> WITH OIDS;

> select count(*) 
> from NODE  
> where NODE_ID 
> in (select NODE_ID from NODE where NODE_TRASH=3D0  limit 1  offset 0)

OK, it seems the key bit here is that the IN's subselect has a
varchar(N) column ... you don't see the failure unless the subselect
result column has a nondefault typmod.  So a possibly helpful workaround
until 8.2.1 comes out is to cast NODE_ID to text in the subselect.

Patch committed; thanks for the report!
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql return codes
Next
From: Jeff Davis
Date:
Subject: Re: old synchronized scan patch