mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
Checking to decide whether relations are system relations now depends
on the namespace not the name; pg_ is not a reserved prefix for table names anymore. From Fernando Nasser.
This commit is contained in:
@@ -296,6 +296,9 @@ SELECT * FROM foo_seq_new;
|
||||
(1 row)
|
||||
|
||||
DROP SEQUENCE foo_seq_new;
|
||||
-- toast-like relation name
|
||||
alter table stud_emp rename to pg_toast_stud_emp;
|
||||
alter table pg_toast_stud_emp rename to stud_emp;
|
||||
-- FOREIGN KEY CONSTRAINT adding TEST
|
||||
CREATE TABLE tmp2 (a int primary key);
|
||||
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'tmp2_pkey' for table 'tmp2'
|
||||
|
||||
@@ -66,9 +66,6 @@ ERROR: Relation "nonesuch" does not exist
|
||||
-- no such relation
|
||||
alter table nonesuch rename to stud_emp;
|
||||
ERROR: Relation "nonesuch" does not exist
|
||||
-- system relation
|
||||
alter table stud_emp rename to pg_stud_emp;
|
||||
ERROR: renamerel: Illegal class name: "pg_stud_emp" -- pg_ is reserved for system catalogs
|
||||
-- conflict
|
||||
alter table stud_emp rename to aggtest;
|
||||
ERROR: renamerel: relation "aggtest" exists
|
||||
|
||||
@@ -178,6 +178,9 @@ CREATE SEQUENCE foo_seq;
|
||||
ALTER TABLE foo_seq RENAME TO foo_seq_new;
|
||||
SELECT * FROM foo_seq_new;
|
||||
DROP SEQUENCE foo_seq_new;
|
||||
-- toast-like relation name
|
||||
alter table stud_emp rename to pg_toast_stud_emp;
|
||||
alter table pg_toast_stud_emp rename to stud_emp;
|
||||
|
||||
-- FOREIGN KEY CONSTRAINT adding TEST
|
||||
|
||||
|
||||
@@ -77,9 +77,6 @@ alter table nonesuch rename to newnonesuch;
|
||||
-- no such relation
|
||||
alter table nonesuch rename to stud_emp;
|
||||
|
||||
-- system relation
|
||||
alter table stud_emp rename to pg_stud_emp;
|
||||
|
||||
-- conflict
|
||||
alter table stud_emp rename to aggtest;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user