-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Strategy, Locale Provider, ICU Locale, ICU Rules, and OID optio…
…ns while creating a database. #6383
- Loading branch information
1 parent
39a1492
commit c0b868b
Showing
57 changed files
with
2,351 additions
and
26 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
29 changes: 29 additions & 0 deletions
29
...gadmin/browser/server_groups/servers/databases/templates/databases/sql/15_plus/create.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,29 @@ | ||
{% if data %} | ||
CREATE DATABASE {{ conn|qtIdent(data.name) }} | ||
{% if data.datowner %} | ||
WITH{% endif %}{% if data.datowner %} | ||
|
||
OWNER = {{ conn|qtIdent(data.datowner) }}{% endif %}{% if data.template %} | ||
|
||
TEMPLATE = {{ conn|qtIdent(data.template) }}{% endif %}{% if data.encoding %} | ||
|
||
ENCODING = {{ data.encoding|qtLiteral(conn) }}{% endif %}{% if data.datstrategy %} | ||
|
||
STRATEGY = {{ data.datstrategy|qtLiteral(conn) }}{% endif %}{% if data.datcollate %} | ||
|
||
LC_COLLATE = {{ data.datcollate|qtLiteral(conn) }}{% endif %}{% if data.datctype %} | ||
|
||
LC_CTYPE = {{ data.datctype|qtLiteral(conn) }}{% endif %}{% if data.daticulocale %} | ||
|
||
ICU_LOCALE = {{ data.daticulocale|qtLiteral(conn) }}{% endif %}{% if data.datlocaleprovider %} | ||
|
||
LOCALE_PROVIDER = {{ data.datlocaleprovider|qtLiteral(conn) }}{% endif %}{% if data.spcname %} | ||
|
||
TABLESPACE = {{ conn|qtIdent(data.spcname) }}{% endif %}{% if data.datconnlimit %} | ||
|
||
CONNECTION LIMIT = {{ data.datconnlimit }}{% endif %}{% if data.datoid %} | ||
|
||
OID = {{ data.datoid }}{% endif %} | ||
|
||
IS_TEMPLATE = {{ data.is_template }}; | ||
{% endif %} |
1 change: 1 addition & 0 deletions
1
...rowser/server_groups/servers/databases/templates/databases/sql/15_plus/get_icu_locale.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 @@ | ||
SELECT colliculocale from pg_collation where collprovider = 'i' |
44 changes: 44 additions & 0 deletions
44
...in/browser/server_groups/servers/databases/templates/databases/sql/15_plus/properties.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,44 @@ | ||
SELECT | ||
db.oid AS did, db.oid, db.datname AS name, db.dattablespace AS spcoid, | ||
spcname, datallowconn, pg_catalog.pg_encoding_to_char(encoding) AS encoding, | ||
pg_catalog.pg_get_userbyid(datdba) AS datowner, | ||
(select pg_catalog.current_setting('lc_collate')) as datcollate, | ||
(select pg_catalog.current_setting('lc_ctype')) as datctype, | ||
CASE WHEN datlocprovider = 'i' THEN 'icu' ELSE 'libc' END datlocaleprovider, | ||
daticulocale, datcollversion, | ||
datconnlimit, | ||
pg_catalog.has_database_privilege(db.oid, 'CREATE') AS cancreate, | ||
pg_catalog.current_setting('default_tablespace') AS default_tablespace, | ||
descr.description AS comments, db.datistemplate AS is_template, | ||
{### Default ACL for Tables ###} | ||
'' AS tblacl, | ||
{### Default ACL for Sequnces ###} | ||
'' AS seqacl, | ||
{### Default ACL for Functions ###} | ||
'' AS funcacl, | ||
pg_catalog.array_to_string(datacl::text[], ', ') AS acl | ||
FROM pg_catalog.pg_database db | ||
LEFT OUTER JOIN pg_catalog.pg_tablespace ta ON db.dattablespace=ta.OID | ||
LEFT OUTER JOIN pg_catalog.pg_shdescription descr ON ( | ||
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass | ||
) | ||
WHERE | ||
{% if show_user_defined_templates is defined %} | ||
db.datistemplate = {{show_user_defined_templates}} AND | ||
{% endif %} | ||
{% if did %} | ||
db.oid = {{ did|qtLiteral(conn) }}::OID | ||
{% else %} | ||
{% if name %} | ||
db.datname = {{ name|qtLiteral(conn) }}::text | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if db_restrictions %} | ||
{% if did or name %}AND{% endif %} | ||
db.datname in ({{db_restrictions}}) | ||
{% elif not did and not name%} | ||
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb') | ||
{% endif %} | ||
|
||
ORDER BY datname; |
31 changes: 31 additions & 0 deletions
31
...gadmin/browser/server_groups/servers/databases/templates/databases/sql/16_plus/create.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,31 @@ | ||
{% if data %} | ||
CREATE DATABASE {{ conn|qtIdent(data.name) }} | ||
{% if data.datowner %} | ||
WITH{% endif %}{% if data.datowner %} | ||
|
||
OWNER = {{ conn|qtIdent(data.datowner) }}{% endif %}{% if data.template %} | ||
|
||
TEMPLATE = {{ conn|qtIdent(data.template) }}{% endif %}{% if data.encoding %} | ||
|
||
ENCODING = {{ data.encoding|qtLiteral(conn) }}{% endif %}{% if data.datstrategy %} | ||
|
||
STRATEGY = {{ data.datstrategy|qtLiteral(conn) }}{% endif %}{% if data.datcollate %} | ||
|
||
LC_COLLATE = {{ data.datcollate|qtLiteral(conn) }}{% endif %}{% if data.datctype %} | ||
|
||
LC_CTYPE = {{ data.datctype|qtLiteral(conn) }}{% endif %}{% if data.daticulocale %} | ||
|
||
ICU_LOCALE = {{ data.daticulocale|qtLiteral(conn) }}{% endif %}{% if data.daticurules %} | ||
|
||
ICU_RULES = {{ data.daticurules|qtLiteral(conn) }}{% endif %}{% if data.datlocaleprovider %} | ||
|
||
LOCALE_PROVIDER = {{ data.datlocaleprovider|qtLiteral(conn) }}{% endif %}{% if data.spcname %} | ||
|
||
TABLESPACE = {{ conn|qtIdent(data.spcname) }}{% endif %}{% if data.datconnlimit %} | ||
|
||
CONNECTION LIMIT = {{ data.datconnlimit }}{% endif %}{% if data.datoid %} | ||
|
||
OID = {{ data.datoid }}{% endif %} | ||
|
||
IS_TEMPLATE = {{ data.is_template }}; | ||
{% endif %} |
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
16 changes: 16 additions & 0 deletions
16
...server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_function.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,16 @@ | ||
-- Database: <TEST_DB_NAME> | ||
|
||
-- DROP DATABASE IF EXISTS <TEST_DB_NAME>; | ||
|
||
CREATE DATABASE <TEST_DB_NAME> | ||
WITH | ||
OWNER = postgres | ||
ENCODING = 'UTF8' | ||
LC_COLLATE = '<LC_COLLATE>' | ||
LC_CTYPE = '<LC_CTYPE>' | ||
LOCALE_PROVIDER = 'libc' | ||
TABLESPACE = pg_default | ||
CONNECTION LIMIT = -1 | ||
IS_TEMPLATE = False; | ||
|
||
ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; |
14 changes: 14 additions & 0 deletions
14
...erver_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_reset_all.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,14 @@ | ||
-- Database: <TEST_DB_NAME> | ||
|
||
-- DROP DATABASE IF EXISTS <TEST_DB_NAME>; | ||
|
||
CREATE DATABASE <TEST_DB_NAME> | ||
WITH | ||
OWNER = postgres | ||
ENCODING = 'UTF8' | ||
LC_COLLATE = '<LC_COLLATE>' | ||
LC_CTYPE = '<LC_CTYPE>' | ||
LOCALE_PROVIDER = 'libc' | ||
TABLESPACE = pg_default | ||
CONNECTION LIMIT = -1 | ||
IS_TEMPLATE = False; |
Oops, something went wrong.