diff --git a/edb/pgsql/keywords.py b/edb/pgsql/keywords.py index 146f70bb1a8d..7992f40b36ca 100644 --- a/edb/pgsql/keywords.py +++ b/edb/pgsql/keywords.py @@ -207,6 +207,18 @@ "isnull": ("ISNULL", TYPE_FUNC_NAME_KEYWORD), "isolation": ("ISOLATION", UNRESERVED_KEYWORD), "join": ("JOIN", TYPE_FUNC_NAME_KEYWORD), + "json": ("JSON", TYPE_FUNC_NAME_KEYWORD), + "json_array": ("JSON_ARRAY", TYPE_FUNC_NAME_KEYWORD), + "json_arrayagg": ("JSON_ARRAYAGG", TYPE_FUNC_NAME_KEYWORD), + "json_exists": ("JSON_EXISTS", TYPE_FUNC_NAME_KEYWORD), + "json_object": ("JSON_OBJECT", TYPE_FUNC_NAME_KEYWORD), + "json_objectagg": ("JSON_OBJECTAGG", TYPE_FUNC_NAME_KEYWORD), + "json_query": ("JSON_QUERY", TYPE_FUNC_NAME_KEYWORD), + "json_scalar": ("JSON_SCALAR", TYPE_FUNC_NAME_KEYWORD), + "json_serialize": ("JSON_SERIALIZE", TYPE_FUNC_NAME_KEYWORD), + "json_table": ("JSON_TABLE", TYPE_FUNC_NAME_KEYWORD), + "json_table_primitive": ("JSON_TABLE_PRIMITIVE", TYPE_FUNC_NAME_KEYWORD), + "json_value": ("JSON_VALUE", TYPE_FUNC_NAME_KEYWORD), "key": ("KEY", UNRESERVED_KEYWORD), "language": ("LANGUAGE", UNRESERVED_KEYWORD), "large": ("LARGE_P", UNRESERVED_KEYWORD), diff --git a/edb/pgsql/resolver/sql_introspection.py b/edb/pgsql/resolver/sql_introspection.py index 202ca556226a..660de5c03ae0 100644 --- a/edb/pgsql/resolver/sql_introspection.py +++ b/edb/pgsql/resolver/sql_introspection.py @@ -271,7 +271,6 @@ ("datetime_precision", "cardinal_number"), ("interval_type", "character_data"), ("interval_precision", "cardinal_number"), - ("domain_default", "character_data"), ("udt_catalog", "sql_identifier"), ("udt_schema", "sql_identifier"), ("udt_name", "sql_identifier"), @@ -818,14 +817,11 @@ ("attrelid", "oid"), ("attname", "name"), ("atttypid", "oid"), - ("attstattarget", "integer"), ("attlen", "smallint"), ("attnum", "smallint"), - ("attndims", "integer"), ("attcacheoff", "integer"), ("atttypmod", "integer"), ("attbyval", "boolean"), - ("attstorage", "\"char\""), ("attalign", "\"char\""), ("attnotnull", "boolean"), ("atthasdef", "boolean"), @@ -834,7 +830,7 @@ ("attgenerated", "\"char\""), ("attisdropped", "boolean"), ("attislocal", "boolean"), - ("attinhcount", "integer"), + ("attinhcount", "smallint"), ("attcollation", "oid"), ("attacl", None), ("attoptions", None), @@ -929,8 +925,10 @@ ("collprovider", "\"char\""), ("collisdeterministic", "boolean"), ("collencoding", "integer"), - ("collcollate", "name"), - ("collctype", "name"), + ("collcollate", "text"), + ("collctype", "text"), + ("colllocale", "text"), + ("collicurules", "text"), ("collversion", "text"), ], "pg_config": [ @@ -954,7 +952,7 @@ ("confdeltype", "\"char\""), ("confmatchtype", "\"char\""), ("conislocal", "boolean"), - ("coninhcount", "integer"), + ("coninhcount", "smallint"), ("connoinherit", "boolean"), ("conkey", None), ("confkey", None), @@ -987,12 +985,10 @@ ("datname", "name"), ("datdba", "oid"), ("encoding", "integer"), - ("datcollate", "name"), - ("datctype", "name"), + ("datlocprovider", "\"char\""), ("datistemplate", "boolean"), ("datallowconn", "boolean"), ("datconnlimit", "integer"), - ("datlastsysoid", "oid"), ("datfrozenxid", "xid"), ("datminmxid", "xid"), ("dattablespace", "oid"), @@ -1553,15 +1549,8 @@ ("stats_reset", "timestamp with time zone"), ], "pg_stat_bgwriter": [ - ("checkpoints_timed", "bigint"), - ("checkpoints_req", "bigint"), - ("checkpoint_write_time", "double precision"), - ("checkpoint_sync_time", "double precision"), - ("buffers_checkpoint", "bigint"), ("buffers_clean", "bigint"), ("maxwritten_clean", "bigint"), - ("buffers_backend", "bigint"), - ("buffers_backend_fsync", "bigint"), ("buffers_alloc", "bigint"), ("stats_reset", "timestamp with time zone"), ], @@ -1667,8 +1656,11 @@ ("heap_blks_scanned", "bigint"), ("heap_blks_vacuumed", "bigint"), ("index_vacuum_count", "bigint"), - ("max_dead_tuples", "bigint"), - ("num_dead_tuples", "bigint"), + ("max_dead_tuple_bytes", "bigint"), + ("dead_tuple_bytes", "bigint"), + ("num_dead_item_ids", "bigint"), + ("indexes_total", "bigint"), + ("indexes_processed", "bigint"), ], "pg_stat_replication": [ ("pid", "integer"), @@ -1992,7 +1984,6 @@ ("stxname", "name"), ("stxnamespace", "oid"), ("stxowner", "oid"), - ("stxstattarget", "integer"), ("stxkeys", None), ("stxkind", None), ], @@ -2207,5 +2198,5 @@ ("viewname", "name"), ("viewowner", "name"), ("definition", "text"), - ] + ], } diff --git a/edb/tools/gen_sql_introspection.py b/edb/tools/gen_sql_introspection.py index b36f87ddfc46..659a05fbd170 100644 --- a/edb/tools/gen_sql_introspection.py +++ b/edb/tools/gen_sql_introspection.py @@ -39,8 +39,8 @@ async def run(): host='localhost', database='postgres', user='postgres', - password='pass', - port='5433', + password='pass1234', + port='5432', ) res = await c.fetch( @@ -94,7 +94,7 @@ def print_header(f): """Declarations of information schema and pg_catalog""" - from typing import * # NoQA + from typing import Tuple, Dict, List ColumnName = str ColumnType = str | None diff --git a/postgres b/postgres index 2caa85f4aae6..d7ec59a63d74 160000 --- a/postgres +++ b/postgres @@ -1 +1 @@ -Subproject commit 2caa85f4aae689e6f6721d7363b4c66a2a6417d6 +Subproject commit d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e