Thread: pgsql: Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERRO

pgsql: Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERRO

From
Robert Haas
Date:
Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERROR.

This was already true for CREATE EXTENSION, but historically has not
been true for other object types.  Therefore, this is a backward
incompatibility.  Per discussion on pgsql-hackers, everyone seems to
agree that the new behavior is better.

Marti Raudsepp, reviewed by Haribabu Kommi and myself

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bc4996e61b98d41eacf991c18508b7a2305a68c6

Modified Files
--------------
src/backend/catalog/namespace.c             |   19 +++---------
src/backend/catalog/pg_constraint.c         |    3 +-
src/backend/commands/alter.c                |   12 +++++++-
src/backend/commands/tablecmds.c            |   14 ++++++---
src/backend/commands/typecmds.c             |   42 ++++++++++++++++-----------
src/include/catalog/namespace.h             |    3 +-
src/test/regress/expected/alter_generic.out |    1 +
src/test/regress/expected/alter_table.out   |    5 ++--
src/test/regress/sql/alter_generic.sql      |    1 +
src/test/regress/sql/alter_table.sql        |    4 ++-
10 files changed, 61 insertions(+), 43 deletions(-)


Re: pgsql: Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERRO

From
Andres Freund
Date:
On 2015-11-19 15:51:33 +0000, Robert Haas wrote:
> Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERROR.

Trying to undertstand what this changes I noticed this borked numbering:
 /*
  * Common checks on switching namespaces.
  *
- * We complain if (1) the old and new namespaces are the same, (2) either the
- * old or new namespaces is a temporary schema (or temporary toast schema), or
- * (3) either the old or new namespaces is the TOAST schema.
+ * We complain if (1) either the old or new namespaces is a temporary schema
+ * (or temporary toast schema), or (3) either the old or new namespaces is the
+ * TOAST schema.
  */

Maybe just remove the the numbers?


- Andres


Re: pgsql: Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERRO

From
Robert Haas
Date:
On Thu, Nov 19, 2015 at 2:57 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2015-11-19 15:51:33 +0000, Robert Haas wrote:
>> Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERROR.
>
> Trying to undertstand what this changes I noticed this borked numbering:
>  /*
>   * Common checks on switching namespaces.
>   *
> - * We complain if (1) the old and new namespaces are the same, (2) either the
> - * old or new namespaces is a temporary schema (or temporary toast schema), or
> - * (3) either the old or new namespaces is the TOAST schema.
> + * We complain if (1) either the old or new namespaces is a temporary schema
> + * (or temporary toast schema), or (3) either the old or new namespaces is the
> + * TOAST schema.
>   */
>
> Maybe just remove the the numbers?

OK, sure.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company