plpgsql; execute query inside exists

From: jozsef(dot)kurucz(at)invitel(dot)hu
To: pgsql-general(at)postgresql(dot)org
Subject: plpgsql; execute query inside exists
Date: 2011-10-17 07:32:15
Message-ID: CAGJF9eG6BtvBCSVYqRAB-8f30RB3V+8ZtMAamRHFvoReLR4D6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I would like to use EXISTS in a small plpgsql function but I always
get a "syntax error". How can I execute a query inside the
EXISTS function?

IF NOT EXISTS(EXECUTE 'SELECT * FROM '|| tmp_tbl)
THEN
CREATE TABLE tt();

ERROR: syntax error at or near "EXECUTE"
LINE 1: SELECT NOT EXISTS(EXECUTE 'SELECT * FROM '|| $1 )

Sorry for my lame question but I'm new in postgres.

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2011-10-17 10:40:36 Re: Using constraint exclusion with 2 floats
Previous Message The Great SunWuKung 2011-10-17 07:23:00 Re: 7