Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 12055c8

Browse files
committed
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
1 parent eb68d71 commit 12055c8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2305,7 +2305,7 @@ PrepareTransaction(void)
23052305
if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPNAMESPACE))
23062306
ereport(ERROR,
23072307
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2308-
errmsg("cannot PREPARE a transaction that has operated on temporary namespace")));
2308+
errmsg("cannot PREPARE a transaction that has operated on temporary objects")));
23092309

23102310
/*
23112311
* Likewise, don't allow PREPARE after pg_export_snapshot. This could be

src/test/modules/test_extensions/expected/test_extensions.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ SELECT create_extension_with_temp_schema();
148148
(1 row)
149149

150150
PREPARE TRANSACTION 'twophase_extension';
151-
ERROR: cannot PREPARE a transaction that has operated on temporary namespace
151+
ERROR: cannot PREPARE a transaction that has operated on temporary objects
152152
-- Clean up
153153
DROP TABLE test_ext4_tab;
154154
DROP FUNCTION create_extension_with_temp_schema();

src/test/regress/expected/temp.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,19 @@ begin;
310310
create function pg_temp.twophase_func() returns void as
311311
$$ select '2pc_func'::text $$ language sql;
312312
prepare transaction 'twophase_func';
313-
ERROR: cannot PREPARE a transaction that has operated on temporary namespace
313+
ERROR: cannot PREPARE a transaction that has operated on temporary objects
314314
-- Function drop
315315
create function pg_temp.twophase_func() returns void as
316316
$$ select '2pc_func'::text $$ language sql;
317317
begin;
318318
drop function pg_temp.twophase_func();
319319
prepare transaction 'twophase_func';
320-
ERROR: cannot PREPARE a transaction that has operated on temporary namespace
320+
ERROR: cannot PREPARE a transaction that has operated on temporary objects
321321
-- Operator creation
322322
begin;
323323
create operator pg_temp.@@ (leftarg = int4, rightarg = int4, procedure = int4mi);
324324
prepare transaction 'twophase_operator';
325-
ERROR: cannot PREPARE a transaction that has operated on temporary namespace
325+
ERROR: cannot PREPARE a transaction that has operated on temporary objects
326326
-- These generate errors about temporary tables.
327327
begin;
328328
create type pg_temp.twophase_type as (a int);
@@ -374,4 +374,4 @@ SELECT current_schema() ~ 'pg_temp' AS is_temp_schema;
374374
(1 row)
375375

376376
PREPARE TRANSACTION 'twophase_search';
377-
ERROR: cannot PREPARE a transaction that has operated on temporary namespace
377+
ERROR: cannot PREPARE a transaction that has operated on temporary objects

0 commit comments

Comments
 (0)