Re: [HACKERS] Cache query implemented
Karel Zak <zakkr@zf.jcu.cz>
From: Karel Zak - Zakkr <zakkr@zf.jcu.cz>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Jan Wieck <wieck@debis.com>, Hiroshi Inoue <Inoue@tpf.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgreSQL.org>
Date: 2000-02-28T14:03:17Z
Lists: pgsql-hackers
> > EXECUTE name [ INTO x, y, ... ] [ USING a, b, ... ] > > This command "Associate input parametrs and output targets with a prepared > statement and execute the statement" (SQL92). > > 'INTO' - I really not sure if is possible in PG join more plans into > one plan. If I good understand, INTO is targetlist for cached > query, but in cached query is targetlist too. Is any way how join/replace > targetlist in cached query with targetlist from EXECUTE's INTO? > (QueryRewrite?). But, INTO for EXECUTE is nod bad idea. Sorry, previous paragraph is stupid. The 'into' is simple item in the query struct and not any targetlist. I spend more time with previous stupidity than with implementation: EXECUTE <name> [ INTO [ TEMPORARY | TEMP ] [ TABLE ] new_table ] [ USING val, ... ] test=# prepare sel as select * from tab; PREPARE test=# execute sel into x; SELECT test=# select * from x; id | data ----+------ 1 | aaaa 2 | bbbb 3 | cccc 4 | dddd 5 | eeee (5 rows) The PostgreSQL source code is really very modular :-) Karel