Re: This works in 7.2.1, not in 7.3.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Frank Millman" <frank(at)chagford(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: This works in 7.2.1, not in 7.3.2
Date: 2003-07-12 00:38:15
Message-ID: 14276.1057970295@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Frank Millman" <frank(at)chagford(dot)com> writes:
> The following works in 7.2.1 -

> 1. select count(*) from SysUsersCompanies where UserRowId =3D 3 ;
> 2. select substring('NY',(select count(*) from SysUsersCompanies where User=
> RowId =3D 3)+1,1) ;

> The first select returns either 1 or 0
> The second one uses the result in a more complex expression, and returns ei=
> ther 'Y' or 'N'

> In 7.3.2, the first select behaves the same, but the second one returns NUL=
> L.

Try coercing the result of count(*) to integer (it's bigint to start
with).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond 2003-07-12 00:52:42 PL/pgSQL CASE Support
Previous Message Jason Tishler 2003-07-12 00:21:32 Re: PostgreSQL, Cygwin - setting locales