Re: Postgres plpgsql

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Shaun Clements <ShaunC(at)relyant(dot)co(dot)za>
Cc: "'Richard Huxton'" <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres plpgsql
Date: 2005-03-30 14:59:42
Message-ID: 58AB3A92-A12C-11D9-A2E3-000A95B03262@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mar 30, 2005, at 9:34 AM, Shaun Clements wrote:

> PERFORM distinct COLUMN1 FROM TABLE where COLUMN1 = ''''||
> quote_literal(VARIABLE1)'' ||'' AND COLUMN2 =
> ''''||quote_literal(VARIABLE2)||'''';

The first one you posted looked correct. This line above seems to have
problems. I think you want this:

PERFORM distinct COLUMN1 FROM TABLE where COLUMN1 = '''' ||
quote_literal(VARIABLE1) '''' || '' AND COLUMN2 = '' || '''' ||
quote_literal(VARIABLE2) || '''';

Generally PERFORM is used for side effects only. I don't see why you
would use PERFORM unless this line will change the database somehow.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-03-30 15:01:10 Re: plperl doesn't release memory
Previous Message Peterson, Bjorn 2005-03-30 14:52:56 Re: Zombie processes