Create into temp table as select doesn set "found"

From: Jan Hink <hink(at)rac(dot)cz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Create into temp table as select doesn set "found"
Date: 2014-12-18 09:30:51
Message-ID: OFD975D6E0.8C8E71DE-ONC1257DB2.003324AE-C1257DB2.00343CE0@rac.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

I found an unexpected behavior, I suppose it is a little bug.

In plpgsql procedure I have this commads:

create temp table t_expert on commit drop as
select * from v_expert e where user_account=$1;

get diagnostics rowcount=row_count;
raise notice 'found=%, rowcount=%', found, rowcount;

The notice returned "found=f, rowcount=2"

I expected "found" should be set properly to true, when rowcount>0.
If not then I cannot use easy "if not found then ..." and I am forced to
write more rows in my code.

I wonder I have not found similar issue in any discussion yet.

With Regards
Jan Hink

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message jaksits.tibor 2014-12-18 14:44:36 BUG #12273: CASE Expression BUG
Previous Message not-available 2014-12-18 08:52:26 BUG #12269: small incosistency in pg_dump and pg_dumpall dumps