diff options
author | Ashutosh Bapat | 2011-07-29 08:20:49 +0000 |
---|---|---|
committer | Ashutosh Bapat | 2011-07-29 08:20:49 +0000 |
commit | 01f9d0376f95f08f352f96f0f1bdda8c56b610a8 (patch) | |
tree | cea513ee19a3db8879774c65735c5bffeac50a1d | |
parent | 8ed66ed82f879918a16688e0f0138066afb7ca26 (diff) |
Allow commands PREPARE and EXECUTE to prepare a statement and execute it resp.
DEALLOCATE is already allowed.
Adds support for parameterised queries. While setting the statement names in
RemoteQuery node, we also set the parameter types. These are used while sending
Parse message to data nodes. The infrastructure to bind the parameter values was
already there.
-rw-r--r-- | src/backend/commands/prepare.c | 37 | ||||
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 2 | ||||
-rw-r--r-- | src/backend/pgxc/pool/execRemote.c | 2 | ||||
-rw-r--r-- | src/backend/pgxc/pool/pgxcnode.c | 31 | ||||
-rw-r--r-- | src/backend/tcop/utility.c | 12 | ||||
-rw-r--r-- | src/include/pgxc/pgxcnode.h | 1 | ||||
-rw-r--r-- | src/include/pgxc/planner.h | 5 | ||||
-rw-r--r-- | src/test/regress/expected/domain_1.out | 15 | ||||
-rw-r--r-- | src/test/regress/expected/functional_deps_1.out | 11 | ||||
-rw-r--r-- | src/test/regress/expected/guc_1.out | 5 | ||||
-rw-r--r-- | src/test/regress/expected/plancache_1.out | 85 | ||||
-rw-r--r-- | src/test/regress/expected/prepare_1.out | 126 | ||||
-rw-r--r-- | src/test/regress/output/tablespace_1.source | 5 |
13 files changed, 104 insertions, 233 deletions
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c index 2c0db4eb3f..470c3358df 100644 --- a/src/backend/commands/prepare.c +++ b/src/backend/commands/prepare.c @@ -159,22 +159,6 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString) /* Generate plans for queries. */ plan_list = pg_plan_queries(query_list, 0, NULL); -#ifdef PGXC - /* - * Check if we are dealing with more than one step. - * Multi-step preapred statements are not yet supported. - * PGXCTODO - temporary - Once we add support, this code should be removed. - */ - if (IS_PGXC_COORDINATOR && plan_list && plan_list->head) - { - PlannedStmt *stmt = (PlannedStmt *) lfirst(plan_list->head); - - if (stmt->planTree->lefttree || stmt->planTree->righttree) - ereport(ERROR, - (errcode(ERRCODE_INVALID_PSTATEMENT_DEFINITION), - errmsg("Multi-step Prepared Statements not yet supported"))); - } -#endif /* * Save the results. */ @@ -477,7 +461,8 @@ InitQueryHashTable(void) * they use datanode statements */ static int -set_remote_stmtname(Plan *plan, const char *stmt_name, int n) +set_remote_stmtname(Plan *plan, const char *stmt_name, int num_params, + Oid *param_types, int n) { /* If no plan simply return */ if (!plan) @@ -513,6 +498,8 @@ set_remote_stmtname(Plan *plan, const char *stmt_name, int n) hash_search(datanode_queries, name, HASH_FIND, &exists); } while (exists); ((RemoteQuery *) plan)->statement = pstrdup(name); + ((RemoteQuery *) plan)->num_params = num_params; + ((RemoteQuery *) plan)->param_types = param_types; entry = (DatanodeStatement *) hash_search(datanode_queries, name, HASH_ENTER, @@ -521,10 +508,12 @@ set_remote_stmtname(Plan *plan, const char *stmt_name, int n) } if (innerPlan(plan)) - n = set_remote_stmtname(innerPlan(plan), stmt_name, n); + n = set_remote_stmtname(innerPlan(plan), stmt_name, num_params, + param_types, n); if (outerPlan(plan)) - n = set_remote_stmtname(outerPlan(plan), stmt_name, n); + n = set_remote_stmtname(outerPlan(plan), stmt_name, num_params, + param_types, n); return n; } @@ -571,8 +560,13 @@ StorePreparedStatement(const char *stmt_name, #ifdef PGXC if (IS_PGXC_COORDINATOR) { - ListCell *lc; + ListCell *lc; int n; + Oid *param_types_copy = palloc(sizeof(param_types[0]) * num_params); + memcpy(param_types_copy, param_types, sizeof(param_types[0]) * num_params); + + /* copy the param_types array in proper context */ + /* * Scan the plans and set the statement field for all found RemoteQuery @@ -582,7 +576,8 @@ StorePreparedStatement(const char *stmt_name, foreach(lc, stmt_list) { PlannedStmt *ps = (PlannedStmt *) lfirst(lc); - n = set_remote_stmtname(ps->planTree, stmt_name, n); + n = set_remote_stmtname(ps->planTree, stmt_name, num_params, + param_types_copy, n); } } #endif diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 83fac1ce93..64ea9f5f68 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -1002,6 +1002,8 @@ _copyRemoteQuery(RemoteQuery *from) COPY_SCALAR_FIELD(force_autocommit); COPY_STRING_FIELD(statement); COPY_STRING_FIELD(cursor); + COPY_SCALAR_FIELD(num_params); + COPY_POINTER_FIELD(param_types, sizeof(from->param_types[0]) * from->num_params); COPY_SCALAR_FIELD(exec_type); COPY_SCALAR_FIELD(paramval_data); COPY_SCALAR_FIELD(paramval_len); diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 6226cebbbd..1efb364333 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -3183,6 +3183,8 @@ pgxc_start_command_on_connection(PGXCNodeHandle *connection, bool need_tran, prepared ? NULL : step->sql_statement, step->statement, step->cursor, + step->num_params, + step->param_types, step->paramval_len, step->paramval_data, step->read_only, diff --git a/src/backend/pgxc/pool/pgxcnode.c b/src/backend/pgxc/pool/pgxcnode.c index a2e90cecd1..4e71cc5172 100644 --- a/src/backend/pgxc/pool/pgxcnode.c +++ b/src/backend/pgxc/pool/pgxcnode.c @@ -1012,17 +1012,22 @@ send_some(PGXCNodeHandle *handle, int len) */ int pgxc_node_send_parse(PGXCNodeHandle * handle, const char* statement, - const char *query) + const char *query, short num_params, Oid *param_types) { /* statement name size (allow NULL) */ int stmtLen = statement ? strlen(statement) + 1 : 1; /* size of query string */ int strLen = strlen(query) + 1; - /* size of parameter array (always empty for now) */ - int paramLen = 2; - + /* size of parameter type array */ + int paramTypeLen = sizeof(param_types[0]) * num_params + sizeof(num_params); /* size + stmtLen + strlen + paramLen */ - int msgLen = 4 + stmtLen + strLen + paramLen; + int msgLen = 4 + stmtLen + strLen + paramTypeLen; + int cnt_params; + + /* we assume Oid to be 4 byte integer */ + Assert(sizeof(param_types[0]) == 4); + /* if there are parameters, param_types should exist */ + Assert(num_params <= 0 || param_types); /* msgType + msgLen */ if (ensure_out_buffer_capacity(handle->outEnd + 1 + msgLen, handle) != 0) @@ -1047,9 +1052,16 @@ pgxc_node_send_parse(PGXCNodeHandle * handle, const char* statement, /* query */ memcpy(handle->outBuffer + handle->outEnd, query, strLen); handle->outEnd += strLen; - /* parameter types (none) */ - handle->outBuffer[handle->outEnd++] = 0; - handle->outBuffer[handle->outEnd++] = 0; + /* parameter types */ + Assert(sizeof(num_params) == 2); + *((short *)(handle->outBuffer + handle->outEnd)) = htons(num_params); + handle->outEnd += sizeof(num_params); + /* TODO we need to use htonl and convert byte ordering of OID here */ + for (cnt_params = 0; cnt_params < num_params; cnt_params++) + { + *((Oid *)(handle->outBuffer + handle->outEnd)) = htonl(param_types[cnt_params]); + handle->outEnd += sizeof(param_types[cnt_params]); + } return 0; } @@ -1327,12 +1339,13 @@ pgxc_node_send_sync(PGXCNodeHandle * handle) int pgxc_node_send_query_extended(PGXCNodeHandle *handle, const char *query, const char *statement, const char *portal, + int num_params, Oid *param_types, int paramlen, char *params, bool send_describe, int fetch_size) { /* NULL query indicates already prepared statement */ if (query) - if (pgxc_node_send_parse(handle, statement, query)) + if (pgxc_node_send_parse(handle, statement, query, num_params, param_types)) return EOF; if (pgxc_node_send_bind(handle, portal, statement, paramlen, params)) return EOF; diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 993c7cb859..e4e6ed55b4 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -958,23 +958,11 @@ standard_ProcessUtility(Node *parsetree, break; case T_PrepareStmt: -#ifdef PGXC - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("Postgres-XC does not support PREPARE yet"), - errdetail("The feature is not currently supported"))); -#endif CheckRestrictedOperation("PREPARE"); PrepareQuery((PrepareStmt *) parsetree, queryString); break; case T_ExecuteStmt: -#ifdef PGXC - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("Postgres-XC does not support EXECUTE yet"), - errdetail("The feature is not currently supported"))); -#endif ExecuteQuery((ExecuteStmt *) parsetree, queryString, params, dest, completionTag); break; diff --git a/src/include/pgxc/pgxcnode.h b/src/include/pgxc/pgxcnode.h index 4b66a753e3..1a89c84c0f 100644 --- a/src/include/pgxc/pgxcnode.h +++ b/src/include/pgxc/pgxcnode.h @@ -128,6 +128,7 @@ extern int pgxc_node_send_close(PGXCNodeHandle * handle, bool is_statement, extern int pgxc_node_send_sync(PGXCNodeHandle * handle); extern int pgxc_node_send_query_extended(PGXCNodeHandle *handle, const char *query, const char *statement, const char *portal, + int num_params, Oid *param_types, int paramlen, char *params, bool send_describe, int fetch_size); extern int pgxc_node_send_gxid(PGXCNodeHandle * handle, GlobalTransactionId gxid); diff --git a/src/include/pgxc/planner.h b/src/include/pgxc/planner.h index 04b3b148dc..edb2174dbf 100644 --- a/src/include/pgxc/planner.h +++ b/src/include/pgxc/planner.h @@ -100,6 +100,11 @@ typedef struct bool force_autocommit; /* some commands like VACUUM require autocommit mode */ char *statement; /* if specified use it as a PreparedStatement name on data nodes */ char *cursor; /* if specified use it as a Portal name on data nodes */ + int num_params; /* number of parameters specified for Prepared statement */ + const Oid *param_types; /* parameter types, this pointer is shared + * across all the RemoteQuery nodes in the + * plan. So, don't change this once set. + */ RemoteQueryExecType exec_type; /* Support for parameters */ diff --git a/src/test/regress/expected/domain_1.out b/src/test/regress/expected/domain_1.out index d569c83535..6c158f2c66 100644 --- a/src/test/regress/expected/domain_1.out +++ b/src/test/regress/expected/domain_1.out @@ -487,17 +487,16 @@ ERROR: value for domain str_domain2 violates check constraint "str_domain2_chec -- unknown type are enforced correctly. create domain pos_int as int4 check (value > 0) not null; prepare s1 as select $1::pos_int = 10 as "is_ten"; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported execute s1(10); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported + is_ten +-------- + t +(1 row) + execute s1(0); -- should fail -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: value for domain pos_int violates check constraint "pos_int_check" execute s1(NULL); -- should fail -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: domain pos_int does not allow null values -- Check that domain constraints on plpgsql function parameters, results, -- and local variables are enforced correctly. create function doubledecrement(p1 pos_int) returns pos_int as $$ diff --git a/src/test/regress/expected/functional_deps_1.out b/src/test/regress/expected/functional_deps_1.out index e15858f3b7..4fa16821b1 100644 --- a/src/test/regress/expected/functional_deps_1.out +++ b/src/test/regress/expected/functional_deps_1.out @@ -228,13 +228,12 @@ PREPARE foo AS SELECT id, keywords, title, body, created FROM articles GROUP BY id; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported +ERROR: relation "articles" does not exist +LINE 3: FROM articles + ^ EXECUTE foo; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "foo" does not exist ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; ERROR: relation "articles" does not exist EXECUTE foo; -- fail -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "foo" does not exist diff --git a/src/test/regress/expected/guc_1.out b/src/test/regress/expected/guc_1.out index 0dbbe49e07..39790cc262 100644 --- a/src/test/regress/expected/guc_1.out +++ b/src/test/regress/expected/guc_1.out @@ -434,8 +434,6 @@ SELECT relname FROM pg_class WHERE relname = 'reset_test'; -- do changes DECLARE foo CURSOR WITH HOLD FOR SELECT 1; PREPARE foo AS SELECT 1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported LISTEN foo_event; SET vacuum_cost_delay = 13; CREATE TEMP TABLE tmp_foo (data text) ON COMMIT DELETE ROWS; @@ -452,7 +450,8 @@ SELECT pg_listening_channels(); SELECT name FROM pg_prepared_statements; name ------ -(0 rows) + foo +(1 row) SELECT name FROM pg_cursors; name diff --git a/src/test/regress/expected/plancache_1.out b/src/test/regress/expected/plancache_1.out index 6ccf6abd35..000bc7cbe2 100644 --- a/src/test/regress/expected/plancache_1.out +++ b/src/test/regress/expected/plancache_1.out @@ -5,56 +5,48 @@ CREATE TEMP TABLE pcachetest AS SELECT * FROM int8_tbl; ERROR: INTO clause not yet supported -- create and use a cached plan PREPARE prepstmt AS SELECT * FROM pcachetest ORDER BY q1, q2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported +ERROR: relation "pcachetest" does not exist +LINE 1: PREPARE prepstmt AS SELECT * FROM pcachetest ORDER BY q1, q2... + ^ EXECUTE prepstmt; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt" does not exist -- and one with parameters PREPARE prepstmt2(bigint) AS SELECT * FROM pcachetest WHERE q1 = $1 ORDER BY q1, q2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported +ERROR: relation "pcachetest" does not exist +LINE 1: PREPARE prepstmt2(bigint) AS SELECT * FROM pcachetest WHERE ... + ^ EXECUTE prepstmt2(123); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt2" does not exist -- invalidate the plans and see what happens DROP TABLE pcachetest; ERROR: table "pcachetest" does not exist EXECUTE prepstmt; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt" does not exist EXECUTE prepstmt2(123); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt2" does not exist -- recreate the temp table (this demonstrates that the raw plan is -- purely textual and doesn't depend on OIDs, for instance) CREATE TEMP TABLE pcachetest AS SELECT * FROM int8_tbl ORDER BY q1, q2; ERROR: INTO clause not yet supported EXECUTE prepstmt; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt" does not exist EXECUTE prepstmt2(123); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt2" does not exist -- prepared statements should prevent change in output tupdesc, -- since clients probably aren't expecting that to change on the fly ALTER TABLE pcachetest ADD COLUMN q3 bigint; ERROR: relation "pcachetest" does not exist EXECUTE prepstmt; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt" does not exist EXECUTE prepstmt2(123); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt2" does not exist -- but we're nice guys and will let you undo your mistake ALTER TABLE pcachetest DROP COLUMN q3; ERROR: relation "pcachetest" does not exist EXECUTE prepstmt; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt" does not exist EXECUTE prepstmt2(123); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "prepstmt2" does not exist -- Try it with a view, which isn't directly used in the resulting plan -- but should trigger invalidation anyway CREATE TEMP VIEW pcacheview AS @@ -63,19 +55,18 @@ ERROR: relation "pcachetest" does not exist LINE 2: SELECT * FROM pcachetest; ^ PREPARE vprep AS SELECT * FROM pcacheview ORDER BY q1, q2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported +ERROR: relation "pcacheview" does not exist +LINE 1: PREPARE vprep AS SELECT * FROM pcacheview ORDER BY q1, q2; + ^ EXECUTE vprep; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "vprep" does not exist CREATE OR REPLACE TEMP VIEW pcacheview AS SELECT q1, q2/2 AS q2 FROM pcachetest ORDER BY q1, q2; ERROR: relation "pcachetest" does not exist LINE 2: SELECT q1, q2/2 AS q2 FROM pcachetest ORDER BY q1, q2; ^ EXECUTE vprep; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "vprep" does not exist -- Check basic SPI plan invalidation create function cache_test(int) returns int as $$ declare total int; @@ -143,11 +134,12 @@ insert into s1.abc values(123); insert into s2.abc values(456); set search_path = s1; prepare p1 as select f1 from abc; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported execute p1; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported + f1 +----- + 123 +(1 row) + set search_path = s2; select f1 from abc; f1 @@ -156,12 +148,18 @@ select f1 from abc; (1 row) execute p1; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported + f1 +----- + 123 +(1 row) + alter table s1.abc add column f2 float8; -- force replan execute p1; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported + f1 +----- + 123 +(1 row) + drop schema s1 cascade; NOTICE: drop cascades to table s1.abc drop schema s2 cascade; @@ -170,16 +168,15 @@ reset search_path; -- Check that invalidation deals with regclass constants create temp sequence seq; prepare p2 as select nextval('seq'); -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported +ERROR: relation "seq" does not exist +LINE 1: prepare p2 as select nextval('seq'); + ^ execute p2; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "p2" does not exist drop sequence seq; create temp sequence seq; execute p2; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: prepared statement "p2" does not exist -- Check DDL via SPI, immediately followed by SPI plan re-use -- (bug in original coding) create function cachebug() returns void as $$ diff --git a/src/test/regress/expected/prepare_1.out b/src/test/regress/expected/prepare_1.out deleted file mode 100644 index 06f1e73563..0000000000 --- a/src/test/regress/expected/prepare_1.out +++ /dev/null @@ -1,126 +0,0 @@ --- Regression tests for prepareable statements. We query the content --- of the pg_prepared_statements view as prepared statements are --- created and removed. -SELECT name, statement, parameter_types FROM pg_prepared_statements; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - -PREPARE q1 AS SELECT 1 AS a; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -EXECUTE q1; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported -SELECT name, statement, parameter_types FROM pg_prepared_statements; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - --- should fail -PREPARE q1 AS SELECT 2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported --- should succeed -DEALLOCATE q1; -ERROR: prepared statement "q1" does not exist -PREPARE q1 AS SELECT 2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -EXECUTE q1; -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported -PREPARE q2 AS SELECT 2 AS b; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -SELECT name, statement, parameter_types FROM pg_prepared_statements ORDER BY name; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - --- sql92 syntax -DEALLOCATE PREPARE q1; -ERROR: prepared statement "q1" does not exist -SELECT name, statement, parameter_types FROM pg_prepared_statements; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - -DEALLOCATE PREPARE q2; -ERROR: prepared statement "q2" does not exist --- the view should return the empty set again -SELECT name, statement, parameter_types FROM pg_prepared_statements; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - --- parameterized queries -PREPARE q2(text) AS - SELECT datname, datistemplate, datallowconn - FROM pg_database WHERE datname = $1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -EXECUTE q2('postgres'); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported -PREPARE q3(text, int, float, boolean, oid, smallint) AS - SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR - ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) - ORDER BY unique1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported --- too few params -EXECUTE q3('bool'); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported --- too many params -EXECUTE q3('bytea', 5::smallint, 10.5::float, false, 500::oid, 4::bigint, true); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported --- wrong param types -EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea'); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported --- invalid type -PREPARE q4(nonexistenttype) AS SELECT $1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported --- create table as execute -PREPARE q5(int, text) AS - SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 - ORDER BY unique1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA'); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported -SELECT * FROM q5_prep_results; -ERROR: relation "q5_prep_results" does not exist -LINE 1: SELECT * FROM q5_prep_results; - ^ --- unknown or unspecified parameter types: should succeed -PREPARE q6 AS - SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -PREPARE q7(unknown) AS - SELECT * FROM road WHERE thepath = $1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported -SELECT name, statement, parameter_types FROM pg_prepared_statements - ORDER BY name; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - --- test DEALLOCATE ALL; -DEALLOCATE ALL; -SELECT name, statement, parameter_types FROM pg_prepared_statements - ORDER BY name; - name | statement | parameter_types -------+-----------+----------------- -(0 rows) - diff --git a/src/test/regress/output/tablespace_1.source b/src/test/regress/output/tablespace_1.source index 18bd4d12f8..ca9b6846ec 100644 --- a/src/test/regress/output/tablespace_1.source +++ b/src/test/regress/output/tablespace_1.source @@ -40,12 +40,9 @@ SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c (0 rows) PREPARE selectsource(int) AS SELECT $1; -ERROR: Postgres-XC does not support PREPARE yet -DETAIL: The feature is not currently supported CREATE TABLE testschema.asexecute TABLESPACE testspace AS EXECUTE selectsource(2); -ERROR: Postgres-XC does not support EXECUTE yet -DETAIL: The feature is not currently supported +ERROR: tablespace "testspace" does not exist SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c where c.reltablespace = t.oid AND c.relname = 'asexecute'; relname | spcname |