Skip to content
Snippets Groups Projects
Commit eb69147e authored by Peter Eisentraut's avatar Peter Eisentraut
Browse files

Adjust error message

We usually don't use "namespace" in user-facing error messages.  Also,
in master this was replaced by another error message referring to
"temporary objects", so we might as well use that here to avoid
introducing too many variants.

Discussion: https://www.postgresql.org/message-id/bbd3f8d9-e3d5-e5aa-4305-7f0121c3fa94@2ndquadrant.com
parent 638befaa
No related branches found
No related tags found
No related merge requests found
...@@ -2306,7 +2306,7 @@ PrepareTransaction(void) ...@@ -2306,7 +2306,7 @@ PrepareTransaction(void)
if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPNAMESPACE)) if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPNAMESPACE))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot PREPARE a transaction that has operated on temporary namespace"))); errmsg("cannot PREPARE a transaction that has operated on temporary objects")));
/* /*
* Likewise, don't allow PREPARE after pg_export_snapshot. This could be * Likewise, don't allow PREPARE after pg_export_snapshot. This could be
......
...@@ -148,7 +148,7 @@ SELECT create_extension_with_temp_schema(); ...@@ -148,7 +148,7 @@ SELECT create_extension_with_temp_schema();
(1 row) (1 row)
PREPARE TRANSACTION 'twophase_extension'; PREPARE TRANSACTION 'twophase_extension';
ERROR: cannot PREPARE a transaction that has operated on temporary namespace ERROR: cannot PREPARE a transaction that has operated on temporary objects
-- Clean up -- Clean up
DROP TABLE test_ext4_tab; DROP TABLE test_ext4_tab;
DROP FUNCTION create_extension_with_temp_schema(); DROP FUNCTION create_extension_with_temp_schema();
......
...@@ -310,19 +310,19 @@ begin; ...@@ -310,19 +310,19 @@ begin;
create function pg_temp.twophase_func() returns text as create function pg_temp.twophase_func() returns text as
$$ select '2pc_func'::text $$ language sql; $$ select '2pc_func'::text $$ language sql;
prepare transaction 'twophase_func'; prepare transaction 'twophase_func';
ERROR: cannot PREPARE a transaction that has operated on temporary namespace ERROR: cannot PREPARE a transaction that has operated on temporary objects
-- Function drop -- Function drop
create function pg_temp.twophase_func() returns text as create function pg_temp.twophase_func() returns text as
$$ select '2pc_func'::text $$ language sql; $$ select '2pc_func'::text $$ language sql;
begin; begin;
drop function pg_temp.twophase_func(); drop function pg_temp.twophase_func();
prepare transaction 'twophase_func'; prepare transaction 'twophase_func';
ERROR: cannot PREPARE a transaction that has operated on temporary namespace ERROR: cannot PREPARE a transaction that has operated on temporary objects
-- Operator creation -- Operator creation
begin; begin;
create operator pg_temp.@@ (leftarg = int4, rightarg = int4, procedure = int4mi); create operator pg_temp.@@ (leftarg = int4, rightarg = int4, procedure = int4mi);
prepare transaction 'twophase_operator'; prepare transaction 'twophase_operator';
ERROR: cannot PREPARE a transaction that has operated on temporary namespace ERROR: cannot PREPARE a transaction that has operated on temporary objects
-- These generate errors about temporary tables. -- These generate errors about temporary tables.
begin; begin;
create type pg_temp.twophase_type as (a int); create type pg_temp.twophase_type as (a int);
...@@ -374,4 +374,4 @@ SELECT current_schema() ~ 'pg_temp' AS is_temp_schema; ...@@ -374,4 +374,4 @@ SELECT current_schema() ~ 'pg_temp' AS is_temp_schema;
(1 row) (1 row)
PREPARE TRANSACTION 'twophase_search'; PREPARE TRANSACTION 'twophase_search';
ERROR: cannot PREPARE a transaction that has operated on temporary namespace ERROR: cannot PREPARE a transaction that has operated on temporary objects
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment