From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | Jim Mlodgenski <jimmy76(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Support for CREATE MODULE? |
Date: | 2021-06-02 15:14:36 |
Message-ID: | 2930661.1622646876@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruce Momjian <bruce(at)momjian(dot)us> writes:
> If we go in this direction, I assume we would just disallow a schema
> name matching the database name.
That seems quite impossible to enforce.
regression=# create database d1;
CREATE DATABASE
regression=# alter database d1 rename to d2;
ALTER DATABASE
The system had no way to know that d1 doesn't contain a schema named d2.
And you can't fix that by restricting the ALTER to be done on the
current database:
regression=# \c d2
You are now connected to database "d2" as user "postgres".
d2=# alter database d2 rename to d3;
ERROR: current database cannot be renamed
Between that and the point that this restriction would certainly break
existing installations, this is a non-starter.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Joel Jacobson | 2021-06-02 15:22:11 | Re: Support for CREATE MODULE? |
Previous Message | Joe Conway | 2021-06-02 15:11:42 | Re: Support for CREATE MODULE? |