-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for Babelfish v5.1 (#3304)
This commit contains the following changes: Add version info and upgrade test for 14.15, 15.10, 16.6 and 17.2. Add upgrade schedule files for 14.16, 15.11, 16.7 and 17.3. Update T-SQL extension version to 5.1.0 and add following upgrade scripts: babelfishpg_common--3.8.0--4.0.0.sql babelfishpg_common--4.5.0--5.0.0.sql babelfishpg_tsql--4.5.0--5.0.0.sql babelfishpg_tsql--5.0.0--5.1.0.sql Update common extension version to 5.1.0 and add following upgrade scripts: babelfish_common_helper--5.0.0--5.1.0.sql spatial_types--5.0.0--5.1.0.sql Task: NO-JIRA Signed-off-by: Rishabh Tanwar [email protected]
- Loading branch information
1 parent
d408de5
commit 7d320ef
Showing
18 changed files
with
2,388 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
BBFPGCMN_MAJOR_VERSION=5 | ||
BBFPGCMN_MINOR_VERSION=0 | ||
BBFPGCMN_MINOR_VERSION=1 | ||
BBFPGCMN_MICRO_VERSION=0 | ||
|
18 changes: 18 additions & 0 deletions
18
contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--5.0.0--5.1.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
------------------------------------------------------------------------------ | ||
---- Include changes related to other datatypes except spatial types here ---- | ||
------------------------------------------------------------------------------ | ||
|
||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO '5.1.0'" to load this file. \quit | ||
|
||
SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false); | ||
|
||
-- Please add your SQLs here | ||
/* | ||
* Note: These SQL statements may get executed multiple times specially when some features get backpatched. | ||
* So make sure that any SQL statement (DDL/DML) being added here can be executed multiple times without affecting | ||
* final behaviour. | ||
*/ | ||
|
||
-- Reset search_path to not affect any subsequent scripts | ||
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); |
2 changes: 2 additions & 0 deletions
2
contrib/babelfishpg_common/sql/upgrades/babelfishpg_common--3.8.0--4.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO '4.0.0'" to load this file. \quit |
2 changes: 2 additions & 0 deletions
2
contrib/babelfishpg_common/sql/upgrades/babelfishpg_common--4.5.0--5.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO '5.0.0'" to load this file. \quit |
3 changes: 3 additions & 0 deletions
3
contrib/babelfishpg_common/sql/upgrades/spatial_types--5.0.0--5.1.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
------------------------------------------------------- | ||
---- Include changes related to spatial types here ---- | ||
------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--4.5.0--5.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_tsql"" UPDATE TO '5.0.0'" to load this file. \quit | ||
|
||
-- add 'sys' to search path for the convenience | ||
SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false); | ||
|
||
-- please add your SQL here | ||
/* | ||
* Note: These SQL statements may get executed multiple times specially when some features get backpatched. | ||
* So make sure that any SQL statement (DDL/DML) being added here can be executed multiple times without affecting | ||
* final behaviour. | ||
*/ | ||
|
||
CREATE OR REPLACE FUNCTION sys.babelfish_update_server_collation_name() RETURNS VOID | ||
LANGUAGE C | ||
AS 'babelfishpg_common', 'babelfish_update_server_collation_name'; | ||
|
||
DO | ||
LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
-- Check if the GUC is empty | ||
IF current_setting('babelfishpg_tsql.restored_server_collation_name', true) <> '' THEN | ||
-- Call the function to update the collation | ||
EXECUTE 'SELECT sys.babelfish_update_server_collation_name()'; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DROP FUNCTION sys.babelfish_update_server_collation_name(); | ||
|
||
-- reset babelfishpg_tsql.restored_server_collation_name GUC | ||
do | ||
language plpgsql | ||
$$ | ||
declare | ||
query text; | ||
begin | ||
query := pg_catalog.format('alter database %s reset babelfishpg_tsql.restored_server_collation_name', CURRENT_DATABASE()); | ||
execute query; | ||
end; | ||
$$; | ||
|
||
-- After upgrade, always run analyze for all babelfish catalogs. | ||
CALL sys.analyze_babelfish_catalogs(); | ||
|
||
-- Reset search_path to not affect any subsequent scripts | ||
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); |
46 changes: 46 additions & 0 deletions
46
contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--5.0.0--5.1.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_tsql"" UPDATE TO '5.1.0'" to load this file. \quit | ||
-- add 'sys' to search path for the convenience | ||
SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false); | ||
|
||
CREATE OR REPLACE FUNCTION sys.babelfish_update_server_collation_name() RETURNS VOID | ||
LANGUAGE C | ||
AS 'babelfishpg_common', 'babelfish_update_server_collation_name'; | ||
|
||
DO | ||
LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
-- Check if the GUC is empty | ||
IF current_setting('babelfishpg_tsql.restored_server_collation_name', true) <> '' THEN | ||
-- Call the function to update the collation | ||
EXECUTE 'SELECT sys.babelfish_update_server_collation_name()'; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DROP FUNCTION sys.babelfish_update_server_collation_name(); | ||
|
||
-- reset babelfishpg_tsql.restored_server_collation_name GUC | ||
do | ||
language plpgsql | ||
$$ | ||
declare | ||
query text; | ||
begin | ||
query := pg_catalog.format('alter database %s reset babelfishpg_tsql.restored_server_collation_name', CURRENT_DATABASE()); | ||
execute query; | ||
end; | ||
$$; | ||
|
||
-- Please add your SQLs here | ||
/* | ||
* Note: These SQL statements may get executed multiple times specially when some features get backpatched. | ||
* So make sure that any SQL statement (DDL/DML) being added here can be executed multiple times without affecting | ||
* final behaviour. | ||
*/ | ||
|
||
-- After upgrade, always run analyze for all babelfish catalogs. | ||
CALL sys.analyze_babelfish_catalogs(); | ||
-- Reset search_path to not affect any subsequent scripts | ||
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.