plpgsql; execute query inside exists - Mailing list pgsql-general

From jozsef.kurucz@invitel.hu
Subject plpgsql; execute query inside exists
Date
Msg-id CAGJF9eG6BtvBCSVYqRAB-8f30RB3V+8ZtMAamRHFvoReLR4D6A@mail.gmail.com
Whole thread Raw
Responses Re: plpgsql; execute query inside exists  (Merlin Moncure <mmoncure@gmail.com>)
List 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!

pgsql-general by date:

Previous
From: The Great SunWuKung
Date:
Subject: Re: 7
Next
From: Simon Riggs
Date:
Subject: Re: Using constraint exclusion with 2 floats