1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

Change EXECUTE INTO to CREATE TABLE AS EXECUTE.

This commit is contained in:
Peter Eisentraut
2003-07-01 00:04:31 +00:00
parent df08f5c003
commit 71e9f3b07f
6 changed files with 52 additions and 51 deletions

View File

@@ -80,10 +80,10 @@ ERROR: Parameter $3 of type boolean cannot be coerced into the expected type do
-- invalid type
PREPARE q4(nonexistenttype) AS SELECT $1;
ERROR: Type "nonexistenttype" does not exist
-- execute into
-- create table as execute
PREPARE q5(int, text) AS
SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2;
EXECUTE q5(200, 'DTAAAA') INTO TEMPORARY q5_prep_results;
CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');
SELECT * FROM q5_prep_results;
unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------

View File

@@ -38,8 +38,8 @@ EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea');
-- invalid type
PREPARE q4(nonexistenttype) AS SELECT $1;
-- execute into
-- create table as execute
PREPARE q5(int, text) AS
SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2;
EXECUTE q5(200, 'DTAAAA') INTO TEMPORARY q5_prep_results;
CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');
SELECT * FROM q5_prep_results;