Re: execute/perform and FOUND - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: execute/perform and FOUND
Date
Msg-id 20060921125956.GI10331@merkur.hilbert.loc
Whole thread Raw
In response to Re: execute/perform and FOUND  ("Marcin Mank" <marcin.mank@gmail.com>)
Responses Re: execute/perform and FOUND  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Sep 21, 2006 at 02:50:08PM +0200, Marcin Mank wrote:

> With:
>
>  perform cmd;
>  raise notice ''found (perform): %'', found;
>
> You effectively do:
> select 'select 1 from test where fk_item=1324314' ;
>
>
> Try:
>
> perform 1 from test where fk_item=1324314

Marcin, you saved my day. I knew I was being stupid
somewhere. It's not like I never used PERFORM before but,
hey, there you go :-))

The docs do hint at how to do it properly:

 "PERFORM create_mv(''cs_session_page_requests_mv'', my_query);"

but this might be helpful to be pointed out explicitely:

"PERFORM create_mv(''cs_session_page_requests_mv'', my_query);

 Note that the PERFORM replaces the SELECT in the query."

Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: "Marcin Mank"
Date:
Subject: Re: execute/perform and FOUND
Next
From: Brad Nicholson
Date:
Subject: Re: postgresql rising