incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 d00a2ab5a -> 9db45b948 (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/9db45b94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/9db45b94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/9db45b94

Branch: refs/heads/HAWQ-369
Commit: 9db45b9484d90497227e8e5e87cc99941cfc2da9
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 18:56:14 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 ++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 29 --
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 34 +
 src/test/regress/output/hcatalog_lookup.source | 28 +
 6 files changed, 118 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9db45b94/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..b8fbbda 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for HCatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for HCatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9db45b94/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..e252fe3 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
HCatalog integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9db45b94/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..1f61f5e 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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 integration feature.
 */
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 integration feature", HcatalogDbName)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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 integration feature
+*/
+   if (strcmp(newname, HcatalogDbName) == 0)
+   ereport(ERROR,
+   (errcode(ERRCODE_RESERVED_NAME),
+   errmsg("\"%s\" is a reserved name for HCatalog 
inte

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 9c01445b6 -> d00a2ab5a (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/d00a2ab5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/d00a2ab5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/d00a2ab5

Branch: refs/heads/HAWQ-369
Commit: d00a2ab5a89da0edd2c7cac17603ffeb2907e729
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 17:45:30 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 ++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 29 --
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 34 +
 src/test/regress/output/hcatalog_lookup.source | 28 +
 6 files changed, 118 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d00a2ab5/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..b8fbbda 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for HCatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for HCatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d00a2ab5/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..e252fe3 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
HCatalog integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d00a2ab5/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..b930d16 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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 integration feature.
 */
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 integration feature", HcatalogDbName)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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 integration feature
+*/
+   if (strcmp(newname, HcatalogDbName) == 0)
+   ereport(ERROR,
+   (errcode(ERRCODE_RESERVED_NAME),
+   errmsg("\"%s\" is a reserved name for Hcatalog 
inte

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 f52d66d01 -> 9c01445b6 (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/9c01445b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/9c01445b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/9c01445b

Branch: refs/heads/HAWQ-369
Commit: 9c01445b6d13ff44b226dff4a0d8bdcd3a7ad8fc
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 17:42:51 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 ++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 29 --
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 34 +
 src/test/regress/output/hcatalog_lookup.source | 28 +
 6 files changed, 118 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9c01445b/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..b8fbbda 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for HCatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for HCatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9c01445b/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..e252fe3 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
HCatalog integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9c01445b/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..b930d16 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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 integration feature.
 */
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 integration feature", HcatalogDbName)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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 integration feature
+*/
+   if (strcmp(newname, HcatalogDbName) == 0)
+   ereport(ERROR,
+   (errcode(ERRCODE_RESERVED_NAME),
+   errmsg("\"%s\" is a reserved name for Hcatalog 
inte

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 8ac40b625 -> f52d66d01 (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/f52d66d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/f52d66d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/f52d66d0

Branch: refs/heads/HAWQ-369
Commit: f52d66d01578a3bb1de1937b42d27ba6e0da1918
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 17:40:39 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 ++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 29 --
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 34 +
 src/test/regress/output/hcatalog_lookup.source | 28 +
 6 files changed, 118 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f52d66d0/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..b8fbbda 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for HCatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for HCatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f52d66d0/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..e252fe3 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
HCatalog integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f52d66d0/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..0d24e15 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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 integration feature.
 */
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 integration feature", HcatalogDbName)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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 
inte

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 f63652ab9 -> 8ac40b625 (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/8ac40b62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/8ac40b62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/8ac40b62

Branch: refs/heads/HAWQ-369
Commit: 8ac40b625ab452a0826dc14f3b6e7b319e103cd4
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 15:42:11 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 +++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 29 --
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 33 +
 src/test/regress/output/hcatalog_lookup.source | 27 +
 6 files changed, 116 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8ac40b62/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..1452e9a 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for Hcatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for Hcatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8ac40b62/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..0e28619 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
Hcatalog feature integration.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8ac40b62/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..4a6500e 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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 
fea

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 a23f631da -> f63652ab9 (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/f63652ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/f63652ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/f63652ab

Branch: refs/heads/HAWQ-369
Commit: f63652ab99cc3d4f3568849201b497dc83fc1291
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 13:21:41 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   | 10 ++
 doc/src/sgml/ref/create_database.sgml  |  4 +++
 src/backend/commands/dbcommands.c  | 28 +++--
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 35 +
 src/test/regress/output/hcatalog_lookup.source | 29 +
 6 files changed, 119 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f63652ab/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..1452e9a 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,16 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
+  
+   User can not use "hcatalog" as a name for database, because it's reserved 
for Hcatalog integration feature.
+  
+  
+   User can not rename "hcatalog" database, because it's reserved for Hcatalog 
integration feature.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f63652ab/doc/src/sgml/ref/create_database.sgml
--
diff --git a/doc/src/sgml/ref/create_database.sgml 
b/doc/src/sgml/ref/create_database.sgml
index 3183e2a..0e28619 100755
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -184,6 +184,10 @@ CREATE DATABASE name
connection slot remains for the database, it is possible that
both will fail.  Also, the limit is not enforced against superusers.
   
+
+  
+   User can not create database named "hcatalog", because it's reserved for 
Hcatalog feature integration.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f63652ab/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..635d986 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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*/
+   if (strcmp(newname, HcatalogDbName) == 0)
+   ereport(ERROR,
+   (errcode(ERRCODE_RESERVED_NAME),
+   errmsg("\"%s\" is a reserved name for hcatalog 
feature integra

incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name. [Forced Update!]

2016-02-02 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-369 131bb8e88 -> a23f631da (forced update)


HAWQ-369. Hcatalog as reserved name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/a23f631d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/a23f631d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/a23f631d

Branch: refs/heads/HAWQ-369
Commit: a23f631daad02a2ab7d877a082e2f86953f73163
Parents: 226a55c
Author: Oleksandr Diachenko 
Authored: Thu Jan 28 19:31:02 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Feb 2 12:59:38 2016 -0800

--
 doc/src/sgml/ref/alter_database.sgml   |  4 +++
 src/backend/commands/dbcommands.c  | 28 +++--
 src/backend/utils/init/postinit.c  | 16 ++
 src/test/regress/input/hcatalog_lookup.source  | 35 +
 src/test/regress/output/hcatalog_lookup.source | 29 +
 5 files changed, 109 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a23f631d/doc/src/sgml/ref/alter_database.sgml
--
diff --git a/doc/src/sgml/ref/alter_database.sgml 
b/doc/src/sgml/ref/alter_database.sgml
index 8ddff97..191a513 100755
--- a/doc/src/sgml/ref/alter_database.sgml
+++ b/doc/src/sgml/ref/alter_database.sgml
@@ -154,6 +154,10 @@ ALTER DATABASE name OWNER TO 
+
+  
+   Currently RENAME TO is supported only when called by pgdump utility.
+  
  
 
  

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a23f631d/src/backend/commands/dbcommands.c
--
diff --git a/src/backend/commands/dbcommands.c 
b/src/backend/commands/dbcommands.c
index f80e01a..635d986 100644
--- a/src/backend/commands/dbcommands.c
+++ b/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)));
+   else
+   ereport(ERROR,
+   
(errcode(ERRCODE_DUPLICATE_DATABASE),
+   errmsg("database \"%s\" already 
exists", dbname)));
 
/*
 * Select an OID for the new database, checking that it doesn't have
@@ -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*/
+   if (strcmp(newname, HcatalogDbName) == 0)
+   ereport(ERROR,
+   (errcode(ERRCODE_RESERVED_NAME),
+   errmsg("\"%s\" is a reserved name for hcatalog 
feature integration", HcatalogDbName)));
/*
 * Look up the target database's OID, and get exclusive lock on it. We
 * need this for the same reasons as DROP DATABASE.
@@ -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
+* */
+   if (db_id == HcatalogDbOid)
+   ereport(ERROR,
+   (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+   errmsg("permission denied to ALTER DATABASE 
\"%s\" is reserved for system use", HcatalogDbName)));
 
/*
 * Make sure the database does not have active sessions.  This is the 
same

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a23f631d/src/backend/utils/init/postinit.c
-