8.1 substring bug? - Mailing list pgsql-hackers

From Harald Fuchs
Subject 8.1 substring bug?
Date
Msg-id 87ek5n5mh0.fsf@srv.protecting.net
Whole thread Raw
Responses Re: 8.1 substring bug?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Consider the following:
 CREATE TEMP TABLE tbl (   id SERIAL NOT NULL,   PRIMARY KEY (id) );
 COPY tbl (id) FROM stdin; 1 2 3 4 \.
 SELECT substring ('1234567890' FOR (SELECT count (*) FROM tbl)::int);

This returns '1234', as expected.  But
 SELECT substring ('1234567890' FOR (SELECT count (*) FROM tbl));

returns NULL.  I think the problem is that "SELECT count(*)" returns a
BIGINT whereas "substring" expects an INT.  Shouldn't there be a warning? 



pgsql-hackers by date:

Previous
From: huaxin zhang
Date:
Subject: Re: Getting table name/tuple from OID
Next
From: "Merlin Moncure"
Date:
Subject: Re: 8.0 -> 8.1 dump duplicate key problem?