Re: Odd query result - Mailing list pgsql-general

From Frank Lanitz
Subject Re: Odd query result
Date
Msg-id 20120827113553.a4fe4d7eb8f477cf25292431@frank.uvena.de
Whole thread Raw
In response to Odd query result  (Maximilian Tyrtania <lists@contactking.de>)
List pgsql-general
On Mon, 27 Aug 2012 10:55:43 +0200
Maximilian Tyrtania <lists@contactking.de> wrote:

> Hello from Berlin,
>
> I can't quite make sense of this (running PG 9.0.3):
>
> psql (9.0.3)
> Type "help" for help.
>
> FAKDB=# Select _rowid,f_firmen_isKunde(firmen),bezeichnung::text from
> firmen
> where
> (firmen.bezeichnung='Microsoft Deutschland GmbH'); _rowid  |
> f_firmen_iskunde |        bezeichnung
> ----------+------------------+----------------------------
>   1214700 | f                | Microsoft Deutschland GmbH
>  15779700 | t                | Microsoft Deutschland GmbH
>    166300 | t                | Microsoft Deutschland GmbH
> (3 rows)
>
> FAKDB=# Select _rowid,f_firmen_isKunde(firmen),bezeichnung::text from
> FAKDB-# firmen where
> FAKDB-# (firmen.bezeichnung='Microsoft Deutschland GmbH') and
> FAKDB-# (f_firmen_isKunde(firmen)=true) and firmen._rowid=15779700 ;
>   _rowid  | f_firmen_iskunde |        bezeichnung
> ----------+------------------+----------------------------
>  15779700 | t                | Microsoft Deutschland GmbH
> (1 row)
>
> Fine. But this record won't be found if I omit the last condition.
>
> FAKDB=# Select _rowid,f_firmen_isKunde(firmen),bezeichnung::text from
> firmen
> where
> (firmen.bezeichnung='Microsoft Deutschland GmbH') and
> (f_firmen_isKunde(firmen)=true); _rowid | f_firmen_iskunde |
> bezeichnung
> --------+------------------+----------------------------
>  166300 | t                | Microsoft Deutschland GmbH
> (1 row)
>
>
> What might be up there?

How is f_firmen_isKunde() defined?

Cheers,
Frank
--
Frank Lanitz <frank@frank.uvena.de>

Attachment

pgsql-general by date:

Previous
From: Greg Williamson
Date:
Subject: Re: PGBouncer Connection Using Perl DBI
Next
From: Sergey Konoplev
Date:
Subject: Re: Odd query result