You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by sansanichfb <gi...@git.apache.org> on 2016/02/02 23:32:44 UTC

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

GitHub user sansanichfb opened a pull request:

    https://github.com/apache/incubator-hawq/pull/324

    HAWQ-369. Hcatalog as reserved name.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-hawq HAWQ-369

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/324.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #324
    
----
commit f63652ab99cc3d4f3568849201b497dc83fc1291
Author: Oleksandr Diachenko <od...@pivotal.io>
Date:   2016-01-29T03:31:02Z

    HAWQ-369. Hcatalog as reserved name.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51652604
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog2;
    --- End diff --
    
    Good catch, removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51651061
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--positive test: can rename exiting schema to "hcatalog"
    --- End diff --
    
    existing, typo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51762472
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    --- End diff --
    
    Ok. Thanks for checking it. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658794
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    --- End diff --
    
    same


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658367
  
    --- Diff: doc/src/sgml/ref/alter_database.sgml ---
    @@ -154,6 +154,16 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla
        User-specific settings override database-specific
        ones if there is a conflict.
       </para>
    +
    +  <para>
    +   Currently RENAME TO is supported only when called by pgdump utility.
    +  </para>
    +  <para>
    +   User can not use "hcatalog" as a name for database, because it's reserved for Hcatalog integration feature.
    --- End diff --
    
    The naming convention is supposed to be "HCatalog", not "Hcatalog" - could you please change it in here and the line below?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51662958
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -848,11 +848,18 @@ createdb(CreatedbStmt *stmt)
     	 * Check for db name conflict.	This is just to give a more friendly error
     	 * message than "unique index violation".  There's a race condition but
     	 * we're willing to accept the less friendly message in that case.
    +	 * Also check that user is not trying to use "hcatalog" as a database name,
    +	 * because it's already reserved for hcatalog feature integration.
     	 */
     	if (OidIsValid(get_database_oid(dbname)))
    -		ereport(ERROR,
    -				(errcode(ERRCODE_DUPLICATE_DATABASE),
    -				 errmsg("database \"%s\" already exists", dbname)));
    +			if (strcmp(dbname, HcatalogDbName) == 0)
    +				ereport(ERROR,
    +						(errcode(ERRCODE_RESERVED_NAME),
    +						 errmsg("\"%s\" is a reserved name for hcatalog feature integration", HcatalogDbName)));
    --- End diff --
    
    updated :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51666509
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    --- End diff --
    
    ERRCODE_RESERVED_NAME error code is being referenced when trying to create/update object, so ERRCODE_UNDEFINED_DATABASE should be fine for this case. Also in current implementation, when users tries to  connect "hcatalog" database he is getting ERRCODE_UNDEFINED_DATABASE.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51652126
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog2;
    +
    +--negative test: cannot create a database using "hcatalog" as a template
    +CREATE DATABASE hcatalog2 TEMPLATE hcatalog;
    --- End diff --
    
    correct, just added positive case to ensure 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51666677
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,49 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename existing database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename existing schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--negative test: cannot create a database using "hcatalog" as a template
    +CREATE DATABASE hcatalog2 TEMPLATE hcatalog;
    +
    +--restrict renaming schemas and databases
    +SET gp_called_by_pgdump = false;
    +
     -- cleanup
     DROP schema test_schema cascade;
     SELECT convert_to_internal_schema('test_schema');
     DROP schema test_schema cascade;
     DROP schema test_schema2 cascade;
    +DROP schema hcatalog1 cascade;
    --- End diff --
    
    thanks, added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51649895
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    --- End diff --
    
    existing, typo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658990
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    +					errmsg("\"%s\" database is only for system use",
    --- End diff --
    
    perhaps add something like "cannot connect to database hcatalog. Database is only for system use"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/324


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/324#issuecomment-178903189
  
    Amazing job! 
    The only standing comment is about the error messages - we should decide if it's going to be "HCatalog integration feature" or "HCatalog feature integration"
    +100


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51659023
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    --- End diff --
    
    instead of undefined database, maybe use the reserved name error code?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51650643
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1555,6 +1570,13 @@ RenameDatabase(const char *oldname, const char *newname)
     		ereport(ERROR,
     				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
     				 errmsg("current database may not be renamed")));
    +	/*
    +	 * "hcatalog" database cannot be renamed
    +	 * */
    --- End diff --
    
    fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51666690
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    --- End diff --
    
    addressed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51650586
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog2;
    +
    +--negative test: cannot create a database using "hcatalog" as a template
    +CREATE DATABASE hcatalog2 TEMPLATE hcatalog;
    --- End diff --
    
    this is because hcatalog database doesn't set datistemplate=true property right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51652151
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +--negative test: cannot rename exiting database to "hcatalog"
    --- End diff --
    
    thanks, fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51667038
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    +					errmsg("\"%s\" database is only for system use",
    --- End diff --
    
    Examples of current errors for incorrect connections attempts:
    - psql: FATAL:  database "te" does not exist
    - psql: FATAL:  database "template0" is not currently accepting connections
    
    Error for "hcatalog":
    psql -d hcatalog;
    psql: FATAL:  "hcatalog" database is only for system use.
    
    So I think current error is enough and consistent with other similar errors.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51651107
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    --- End diff --
    
    thanks, fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51662992
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1533,6 +1540,15 @@ RenameDatabase(const char *oldname, const char *newname)
     	cqContext	cqc;
     	cqContext  *pcqCtx;
     
    +
    +	/*
    +	 * Make sure "hcatalog" is not used as new name, because it's reserved for
    +	 * hcatalog feature integration
    +	 */
    +	if (strcmp(newname, HcatalogDbName) == 0)
    +		ereport(ERROR,
    +				(errcode(ERRCODE_RESERVED_NAME),
    +				errmsg("\"%s\" is a reserved name for hcatalog feature integration", HcatalogDbName)));
    --- End diff --
    
    done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51662919
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -848,11 +848,18 @@ createdb(CreatedbStmt *stmt)
     	 * Check for db name conflict.	This is just to give a more friendly error
     	 * message than "unique index violation".  There's a race condition but
     	 * we're willing to accept the less friendly message in that case.
    +	 * Also check that user is not trying to use "hcatalog" as a database name,
    +	 * because it's already reserved for hcatalog feature integration.
    --- End diff --
    
    updated


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51650063
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename exiting schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog2;
    --- End diff --
    
    is it a duplicate from line 156?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51648526
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1533,6 +1540,14 @@ RenameDatabase(const char *oldname, const char *newname)
     	cqContext	cqc;
     	cqContext  *pcqCtx;
     
    +
    +	/*
    +	 * Make sure "hcatalog" is not used as new name, because it's reserved for
    +	 * hcatalog feature integration*/
    --- End diff --
    
    */ better have a separate line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658545
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -848,11 +848,18 @@ createdb(CreatedbStmt *stmt)
     	 * Check for db name conflict.	This is just to give a more friendly error
     	 * message than "unique index violation".  There's a race condition but
     	 * we're willing to accept the less friendly message in that case.
    +	 * Also check that user is not trying to use "hcatalog" as a database name,
    +	 * because it's already reserved for hcatalog feature integration.
    --- End diff --
    
    same - change to hcatalog integration feature or just hcatalog integration.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51648871
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1555,6 +1570,13 @@ RenameDatabase(const char *oldname, const char *newname)
     		ereport(ERROR,
     				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
     				 errmsg("current database may not be renamed")));
    +	/*
    +	 * "hcatalog" database cannot be renamed
    +	 * */
    --- End diff --
    
    keep comment format consistent. */


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51649304
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    --- End diff --
    
    comment is misleading. should be "allow renaming schemas but not databases"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658725
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1533,6 +1540,15 @@ RenameDatabase(const char *oldname, const char *newname)
     	cqContext	cqc;
     	cqContext  *pcqCtx;
     
    +
    +	/*
    +	 * Make sure "hcatalog" is not used as new name, because it's reserved for
    +	 * hcatalog feature integration
    +	 */
    +	if (strcmp(newname, HcatalogDbName) == 0)
    +		ereport(ERROR,
    +				(errcode(ERRCODE_RESERVED_NAME),
    +				errmsg("\"%s\" is a reserved name for hcatalog feature integration", HcatalogDbName)));
    --- End diff --
    
    same


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51649904
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    --- End diff --
    
    @GodenYao enabling this GUC allows rename both schemas and databases in general, so it's correct. By default HAWQ doesn't support renaming databases and schemas, only from pg_dump utility, added this in doc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51649861
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    --- End diff --
    
    existing, typo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658480
  
    --- Diff: doc/src/sgml/ref/create_database.sgml ---
    @@ -184,6 +184,10 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
        connection <quote>slot</> remains for the database, it is possible that
        both will fail.  Also, the limit is not enforced against superusers.
       </para>
    +
    +  <para>
    +   User can not create database named "hcatalog", because it's reserved for Hcatalog feature integration.
    --- End diff --
    
    change to "HCatalog integration feature" to match comments above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51651033
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename exiting database to "hcatalog"
    --- End diff --
    
    thanks, fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51663054
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    --- End diff --
    
    done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51651184
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    --- End diff --
    
    comment is misleading, should be "allow renaming schemas but not databases".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51652164
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +--negative test: cannot rename exiting database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--positive test: can rename exiting schema to "hcatalog"
    --- End diff --
    
    fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658614
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,51 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    --- End diff --
    
    got it... I thought it was to explain your test cases :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51762431
  
    --- Diff: src/backend/utils/init/postinit.c ---
    @@ -368,6 +368,22 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
     	char		dbname[NAMEDATALEN];
     
     	/*
    +	 * User is not supposed to connect to hcatalog database,
    +	 * because it's reserved for hcatalog feature integration
    +	 */
    +	if (!bootstrap)
    +	{
    +		if (strcmp(in_dbname, HcatalogDbName) == 0)
    +		{
    +			ereport(ERROR,
    +					(errcode(ERRCODE_UNDEFINED_DATABASE),
    +					errmsg("\"%s\" database is only for system use",
    --- End diff --
    
    Fair enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51662881
  
    --- Diff: doc/src/sgml/ref/create_database.sgml ---
    @@ -184,6 +184,10 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
        connection <quote>slot</> remains for the database, it is possible that
        both will fail.  Also, the limit is not enforced against superusers.
       </para>
    +
    +  <para>
    +   User can not create database named "hcatalog", because it's reserved for Hcatalog feature integration.
    --- End diff --
    
    sure, updated


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51658617
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -848,11 +848,18 @@ createdb(CreatedbStmt *stmt)
     	 * Check for db name conflict.	This is just to give a more friendly error
     	 * message than "unique index violation".  There's a race condition but
     	 * we're willing to accept the less friendly message in that case.
    +	 * Also check that user is not trying to use "hcatalog" as a database name,
    +	 * because it's already reserved for hcatalog feature integration.
     	 */
     	if (OidIsValid(get_database_oid(dbname)))
    -		ereport(ERROR,
    -				(errcode(ERRCODE_DUPLICATE_DATABASE),
    -				 errmsg("database \"%s\" already exists", dbname)));
    +			if (strcmp(dbname, HcatalogDbName) == 0)
    +				ereport(ERROR,
    +						(errcode(ERRCODE_RESERVED_NAME),
    +						 errmsg("\"%s\" is a reserved name for hcatalog feature integration", HcatalogDbName)));
    --- End diff --
    
    same comment about the message :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51659823
  
    --- Diff: src/test/regress/input/hcatalog_lookup.source ---
    @@ -138,16 +138,49 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
     select pg_catalog.pg_database_size('hcatalog');
     select pg_catalog.pg_database_size(6120);
     
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +
    +--negative test: cannot rename existing database to "hcatalog"
    +ALTER DATABASE regression RENAME TO hcatalog;
    +
    +--positive test: can rename existing schema to "hcatalog"
    +CREATE SCHEMA test_schema3;
    +ALTER SCHEMA test_schema3 RENAME to hcatalog;
    +
    +--positive test: can rename schema "hcatalog"
    +ALTER SCHEMA hcatalog RENAME to hcatalog1;
    +
    +--positive test: should be able to create schema named "hcatalog"
    +CREATE SCHEMA hcatalog;
    +
    +--negative test: cannot create a database using "hcatalog" as a template
    +CREATE DATABASE hcatalog2 TEMPLATE hcatalog;
    +
    +--restrict renaming schemas and databases
    +SET gp_called_by_pgdump = false;
    +
     -- cleanup
     DROP schema test_schema cascade;
     SELECT convert_to_internal_schema('test_schema');
     DROP schema test_schema cascade;
     DROP schema test_schema2 cascade;
    +DROP schema hcatalog1 cascade;
    --- End diff --
    
    missing drop for hcatalog schema


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51662616
  
    --- Diff: doc/src/sgml/ref/alter_database.sgml ---
    @@ -154,6 +154,16 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla
        User-specific settings override database-specific
        ones if there is a conflict.
       </para>
    +
    +  <para>
    +   Currently RENAME TO is supported only when called by pgdump utility.
    +  </para>
    +  <para>
    +   User can not use "hcatalog" as a name for database, because it's reserved for Hcatalog integration feature.
    --- End diff --
    
    Sure, updated all occurrences.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by GodenYao <gi...@git.apache.org>.
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51651026
  
    --- Diff: src/test/regress/output/hcatalog_lookup.source ---
    @@ -266,6 +266,29 @@ select pg_catalog.pg_database_size('hcatalog');
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
     select pg_catalog.pg_database_size(6120);
     ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
    +--positive test: should be able to create table named "hcatalog"
    +CREATE TABLE hcatalog(a int);
    +--negative test: cannot create database named "hcatalog"
    +CREATE DATABASE hcatalog;
    +ERROR:  "hcatalog" is a reserved name for hcatalog feature integration
    +--allow renaming schemas and databases
    +SET gp_called_by_pgdump = true;
    +--negative test: cannot rename exiting database to "hcatalog"
    --- End diff --
    
    existing, typo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-369. Hcatalog as reserved name.

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/324#discussion_r51650628
  
    --- Diff: src/backend/commands/dbcommands.c ---
    @@ -1533,6 +1540,14 @@ RenameDatabase(const char *oldname, const char *newname)
     	cqContext	cqc;
     	cqContext  *pcqCtx;
     
    +
    +	/*
    +	 * Make sure "hcatalog" is not used as new name, because it's reserved for
    +	 * hcatalog feature integration*/
    --- End diff --
    
    sure, fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---