How can I do "if exists" in pgplsql?

From: adb <adb(at)Beast(dot)COM>
To: pgsql-general(at)postgresql(dot)org
Subject: How can I do "if exists" in pgplsql?
Date: 2001-01-29 18:57:20
Message-ID: Pine.GSO.4.10.10101291054570.2561-100000@hairdini.beast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there a way for me inside a function
to do some conditional logic based on the existence of a row
like

if exists select userId from users where usrId = $1
do something
else
do something else

Thanks,

Alex.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luiz Fernando Sodré 2001-01-29 19:10:11 Compiling Perl code
Previous Message Felix König 2001-01-29 18:35:26 Re: Re: Trouble porting postgreSQL to WinNT