[ https://issues.apache.org/jira/browse/HAWQ-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15129557#comment-15129557 ]
ASF GitHub Bot commented on HAWQ-369: ------------------------------------- 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. > Hcatalog as reserved name > ------------------------- > > Key: HAWQ-369 > URL: https://issues.apache.org/jira/browse/HAWQ-369 > Project: Apache HAWQ > Issue Type: New Feature > Components: PXF > Reporter: Goden Yao > Assignee: Goden Yao > Labels: Hcatalog > > https://github.com/apache/incubator-hawq/tree/master/src/test/regress > With Hcatalog integration, we've reserved "hcatalog" as keyword for the > following scenarios > *Acceptance Criteria* > 1. {code}CREATE DATABASE hcatalog{code} should fail with a reserved name error > {code} > "hcatalog" is a reserved name for hcatalog feature integration > {code} > 2. {code}CREATE SCHEMA hcatalog{code} should be fine. > 3. {code}CREATE TABLE hcatalog(hcatalog int){code} should be fine, there is > no ambiguity for table/column names. > 4. {code}ALTER DATABASE name RENAME to hcatalog{code} should fail with a > reserved name error > {code}"hcatalog" is a reserved name for hcatalog feature integration{code} > 5. {code}ALTER DATABASE hcatalog RENAME to xxx{code} should fail with a > system error > {code}permission denied to ALTER DATABASE hcatalog is reserved for system > use{code} > 6. {code}\connect hcatalog{code} should fail with a system error > {code}hcatalog database is only for system use{code} > 7. Add regression tests to the above scenarios -- This message was sent by Atlassian JIRA (v6.3.4#6332)