diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/sql/suites/pg_catalog | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/pg_catalog')
37 files changed, 280 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/columns.sql b/yql/essentials/tests/sql/suites/pg_catalog/columns.sql new file mode 100644 index 0000000000..7eebac9502 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/columns.sql @@ -0,0 +1,14 @@ +--!syntax_pg +select +count(*) n, +min(table_schema) min_s, +min(table_name) min_t, +min(column_name) min_c, +min(udt_name) min_u, +max(table_schema) max_s, +max(table_name) max_t, +max(column_name) max_c, +max(udt_name) max_u +from +information_schema.columns + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/default.cfg b/yql/essentials/tests/sql/suites/pg_catalog/default.cfg new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/default.cfg diff --git a/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt new file mode 100644 index 0000000000..6085fdcc90 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt @@ -0,0 +1,4 @@ +{"key"=1;"subkey"="1";"value"="abc"}; +{"key"=16;"subkey"="2";"value"="ddd"}; +{"key"=25;"subkey"="3";"value"="q"}; +{"key"=100;"subkey"="4";"value"="qzz"}; diff --git a/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr new file mode 100644 index 0000000000..7747e0f9b7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr @@ -0,0 +1,5 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[["key";["PgType";"int4";];];["subkey";["PgType";"text";];];["value";["PgType";"text";];];];]; + } +} diff --git a/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg b/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg new file mode 100644 index 0000000000..ef7e4f47a9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg @@ -0,0 +1,2 @@ +in Input input_pg.txt +res result.txt diff --git a/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql b/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql new file mode 100644 index 0000000000..f7cf0d582a --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql @@ -0,0 +1,2 @@ +--!syntax_pg +select key, key::oid in (select oid from pg_catalog.pg_type) as found from plato."Input" order by key diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql new file mode 100644 index 0000000000..be077b826b --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql @@ -0,0 +1,5 @@ +--!syntax_pg +select min(aggfnoid) as minaggfnoid, max(aggfnoid) as maxaggfnoid, + min(aggkind) as minaggkind, max(aggkind) as maxaggkind, + min(aggtranstype) as minaggtranstype, max(aggtranstype) as maxaggtranstype from pg_aggregate; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql new file mode 100644 index 0000000000..136511b4c0 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql @@ -0,0 +1,2 @@ +--!syntax_pg +select oid from pg_catalog.pg_am order by oid; diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql new file mode 100644 index 0000000000..7adf651ad1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql @@ -0,0 +1,8 @@ +--!syntax_pg +select +roleid, +member, +grantor, +admin_option +from pg_catalog.pg_auth_members + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql new file mode 100644 index 0000000000..28f3d66e28 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql @@ -0,0 +1,20 @@ +--!syntax_pg +select +count(*) n, +min(oid) min_oid, +min(relispartition::text) min_isrel, +min(relkind) min_relkind, +min(relname) min_relname, +min(relnamespace) min_relns, +min(relowner) min_relowner, +max(oid) max_oid, +max(relispartition::text) max_isrel, +max(relkind) max_relkind, +max(relname) max_relname, +max(relnamespace) max_relns, +max(relowner) max_relowner, +min(relam) min_am, +max(relam) max_am +from +pg_catalog.pg_class; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql new file mode 100644 index 0000000000..4b4d7c7c9a --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql @@ -0,0 +1,14 @@ +--!syntax_pg +select +datallowconn, +datdba, +datistemplate, +datname, +encoding, +oid, +datacl is null, +datcollate, +datctype +from +pg_catalog.pg_database +order by oid diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql new file mode 100644 index 0000000000..0b812a9db2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql @@ -0,0 +1,3 @@ +--!syntax_pg +select count(*) n, min(objoid) min_objid, min(classoid) min_classoid, max(objoid) max_objid, max(classoid) max_classoid, min(description) min_desc, max(description) max_desc from pg_catalog.pg_description; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql new file mode 100644 index 0000000000..a0eb2599ca --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql @@ -0,0 +1,3 @@ +--!syntax_pg +select pg_get_userbyid(datdba) from pg_catalog.pg_database where datname = 'postgres' + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql new file mode 100644 index 0000000000..28e7c1c6ef --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select +inhrelid, +inhparent +from +pg_catalog.pg_inherits
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql new file mode 100644 index 0000000000..fef787fa84 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql @@ -0,0 +1,3 @@ +--!syntax_pg +select oid, lanname, lanowner from pg_language order by oid + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql new file mode 100644 index 0000000000..b827421b7c --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql @@ -0,0 +1,5 @@ +--!syntax_pg +select +transactionid +from +pg_catalog.pg_locks diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql new file mode 100644 index 0000000000..89e355f157 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql @@ -0,0 +1,3 @@ +--!syntax_pg +select nspname,oid,nspowner from pg_catalog.pg_namespace order by oid; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql new file mode 100644 index 0000000000..526764c1a3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql @@ -0,0 +1,23 @@ +--!syntax_pg +select + min(oid) as min_oid, + min(oprcom) as min_oprcom, + min(oprleft) as min_oprleft, + min(oprname) as min_oprname, + min(oprnamespace) as min_oprnamespace, + min(oprnegate) as min_oprnegate, + min(oprowner) as min_oprowner, + min(oprresult) as min_oprresult, + min(oprright) as min_oprright, + + max(oid) as max_oid, + max(oprcom) as max_oprcom, + max(oprleft) as max_oprleft, + max(oprname) as max_oprname, + max(oprnamespace) as max_oprnamespace, + max(oprnegate) as max_oprnegate, + max(oprowner) as max_oprowner, + max(oprresult) as max_oprresult, + max(oprright) as max_oprright +from pg_operator; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql new file mode 100644 index 0000000000..1c9cd12590 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql @@ -0,0 +1,8 @@ +--!syntax_pg +select min(oid) as minoid, max(oid) as maxoid, + min(proname) as minproname, max(proname) as maxproname, + min(pronamespace) as minpronamespace, max(pronamespace) as maxpronamespace, + min(proowner) as minproowner, max(proowner) as maxproowner, + min(prorettype) as minprorettype, max(prorettype) as maxprorettype, + min(prolang) as minprolang, max(prolang) as maxprolang, + min(prokind) as minprokind, max(prokind) as maxprokind from pg_proc; diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql new file mode 100644 index 0000000000..b8bb06ab74 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql @@ -0,0 +1,17 @@ +--!syntax_pg +select +oid, +rolbypassrls, +rolcanlogin, +rolconfig, +rolconnlimit, +rolcreatedb, +rolcreaterole, +rolinherit, +rolname, +rolreplication, +rolsuper, +rolvaliduntil +from pg_catalog.pg_roles +order by oid + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql new file mode 100644 index 0000000000..13d8d66c3b --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select set_config('search_path', 'pg_catalog', false); +select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type order by oid; +select set_config('search_path', 'public', false); +select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_catalog.pg_type order by oid; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql new file mode 100644 index 0000000000..5df0cac811 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select set_config('search_path', 'pg_catalog', false); +commit; +select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type; +rollback; +select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type; diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql new file mode 100644 index 0000000000..10315a92ef --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql @@ -0,0 +1,8 @@ +--!syntax_pg +select +objoid, +classoid, +description +from +pg_catalog.pg_shdescription +order by objoid diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql new file mode 100644 index 0000000000..04ddde2e1d --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql @@ -0,0 +1,18 @@ +--!syntax_pg +select +application_name, +backend_start, +backend_type, +client_addr, +datname, +pid, +query, +query_start, +state, +state_change, +usename, +wait_event, +wait_event_type, +xact_start +from +pg_catalog.pg_stat_activity diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql new file mode 100644 index 0000000000..f15ce35f12 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql @@ -0,0 +1,15 @@ +--!syntax_pg +select +datid, +blks_hit, +blks_read, +tup_deleted +tup_fetched, +tup_inserted, +tup_returned, +tup_updated, +xact_commit, +xact_rollback +from pg_catalog.pg_stat_database +order by datid + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql new file mode 100644 index 0000000000..2738a852df --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql @@ -0,0 +1,9 @@ +--!syntax_pg +select count(*) n,min(encrypted::text) min_enc,min(gss_authenticated::text) min_auth from ( +select +encrypted, +gss_authenticated, +pid +from +pg_catalog.pg_stat_gssapi +) a diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql new file mode 100644 index 0000000000..a4ab718d58 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql @@ -0,0 +1,9 @@ +--!syntax_pg +select +count(*) n, +min(schemaname) min_s, +min(tablename) min_t, +max(schemaname) max_s, +max(tablename) max_t +from pg_catalog.pg_tables; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql new file mode 100644 index 0000000000..63c8e2f1e7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql @@ -0,0 +1,7 @@ +--!syntax_pg +select +oid, +spcname +from +pg_catalog.pg_tablespace +order by oid diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql new file mode 100644 index 0000000000..08348b1a26 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select +abbrev, +is_dst +from +pg_catalog.pg_timezone_abbrevs diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql new file mode 100644 index 0000000000..1fc53cfa1c --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select +name, +is_dst +from +pg_catalog.pg_timezone_names diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql new file mode 100644 index 0000000000..26a3c4eeb3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select +tgrelid, +tgenabled +from +pg_catalog.pg_trigger diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql new file mode 100644 index 0000000000..f02f382772 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql @@ -0,0 +1,9 @@ +--!syntax_pg +select oid, +typinput::int4 as typinput, +typname, +typnamespace, +typtype +from pg_catalog.pg_type +order by oid + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql new file mode 100644 index 0000000000..ceb039005c --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql @@ -0,0 +1 @@ +select typname,oid from pg_catalog.pg_type order by oid diff --git a/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql b/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql new file mode 100644 index 0000000000..d3388c8cad --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql @@ -0,0 +1,3 @@ +--!syntax_pg +select oid,tableoid,xmin,cmin,xmax,cmax,ctid from pg_type where typname = 'text'; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql b/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql new file mode 100644 index 0000000000..54ae1c97b7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql @@ -0,0 +1,9 @@ +--!syntax_pg +select +constraint_schema, +table_name, +constraint_type +from +information_schema.table_constraints +order by constraint_schema, table_name + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/tables.sql b/yql/essentials/tests/sql/suites/pg_catalog/tables.sql new file mode 100644 index 0000000000..a8bbe4cd87 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/tables.sql @@ -0,0 +1,9 @@ +--!syntax_pg +select +count(*) n, +min(table_schema) min_s, +min(table_name) min_t, +max(table_schema) max_s, +max(table_name) max_t +from information_schema.tables; + diff --git a/yql/essentials/tests/sql/suites/pg_catalog/user.sql b/yql/essentials/tests/sql/suites/pg_catalog/user.sql new file mode 100644 index 0000000000..750627d9e9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pg_catalog/user.sql @@ -0,0 +1,6 @@ +--!syntax_pg +select user, current_user, current_role, current_catalog, current_schema, current_schema(); +set search_path to "pg_catalog"; +select user, current_user, current_role, current_catalog, current_schema, current_schema(); + + |