Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn authored and vporyadke committed Feb 8, 2024
1 parent 01ac235 commit 44b1ccb
Show file tree
Hide file tree
Showing 41 changed files with 2,410 additions and 307 deletions.
3 changes: 3 additions & 0 deletions ydb/library/yql/parser/pg_catalog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
columns.txt
pg_class.txt

139 changes: 2 additions & 137 deletions ydb/library/yql/parser/pg_catalog/catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,145 +1402,10 @@ struct TCatalog {
"lo_unlink"
}),
StaticTables({
{{"pg_catalog", "pg_type"}, ERelKind::Relation, TypeRelationOid},
{{"pg_catalog", "pg_database"}, ERelKind::Relation, DatabaseRelationOid},
{{"pg_catalog", "pg_tablespace"}, ERelKind::Relation, TableSpaceRelationOid},
{{"pg_catalog", "pg_shdescription"}, ERelKind::Relation, SharedDescriptionRelationOid},
{{"pg_catalog", "pg_trigger"}, ERelKind::Relation, TriggerRelationOid},
{{"pg_catalog", "pg_locks"}, ERelKind::View, 10000},
{{"pg_catalog", "pg_stat_gssapi"}, ERelKind::View, 10001},
{{"pg_catalog", "pg_inherits"}, ERelKind::Relation, InheritsRelationOid},
{{"pg_catalog", "pg_stat_activity"}, ERelKind::View, 10002},
{{"pg_catalog", "pg_timezone_names"}, ERelKind::View, 10003},
{{"pg_catalog", "pg_timezone_abbrevs"}, ERelKind::View, 10004},
{{"pg_catalog", "pg_tables"}, ERelKind::View, 10005},
{{"pg_catalog", "pg_description"}, ERelKind::Relation, DescriptionRelationOid},
{{"pg_catalog", "pg_am"}, ERelKind::Relation, AccessMethodRelationOid},
{{"pg_catalog", "pg_namespace"}, ERelKind::Relation, NamespaceRelationOid},
{{"pg_catalog", "pg_auth_members"}, ERelKind::Relation, AuthMemRelationOid},
{{"pg_catalog", "pg_roles"}, ERelKind::View, 10006},
{{"pg_catalog", "pg_stat_database"}, ERelKind::View, 10007},
{{"pg_catalog", "pg_class"}, ERelKind::Relation, RelationRelationOid},
{{"information_schema", "tables"}, ERelKind::View, 10008},
{{"information_schema", "columns"}, ERelKind::View, 10009},
{{"information_schema", "table_constraints"}, ERelKind::View, 10010},
#include "pg_class.generated.h"
}),
AllStaticColumns({
{"pg_catalog", "pg_type", "oid", "oid"},
{"pg_catalog", "pg_type", "typname", "name"},
{"pg_catalog", "pg_type", "typinput", "regproc"},
{"pg_catalog", "pg_type", "typnamespace", "oid"},
{"pg_catalog", "pg_type", "typtype", "char"},

{"pg_catalog", "pg_database", "oid", "oid"},
{"pg_catalog", "pg_database", "datname", "name"},
{"pg_catalog", "pg_database", "encoding", "int4"},
{"pg_catalog", "pg_database", "datallowconn", "bool"},
{"pg_catalog", "pg_database", "datistemplate", "bool"},
{"pg_catalog", "pg_database", "datdba", "oid"},

{"pg_catalog", "pg_tablespace", "oid", "oid"},
{"pg_catalog", "pg_tablespace", "spcname", "name"},

{"pg_catalog", "pg_shdescription", "objoid", "oid"},
{"pg_catalog", "pg_shdescription", "classoid", "oid"},
{"pg_catalog", "pg_shdescription", "description", "text"},

{"pg_catalog", "pg_trigger", "tgrelid", "oid"},
{"pg_catalog", "pg_trigger", "tgenabled", "char"},

{"pg_catalog", "pg_locks", "transactionid", "xid"},

{"pg_catalog", "pg_stat_gssapi", "encrypted", "bool"},
{"pg_catalog", "pg_stat_gssapi", "gss_authenticated", "bool"},
{"pg_catalog", "pg_stat_gssapi", "pid", "int4"},

{"pg_catalog", "pg_inherits", "inhrelid", "oid"},
{"pg_catalog", "pg_inherits", "inhparent", "oid"},

{"pg_catalog", "pg_stat_activity", "application_name", "text"},
{"pg_catalog", "pg_stat_activity", "backend_start", "timestamptz"},
{"pg_catalog", "pg_stat_activity", "backend_type", "text"},
{"pg_catalog", "pg_stat_activity", "client_addr", "inet"},
{"pg_catalog", "pg_stat_activity", "datname", "name"},
{"pg_catalog", "pg_stat_activity", "pid", "int4"},
{"pg_catalog", "pg_stat_activity", "query", "text"},
{"pg_catalog", "pg_stat_activity", "query_start", "timestamptz"},
{"pg_catalog", "pg_stat_activity", "state", "text"},
{"pg_catalog", "pg_stat_activity", "state_change", "timestamptz"},
{"pg_catalog", "pg_stat_activity", "usename", "name"},
{"pg_catalog", "pg_stat_activity", "wait_event", "text"},
{"pg_catalog", "pg_stat_activity", "wait_event_type", "text"},
{"pg_catalog", "pg_stat_activity", "xact_start", "timestamptz"},

{"pg_catalog", "pg_timezone_names", "name", "text"},
{"pg_catalog", "pg_timezone_names", "is_dst", "bool"},

{"pg_catalog", "pg_timezone_abbrevs", "abbrev", "text"},
{"pg_catalog", "pg_timezone_abbrevs", "is_dst", "bool"},

{"pg_catalog", "pg_tables", "schemaname", "name"},
{"pg_catalog", "pg_tables", "tablename", "name"},

{"pg_catalog", "pg_description", "objoid", "oid"},
{"pg_catalog", "pg_description", "classoid", "oid"},
{"pg_catalog", "pg_description", "objsubid", "int4"},
{"pg_catalog", "pg_description", "description", "text"},

{"pg_catalog", "pg_am", "oid", "oid"},
{"pg_catalog", "pg_am", "amname", "name"},
{"pg_catalog", "pg_am", "amtype", "char"},

{"pg_catalog", "pg_namespace", "nspname", "name"},
{"pg_catalog", "pg_namespace", "oid", "oid"},

{"pg_catalog", "pg_auth_members", "roleid", "oid"},
{"pg_catalog", "pg_auth_members", "member", "oid"},
{"pg_catalog", "pg_auth_members", "grantor", "oid"},
{"pg_catalog", "pg_auth_members", "admin_option", "bool"},

{"pg_catalog", "pg_roles", "rolname", "name"},
{"pg_catalog", "pg_roles", "oid", "oid"},
{"pg_catalog", "pg_roles", "rolbypassrls", "bool"},
{"pg_catalog", "pg_roles", "rolcanlogin", "bool"},
{"pg_catalog", "pg_roles", "rolconfig", "_text"},
{"pg_catalog", "pg_roles", "rolconnlimit", "int4"},
{"pg_catalog", "pg_roles", "rolcreatedb", "bool"},
{"pg_catalog", "pg_roles", "rolcreaterole", "bool"},
{"pg_catalog", "pg_roles", "rolinherit", "bool"},
{"pg_catalog", "pg_roles", "rolreplication", "bool"},
{"pg_catalog", "pg_roles", "rolsuper", "bool"},
{"pg_catalog", "pg_roles", "rolvaliduntil", "timestamptz"},

{"pg_catalog", "pg_stat_database", "datid", "oid"},
{"pg_catalog", "pg_stat_database", "blks_hit", "int8"},
{"pg_catalog", "pg_stat_database", "blks_read", "int8"},
{"pg_catalog", "pg_stat_database", "tup_deleted", "int8"},
{"pg_catalog", "pg_stat_database", "tup_fetched", "int8"},
{"pg_catalog", "pg_stat_database", "tup_inserted", "int8"},
{"pg_catalog", "pg_stat_database", "tup_returned", "int8"},
{"pg_catalog", "pg_stat_database", "tup_updated", "int8"},
{"pg_catalog", "pg_stat_database", "xact_commit", "int8"},
{"pg_catalog", "pg_stat_database", "xact_rollback", "int8"},

{"pg_catalog", "pg_class", "oid", "oid"},
{"pg_catalog", "pg_class", "relispartition", "bool"},
{"pg_catalog", "pg_class", "relkind", "char"},
{"pg_catalog", "pg_class", "relname", "name"},
{"pg_catalog", "pg_class", "relnamespace", "oid"},
{"pg_catalog", "pg_class", "relowner", "oid"},

{"information_schema", "tables", "table_schema", "name"},
{"information_schema", "tables", "table_name", "name"},

{"information_schema", "columns", "table_schema", "name"},
{"information_schema", "columns", "table_name", "name"},
{"information_schema", "columns", "column_name", "name"},
{"information_schema", "columns", "udt_name", "name"},

{"information_schema", "table_constraints", "constraint_schema", "name"},
{"information_schema", "table_constraints", "table_name", "name"},
{"information_schema", "table_constraints", "constraint_type", "varchar"},
#include "columns.generated.h"
})
{
THashSet<ui32> usedTableOids;
Expand Down
Loading

0 comments on commit 44b1ccb

Please sign in to comment.