hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject [2/2] incubator-hawq git commit: HAWQ-441. Change gp_dist_random('gp_id') to gp_dist_random('gp_version_at_initdb') in SQL files
Date Fri, 26 Feb 2016 02:55:19 GMT
HAWQ-441. Change gp_dist_random('gp_id') to gp_dist_random('gp_version_at_initdb') in SQL files


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

Branch: refs/heads/master
Commit: 1f37293f8dcaaf8e49424c3e2ccb2bf04939b038
Parents: 88b48f9
Author: Ming LI <mli@pivotal.io>
Authored: Fri Feb 26 10:45:36 2016 +0800
Committer: Ming LI <mli@pivotal.io>
Committed: Fri Feb 26 10:54:39 2016 +0800

----------------------------------------------------------------------
 src/backend/catalog/gp_toolkit.sql.in           |  8 +++---
 src/backend/utils/adt/dbsize.c                  |  8 +++---
 src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in  |  4 +--
 src/include/catalog/gp_persistent.h             |  2 +-
 .../regress/data/upgrade/upg2_catupgrade.sql.in |  2 +-
 .../data/upgrade/upg2_catupgrade_check.sql.in   |  4 +--
 .../data/upgrade41/upg2_catupgrade_41.sql.in    | 26 ++++++++++----------
 .../data/upgrade42/upg2_catupgrade_42.sql.in    | 16 ++++++------
 .../data/upgrade43/upg2_catupgrade_43.sql.in    |  2 +-
 src/test/regress/expected/percentile.out        |  4 +--
 src/test/regress/input/table_functions.source   |  6 ++---
 src/test/regress/output/caql.source             |  1 -
 src/test/regress/output/table_functions.source  | 14 +++++------
 .../output/table_functions_optimizer.source     | 12 ++++-----
 src/test/regress/output/tidycat.source          |  1 -
 src/test/regress/sql/percentile.sql             |  2 +-
 tools/bin/gppylib/gpcatalog.py                  |  1 -
 .../bin/gppylib/operations/rebalanceSegments.py |  2 +-
 18 files changed, 56 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/backend/catalog/gp_toolkit.sql.in
----------------------------------------------------------------------
diff --git a/src/backend/catalog/gp_toolkit.sql.in b/src/backend/catalog/gp_toolkit.sql.in
index ccd3212..9141d1e 100644
--- a/src/backend/catalog/gp_toolkit.sql.in
+++ b/src/backend/catalog/gp_toolkit.sql.in
@@ -1881,7 +1881,7 @@ GRANT EXECUTE ON FUNCTION %%JETPACK_PREFIX_AUX%%workfile_entries_f()
TO public;
 
 CREATE VIEW  %%JETPACK_PREFIX_AUX%%workfile_data AS
    SELECT C.*
-          FROM gp_dist_random('gp_id'), %%JETPACK_PREFIX_AUX%%workfile_entries_f() AS C (
+          FROM gp_dist_random('gp_version_at_initdb'), %%JETPACK_PREFIX_AUX%%workfile_entries_f()
AS C (
             segid int, 
             path text, 
             hash int, 
@@ -1898,7 +1898,7 @@ CREATE VIEW  %%JETPACK_PREFIX_AUX%%workfile_data AS
           )
     UNION ALL
     SELECT C.*
-          FROM gp_id, %%JETPACK_PREFIX_AUX%%workfile_entries_f() AS C (
+          FROM gp_version_at_initdb, %%JETPACK_PREFIX_AUX%%workfile_entries_f() AS C (
             segid int, 
             path text, 
             hash int, 
@@ -2024,9 +2024,9 @@ CREATE FUNCTION %%JETPACK_PREFIX%%workfile_cache_clear_segment(content
int)
 RETURNS SETOF int
 AS
 $$
- SELECT C.* FROM gp_dist_random('gp_id'), %%JETPACK_PREFIX_AUX%%workfile_cache_clear_f($1)
as C
+ SELECT C.* FROM gp_dist_random('gp_version_at_initdb'), %%JETPACK_PREFIX_AUX%%workfile_cache_clear_f($1)
as C
  UNION ALL
- SELECT C.* FROM gp_id, %%JETPACK_PREFIX_AUX%%workfile_cache_clear_f($1) as C;
+ SELECT C.* FROM gp_version_at_initdb, %%JETPACK_PREFIX_AUX%%workfile_cache_clear_f($1) as
C;
 $$
 LANGUAGE SQL;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/backend/utils/adt/dbsize.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 7103a99..12f70b9 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -344,7 +344,7 @@ pg_tablespace_size_oid(PG_FUNCTION_ARGS)
 		
 		initStringInfo(&buffer);
 
-		appendStringInfo(&buffer, "select sum(pg_tablespace_size(%u))::int8 from gp_dist_random('gp_id');",
tblspcOid);
+		appendStringInfo(&buffer, "select sum(pg_tablespace_size(%u))::int8 from gp_dist_random('gp_version_at_initdb');",
tblspcOid);
 
 		size += get_size_from_segDBs(buffer.data);
 	}
@@ -373,7 +373,7 @@ pg_tablespace_size_name(PG_FUNCTION_ARGS)
 
 		initStringInfo(&buffer);
 
-		appendStringInfo(&buffer, "select sum(pg_tablespace_size('%s'))::int8 from gp_dist_random('gp_id');",
NameStr(*tblspcName));
+		appendStringInfo(&buffer, "select sum(pg_tablespace_size('%s'))::int8 from gp_dist_random('gp_version_at_initdb');",
NameStr(*tblspcName));
 
 		size += get_size_from_segDBs(buffer.data);
 	}
@@ -609,7 +609,7 @@ pg_total_relation_size_oid(PG_FUNCTION_ARGS)
 
 		initStringInfo(&buffer);
 
-		appendStringInfo(&buffer, "select sum(pg_total_relation_size('%s.%s'))::int8 from gp_dist_random('gp_id');",
quote_identifier(schemaName), quote_identifier(relName));
+		appendStringInfo(&buffer, "select sum(pg_total_relation_size('%s.%s'))::int8 from gp_dist_random('gp_version_at_initdb');",
quote_identifier(schemaName), quote_identifier(relName));
 
 		size += get_size_from_segDBs(buffer.data);
 	}
@@ -655,7 +655,7 @@ pg_total_relation_size_name(PG_FUNCTION_ARGS)
 		rawname = DatumGetCString(DirectFunctionCall1(textout,
 													  PointerGetDatum(relname)));
 		
-		appendStringInfo(&buffer, "select sum(pg_total_relation_size('%s'))::int8 from gp_dist_random('gp_id');",
rawname);
+		appendStringInfo(&buffer, "select sum(pg_total_relation_size('%s'))::int8 from gp_dist_random('gp_version_at_initdb');",
rawname);
 		
 		size += get_size_from_segDBs(buffer.data);
 	}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in
----------------------------------------------------------------------
diff --git a/src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in b/src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in
index f63b550..d1f5cb1 100644
--- a/src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in
+++ b/src/bin/gp_workfile_mgr/gp_workfile_mgr.sql.in
@@ -32,9 +32,9 @@ CREATE FUNCTION gp_workfile_mgr_test_allsegs(testname text)
 RETURNS SETOF BOOL
 AS
 $$
- SELECT C.* FROM gp_dist_random('gp_id'), workfile.gp_workfile_mgr_test($1) as C
+ SELECT C.* FROM gp_dist_random('gp_version_at_initdb'), workfile.gp_workfile_mgr_test($1)
as C
  UNION ALL
- SELECT C.* FROM gp_id, workfile.gp_workfile_mgr_test($1) as C;
+ SELECT C.* FROM gp_version_at_initdb, workfile.gp_workfile_mgr_test($1) as C;
 $$
 LANGUAGE SQL;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/include/catalog/gp_persistent.h
----------------------------------------------------------------------
diff --git a/src/include/catalog/gp_persistent.h b/src/include/catalog/gp_persistent.h
index e07a626..0374070 100755
--- a/src/include/catalog/gp_persistent.h
+++ b/src/include/catalog/gp_persistent.h
@@ -580,7 +580,7 @@ inline static bool GpPersistent_SkipXLogInfo(
 		return true;
 	
 	/*
-	 * gp_id and pg_shdepend 
+	 * pg_shdepend 
 	 */
 	if (testOid == SharedDependRelationId)					// 1214
 		return true;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/data/upgrade/upg2_catupgrade.sql.in
----------------------------------------------------------------------
diff --git a/src/test/regress/data/upgrade/upg2_catupgrade.sql.in b/src/test/regress/data/upgrade/upg2_catupgrade.sql.in
index a50f374..68d26f0 100644
--- a/src/test/regress/data/upgrade/upg2_catupgrade.sql.in
+++ b/src/test/regress/data/upgrade/upg2_catupgrade.sql.in
@@ -44,7 +44,7 @@ create language plpgsql;
   -- EXECUTE 'SHOW gp_session_role' INTO role;
   -- IF dbid = 0 THEN
     -- IF role = 'dispatch' THEN
-      -- PERFORM @gpupgradeschemaname@.catDML(stmt) FROM gp_dist_random('gp_id');
+      -- PERFORM @gpupgradeschemaname@.catDML(stmt) FROM gp_dist_random('gp_version_at_initdb');
     -- END IF;
   -- END IF;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/data/upgrade/upg2_catupgrade_check.sql.in
----------------------------------------------------------------------
diff --git a/src/test/regress/data/upgrade/upg2_catupgrade_check.sql.in b/src/test/regress/data/upgrade/upg2_catupgrade_check.sql.in
index e72770c..5a0029b 100644
--- a/src/test/regress/data/upgrade/upg2_catupgrade_check.sql.in
+++ b/src/test/regress/data/upgrade/upg2_catupgrade_check.sql.in
@@ -28,7 +28,7 @@ $$ language 'plpgsql';
 create or replace function @gpupgradeschemaname@.addProcPIN(procid oid) returns int as $$
 begin
   INSERT INTO @gpupgradeschemaname@.pg_depend values(0,0,0, 1255, procid, 0, 'p');
-  PERFORM @gpupgradeschemaname@.catDML('INSERT INTO @gpupgradeschemaname@.pg_depend values(0,0,0,
1255, '||procid||', 0, ''p'')') from gp_dist_random('gp_id');
+  PERFORM @gpupgradeschemaname@.catDML('INSERT INTO @gpupgradeschemaname@.pg_depend values(0,0,0,
1255, '||procid||', 0, ''p'')') from gp_dist_random('gp_version_at_initdb');
   return 1;
 end;
 $$ language 'plpgsql';
@@ -55,7 +55,7 @@ select @gpupgradeschemaname@.catDML(
         where (tableoid,oid) not in (Select refclassid, refobjid from @gpupgradeschemaname@.pg_depend)
           and pronamespace = 11
           and oid < 16384')
-from gp_dist_random('gp_id');
+from gp_dist_random('gp_version_at_initdb');
 
 drop function @gpupgradeschemaname@.catDML(stmt text);
 drop function @gpupgradeschemaname@.addProcPIN(procid oid);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/data/upgrade41/upg2_catupgrade_41.sql.in
----------------------------------------------------------------------
diff --git a/src/test/regress/data/upgrade41/upg2_catupgrade_41.sql.in b/src/test/regress/data/upgrade41/upg2_catupgrade_41.sql.in
index 57a2f86..eb40c01 100644
--- a/src/test/regress/data/upgrade41/upg2_catupgrade_41.sql.in
+++ b/src/test/regress/data/upgrade41/upg2_catupgrade_41.sql.in
@@ -11,7 +11,7 @@
 -- or replacing the on-dist representation of views. These must be done DML.
 -- For example:
 --   update pg_catalog.pg_aggregate set dummy = 123;
---   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_id');
+--   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_version_at_initdb');
 --
 -- The first DML will populate the mater catalog and the second DML will update the catalog
 -- in all the segments.
@@ -59,16 +59,16 @@ comment on function @gpupgradeschemaname@.gp_persistent_set_relation_bufpool_kin
 is 'Populate the gp_persistent_relation_node table''s relation_bufpool_kind column for the
whole database instance for upgrade from 4.0 to 4.1';
 
 select gp_persistent_set_relation_bufpool_kind_all();
-select gp_persistent_set_relation_bufpool_kind_all() from gp_dist_random('gp_id');
+select gp_persistent_set_relation_bufpool_kind_all() from gp_dist_random('gp_version_at_initdb');
 
 update @gpupgradeschemaname@.pg_class set relhaspkey = true where oid = 5094;
-select catDML('update @gpupgradeschemaname@.pg_class set relhaspkey = true where oid = 5094')
from gp_dist_random('gp_id');
+select catDML('update @gpupgradeschemaname@.pg_class set relhaspkey = true where oid = 5094')
from gp_dist_random('gp_version_at_initdb');
 --
 -- Ordered Aggregates
 --
 alter table @gpupgradeschemaname@.pg_aggregate add column aggordered boolean;
 update @gpupgradeschemaname@.pg_aggregate set aggordered = 'f';
-select catDML('update @gpupgradeschemaname@.pg_aggregate set aggordered = ''f''') from gp_dist_random('gp_id');
+select catDML('update @gpupgradeschemaname@.pg_aggregate set aggordered = ''f''') from gp_dist_random('gp_version_at_initdb');
 
 ---
 --- PL/Java template
@@ -78,7 +78,7 @@ insert into @gpupgradeschemaname@.pg_pltemplate
   where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname='pljava')=0;
 select catDML('insert into @gpupgradeschemaname@.pg_pltemplate 
   select ''pljava'', false, ''pljava_call_handler'', null, ''$libdir/pljava'', null
-  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljava'')=0')
from gp_dist_random('gp_id');
+  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljava'')=0')
from gp_dist_random('gp_version_at_initdb');
 
 --------------------------------
 -- Re-create gp_toolkit
@@ -152,7 +152,7 @@ select 1/0 from pg_catalog.pg_opclass, pg_catalog.pg_namespace n where
opcnamesp
 select 1/0 from pg_catalog.pg_conversion, pg_catalog.pg_namespace n where connamespace =
n.oid and n.nspname = '@gpupgradetoolkitschema@';
 
 delete from @gpupgradeschemaname@.pg_depend where refobjid=8001;
-select catDML('delete from @gpupgradeschemaname@.pg_depend where refobjid=8001') from gp_dist_random('gp_id');
+select catDML('delete from @gpupgradeschemaname@.pg_depend where refobjid=8001') from gp_dist_random('gp_version_at_initdb');
 
 drop schema if exists @gpupgradetoolkitschema@;
 create schema @gpupgradetoolkitschema@;
@@ -507,7 +507,7 @@ CREATE OR REPLACE VIEW @gpupgradeschemaname@.pg_locks AS
 create writable external web table @gpupgradeschemaname@.pg_resqueue_delete (s text)
   execute 'PGOPTIONS=''-c gp_session_role=utility'' psql -p $GP_SEG_PORT --command "delete
from @gpupgradeschemaname@.pg_resqueue" template1 $GP_USER'
   format 'csv';
-select catDML('insert into @gpupgradeschemaname@.pg_resqueue_delete values(1)') from gp_dist_random('gp_id');
+select catDML('insert into @gpupgradeschemaname@.pg_resqueue_delete values(1)') from gp_dist_random('gp_version_at_initdb');
 drop external web table @gpupgradeschemaname@.pg_resqueue_delete;
 
 create writable external web table @gpupgradeschemaname@.pg_resqueue_rebuilt (
@@ -532,7 +532,7 @@ create or replace function @gpupgradeschemaname@.distributed_insert_gp_tmp(
 ) returns int as $$
 begin
   perform @gpupgradeschemaname@.insert_gp_tmp(rsqoid, rsqname, cnt, cost, oc, icost)
-    from gp_dist_random('gp_id');
+    from gp_dist_random('gp_version_at_initdb');
   return 1;
 end;
 $$ language 'plpgsql';
@@ -562,7 +562,7 @@ drop function @gpupgradeschemaname@.distributed_insert_gp_tmp(oid, name,
real, r
 create writable external web table @gpupgradeschemaname@.pg_resqueuecapability_delete (s
text)
   execute 'PGOPTIONS=''-c gp_session_role=utility'' psql -p $GP_SEG_PORT --command "delete
from @gpupgradeschemaname@.pg_resqueuecapability" template1 $GP_USER'
   format 'csv';
-select catDML('insert into @gpupgradeschemaname@.pg_resqueuecapability_delete values(1)')
from gp_dist_random('gp_id');
+select catDML('insert into @gpupgradeschemaname@.pg_resqueuecapability_delete values(1)')
from gp_dist_random('gp_version_at_initdb');
 drop external web table @gpupgradeschemaname@.pg_resqueuecapability_delete;
 
 create writable external web table @gpupgradeschemaname@.pg_resqueuecapability_rebuilt (
@@ -587,7 +587,7 @@ create or replace function @gpupgradeschemaname@.distributed_insert_gp_tmp(
 ) returns int as $$
 begin
   perform @gpupgradeschemaname@.insert_gp_tmp(rsqoid, resqueueid, restypid, ressetting)
-    from gp_dist_random('gp_id');
+    from gp_dist_random('gp_version_at_initdb');
   return 1;
 end;
 $$ language 'plpgsql';
@@ -615,7 +615,7 @@ drop function @gpupgradeschemaname@.distributed_insert_gp_tmp(rsqoid oid,
resque
 create writable external web table @gpupgradeschemaname@.pg_resourcetype_delete (s text)
   execute 'PGOPTIONS=''-c gp_session_role=utility'' psql -p $GP_SEG_PORT --command "delete
from @gpupgradeschemaname@.pg_resourcetype" template1 $GP_USER'
   format 'csv';
-select catDML('insert into @gpupgradeschemaname@.pg_resourcetype_delete values(1)') from
gp_dist_random('gp_id');
+select catDML('insert into @gpupgradeschemaname@.pg_resourcetype_delete values(1)') from
gp_dist_random('gp_version_at_initdb');
 drop external web table @gpupgradeschemaname@.pg_resourcetype_delete;
 
 create writable external web table @gpupgradeschemaname@.pg_resourcetype_rebuilt (
@@ -647,7 +647,7 @@ create or replace function @gpupgradeschemaname@.distributed_insert_gp_tmp(
 begin
   perform @gpupgradeschemaname@.insert_gp_tmp(rsqoid, resname, restypid, resrequired, reshasdefault,
   reshasdisable, resdefaultsetting, resdisabledsetting)
-    from gp_dist_random('gp_id');
+    from gp_dist_random('gp_version_at_initdb');
   return 1;
 end;
 $$ language 'plpgsql';
@@ -672,7 +672,7 @@ drop function @gpupgradeschemaname@.distributed_insert_gp_tmp(rsqoid oid,
resnam
 alter table @gpupgradeschemaname@.pg_authid add column rolcreaterexthdfs bool;
 alter table @gpupgradeschemaname@.pg_authid add column rolcreatewexthdfs bool;
 update @gpupgradeschemaname@.pg_authid set rolcreaterexthdfs = false, rolcreatewexthdfs =
false;
-select catDML('update @gpupgradeschemaname@.pg_authid set rolcreaterexthdfs = false, rolcreatewexthdfs
= false') from gp_dist_random('gp_id');
+select catDML('update @gpupgradeschemaname@.pg_authid set rolcreaterexthdfs = false, rolcreatewexthdfs
= false') from gp_dist_random('gp_version_at_initdb');
 
 -- sync pg_authid.rolsequeue between master and seg
 select catDML('select catDML(''update @gpupgradeschemaname@.pg_authid set rolresqueue ='||rolresqueue||'

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/data/upgrade42/upg2_catupgrade_42.sql.in
----------------------------------------------------------------------
diff --git a/src/test/regress/data/upgrade42/upg2_catupgrade_42.sql.in b/src/test/regress/data/upgrade42/upg2_catupgrade_42.sql.in
index 35b840d..2069592 100644
--- a/src/test/regress/data/upgrade42/upg2_catupgrade_42.sql.in
+++ b/src/test/regress/data/upgrade42/upg2_catupgrade_42.sql.in
@@ -11,7 +11,7 @@
 -- or replacing the on-disk representation of views. These must be done as DML.
 -- For example:
 --   update @gpupgradeschemaname@.pg_aggregate set dummy = 123;
---   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_id');
+--   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_version_at_initdb');
 --
 -- The first DML will populate the master catalog and the second DML will
 -- update the catalog in all the segments.
@@ -142,7 +142,7 @@ select @gpupgradeschemaname@.addProcPIN(2620, oid)
 delete from pg_depend where classid = 2620 and objid = (select oid from pg_trigger where
tgname = 'pg_sync_pg_auth_time_constraint' and tgrelid=2914);
 select @gpupgradeschemaname@.catDML(
   'delete from pg_depend where classid = 2620 and objid = (select oid from pg_trigger where
tgname = ''pg_sync_pg_auth_time_constraint'' and tgrelid=2914)')
-from gp_dist_random('gp_id');
+from gp_dist_random('gp_version_at_initdb');
 
 CREATE OR REPLACE VIEW @gpupgradeschemaname@.pg_max_external_files AS
     SELECT   address::name as hostname, count(*) as maxfiles
@@ -386,7 +386,7 @@ CREATE AGGREGATE @gpupgradeschemaname@.pg_partition_oid(oid, record) (
 update @gpupgradeschemaname@.pg_class set relhaspkey = false where relnamespace = 11 and
relname = 'gp_relation_node';
 select @gpupgradeschemaname@.catDML(
 'update @gpupgradeschemaname@.pg_class set relhaspkey = false where relnamespace = 11 and
relname = ''gp_relation_node''')
-from gp_dist_random('gp_id');
+from gp_dist_random('gp_version_at_initdb');
 
 
 ---
@@ -394,14 +394,14 @@ from gp_dist_random('gp_id');
 ---
 update @gpupgradeschemaname@.pg_pltemplate set tmpltrusted=true where tmplname='pljava';
 select catDML('update @gpupgradeschemaname@.pg_pltemplate set tmpltrusted=true where tmplname=''pljava''')
-  from gp_dist_random('gp_id');
+  from gp_dist_random('gp_version_at_initdb');
 
 insert into @gpupgradeschemaname@.pg_pltemplate 
   select 'pljavau', false, 'pljavau_call_handler', null, '$libdir/pljava', null
   where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname='pljavau')=0;
 select catDML('insert into @gpupgradeschemaname@.pg_pltemplate 
   select ''pljavau'', false, ''pljavau_call_handler'', null, ''$libdir/pljava'', null
-  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljavau'')=0')
from gp_dist_random('gp_id');
+  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljavau'')=0')
from gp_dist_random('gp_version_at_initdb');
 
 
 -- Column compression improvements assume that all CO tables have
@@ -454,7 +454,7 @@ INSERT INTO @gpupgradeschemaname@.pg_attribute_encoding
 		WHERE columnstore=''t'') a,
 		pg_attribute t
 		WHERE a.relid = t.attrelid AND t.attnum > 0;')
-	FROM gp_dist_random('gp_id');
+	FROM gp_dist_random('gp_version_at_initdb');
 
 -- pg_compression
 
@@ -488,14 +488,14 @@ drop schema __@gpupgradeschemaname@_gpmigrator;
 ---
 update @gpupgradeschemaname@.pg_pltemplate set tmpltrusted=true where tmplname='pljava';
 select catDML('update @gpupgradeschemaname@.pg_pltemplate set tmpltrusted=true where tmplname=''pljava''')
-  from gp_dist_random('gp_id');
+  from gp_dist_random('gp_version_at_initdb');
 
 insert into @gpupgradeschemaname@.pg_pltemplate 
   select 'pljavau', false, 'pljavau_call_handler', null, '$libdir/pljava', null
   where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname='pljavau')=0;
 select catDML('insert into @gpupgradeschemaname@.pg_pltemplate 
   select ''pljavau'', false, ''pljavau_call_handler'', null, ''$libdir/pljava'', null
-  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljavau'')=0')
from gp_dist_random('gp_id');
+  where (select count(*) from @gpupgradeschemaname@.pg_pltemplate where tmplname=''pljavau'')=0')
from gp_dist_random('gp_version_at_initdb');
 
 
 ---

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/data/upgrade43/upg2_catupgrade_43.sql.in
----------------------------------------------------------------------
diff --git a/src/test/regress/data/upgrade43/upg2_catupgrade_43.sql.in b/src/test/regress/data/upgrade43/upg2_catupgrade_43.sql.in
index b6ae513..3859c44 100644
--- a/src/test/regress/data/upgrade43/upg2_catupgrade_43.sql.in
+++ b/src/test/regress/data/upgrade43/upg2_catupgrade_43.sql.in
@@ -11,7 +11,7 @@
 -- or replacing the on-disk representation of views. These must be done as DML.
 -- For example:
 --   update @gpupgradeschemaname@.pg_aggregate set dummy = 123;
---   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_id');
+--   select catDML('update pg_catalog.pg_aggregate set dummy = 123') from gp_dist_random('gp_version_at_initdb');
 --
 -- make fundamental changes to pg_proc ...
 SELECT catDML('UPDATE pg_class SET relnatts = 20 WHERE relname = ''pg_proc''');

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/expected/percentile.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/percentile.out b/src/test/regress/expected/percentile.out
index a4857bf..3ca9f2f 100644
--- a/src/test/regress/expected/percentile.out
+++ b/src/test/regress/expected/percentile.out
@@ -1039,9 +1039,9 @@ ERROR:  argument of percentile function must not contain grouping(),
or group_id
 LINE 1: select percentile_disc(0.1) within group (order by group_id(...
                ^
 -- subquery is not allowed to the argument
-select percentile_cont((select 0.1 from gp_id)) within group (order by a) from perct;
+select percentile_cont((select 0.1 from gp_version_at_initdb)) within group (order by a)
from perct;
 ERROR:  argument of percentile function must not contain subqueries
-LINE 1: select percentile_cont((select 0.1 from gp_id)) within group...
+LINE 1: select percentile_cont((select 0.1 from gp_version_at_initdb)) within group...
                                ^
 -- the argument must not be volatile expression
 select percentile_cont(random()) within group (order by a) from perct;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/input/table_functions.source
----------------------------------------------------------------------
diff --git a/src/test/regress/input/table_functions.source b/src/test/regress/input/table_functions.source
index bda7cc6..e40a85f 100644
--- a/src/test/regress/input/table_functions.source
+++ b/src/test/regress/input/table_functions.source
@@ -418,9 +418,9 @@ SELECT * FROM multiset_5( TABLE(SELECT a, b from example)) where (a,b)
in (selec
 -- end equivalent
 
 -- Explain a couple interesting cases
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id) );
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER BY dbid)
);
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER RANDOMLY)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER BY schemaversion) );
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER RANDOMLY) );
 explain SELECT * FROM multiset_5( TABLE (SELECT * FROM example) );
 explain SELECT * from multiset_5( TABLE (SELECT * FROM example ORDER BY a limit 10 ) );
 explain SELECT * FROM multiset_5( TABLE (SELECT * FROM example SCATTER BY a) );

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/output/caql.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/caql.source b/src/test/regress/output/caql.source
index 7245604..0629547 100644
--- a/src/test/regress/output/caql.source
+++ b/src/test/regress/output/caql.source
@@ -407,7 +407,6 @@ WARNING:  skipping "gp_configuration" --- only table or database owner
can vacuu
 WARNING:  skipping "gp_configuration_history" --- only table or database owner can vacuum
it
 WARNING:  skipping "gp_db_interfaces" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_interfaces" --- only table or database owner can vacuum it
-WARNING:  skipping "gp_id" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_distribution_policy" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_version_at_initdb" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_segment_configuration" --- only table or database owner can vacuum
it

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/output/table_functions.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/table_functions.source b/src/test/regress/output/table_functions.source
index ee1e4fb..1ed4ac8 100644
--- a/src/test/regress/output/table_functions.source
+++ b/src/test/regress/output/table_functions.source
@@ -1545,32 +1545,32 @@ SELECT * FROM multiset_5( TABLE(SELECT a, b from example)) where (a,b)
in (selec
 
 -- end equivalent
 -- Explain a couple interesting cases
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id) );
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb)
);
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=64 width=36)
-   ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
+   ->  Seq Scan on gp_version_at_initdb  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (3 rows)
 
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER BY dbid)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER BY schemaversion) );
                                     QUERY PLAN                                    
 ----------------------------------------------------------------------------------
  Gather Motion 2:1  (slice2; segments: 2)  (cost=0.00..1.11 rows=4 width=36)
    ->  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=4 width=36)
          ->  Redistribute Motion 1:2  (slice1)  (cost=0.00..1.01 rows=8 width=66)
-               Hash Key: gp_id.dbid
-               ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
+               Hash Key: gp_version_at_initdb.schemaversion
+               ->  Seq Scan on gp_version_at_initdb  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (6 rows)
 
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER RANDOMLY)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER RANDOMLY) );
                                     QUERY PLAN                                    
 ----------------------------------------------------------------------------------
  Gather Motion 2:1  (slice2; segments: 2)  (cost=0.00..1.11 rows=4 width=36)
    ->  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=4 width=36)
          ->  Redistribute Motion 1:2  (slice1)  (cost=0.00..1.01 rows=8 width=66)
-               ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
+               ->  Seq Scan on gp_version_at_initdb  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (5 rows)
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/output/table_functions_optimizer.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/table_functions_optimizer.source b/src/test/regress/output/table_functions_optimizer.source
index 48b4b75..dd981e7 100644
--- a/src/test/regress/output/table_functions_optimizer.source
+++ b/src/test/regress/output/table_functions_optimizer.source
@@ -1546,32 +1546,32 @@ SELECT * FROM multiset_5( TABLE(SELECT a, b from example)) where (a,b)
in (selec
 
 -- end equivalent
 -- Explain a couple interesting cases
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id) );
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb)
);
                               QUERY PLAN                               
 -----------------------------------------------------------------------
  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=64 width=36)
-   ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
+   ->  Seq Scan on gp_version_at_initdb  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (3 rows)
 
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER BY dbid)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER BY schemaversion) );
                                     QUERY PLAN                                    
 ----------------------------------------------------------------------------------
  Gather Motion 2:1  (slice2; segments: 2)  (cost=0.00..1.11 rows=4 width=36)
    ->  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=4 width=36)
          ->  Redistribute Motion 1:2  (slice1)  (cost=0.00..1.01 rows=8 width=66)
-               Hash Key: gp_id.dbid
+               Hash Key: gp_version_at_initdb.schemaversion
                ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (6 rows)
 
-explain SELECT * FROM multiset_5( TABLE (SELECT dbid, gpname FROM gp_id SCATTER RANDOMLY)
);
+explain SELECT * FROM multiset_5( TABLE (SELECT schemaversion, productversion FROM gp_version_at_initdb
SCATTER RANDOMLY) );
                                     QUERY PLAN                                    
 ----------------------------------------------------------------------------------
  Gather Motion 2:1  (slice2; segments: 2)  (cost=0.00..1.11 rows=4 width=36)
    ->  Table Function Scan on multiset_5  (cost=0.00..1.11 rows=4 width=36)
          ->  Redistribute Motion 1:2  (slice1)  (cost=0.00..1.01 rows=8 width=66)
-               ->  Seq Scan on gp_id  (cost=0.00..1.01 rows=8 width=66)
+               ->  Seq Scan on gp_version_at_initdb  (cost=0.00..1.01 rows=8 width=66)
  Settings:  gp_segments_for_planner=8
 (5 rows)
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/output/tidycat.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/tidycat.source b/src/test/regress/output/tidycat.source
index 1e9ef96..6d62225 100644
--- a/src/test/regress/output/tidycat.source
+++ b/src/test/regress/output/tidycat.source
@@ -83,7 +83,6 @@ order by relname;
  gp_distribution_policy
  gp_fastsequence
  gp_global_sequence
- gp_id
  gp_interfaces
  gp_master_mirroring
  gp_persistent_database_node

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/src/test/regress/sql/percentile.sql
----------------------------------------------------------------------
diff --git a/src/test/regress/sql/percentile.sql b/src/test/regress/sql/percentile.sql
index 9d9f8d0..352b38b 100644
--- a/src/test/regress/sql/percentile.sql
+++ b/src/test/regress/sql/percentile.sql
@@ -200,7 +200,7 @@ select median(count(*)) from perct;
 select percentile_cont(0.2) within group (order by count(*) over()) from perct;
 select percentile_disc(0.1) within group (order by group_id()) from perct;
 -- subquery is not allowed to the argument
-select percentile_cont((select 0.1 from gp_id)) within group (order by a) from perct;
+select percentile_cont((select 0.1 from gp_version_at_initdb)) within group (order by a)
from perct;
 -- the argument must not be volatile expression
 select percentile_cont(random()) within group (order by a) from perct;
 -- out of range

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/tools/bin/gppylib/gpcatalog.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/gpcatalog.py b/tools/bin/gppylib/gpcatalog.py
index 45bf513..34461c8 100644
--- a/tools/bin/gppylib/gpcatalog.py
+++ b/tools/bin/gppylib/gpcatalog.py
@@ -72,7 +72,6 @@ PERSISTENT_TABLES = [
 
 # Hard coded tables that have different values on every segment
 SEGMENT_LOCAL_TABLES = [
-    'gp_id',
     'pg_depend',  # (not if we fix oid inconsistencies)
     'pg_shdepend', # (not if we fix oid inconsistencies)
     'gp_fastsequence', # AO segment row id allocations

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1f37293f/tools/bin/gppylib/operations/rebalanceSegments.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/operations/rebalanceSegments.py b/tools/bin/gppylib/operations/rebalanceSegments.py
index 71f894c..4379ffc 100644
--- a/tools/bin/gppylib/operations/rebalanceSegments.py
+++ b/tools/bin/gppylib/operations/rebalanceSegments.py
@@ -28,7 +28,7 @@ class ReconfigDetectionSQLQueryCommand(SQLCommand):
     """A distributed query that will cause the system to detect
     the reconfiguration of the system"""
     
-    query = "SELECT * FROM gp_dist_random('gp_id')"
+    query = "SELECT * FROM gp_dist_random('gp_version_at_initdb')"
     
     def __init__(self, conn):
         SQLCommand.__init__(self, "Reconfig detection sql query")


Mime
View raw message