diff --git a/packages/cubejs-backend-native/Cargo.lock b/packages/cubejs-backend-native/Cargo.lock index d62709e76cbb0..b4de3fae06139 100644 --- a/packages/cubejs-backend-native/Cargo.lock +++ b/packages/cubejs-backend-native/Cargo.lock @@ -714,7 +714,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "chrono", @@ -884,7 +884,7 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -917,7 +917,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -928,7 +928,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "async-trait", "chrono", @@ -941,7 +941,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -952,7 +952,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -3209,7 +3209,7 @@ dependencies = [ [[package]] name = "sqlparser" version = "0.16.0" -source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=34f22de680caa5fe586def5b336d56efe43c8cc4#34f22de680caa5fe586def5b336d56efe43c8cc4" +source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=e14d5bf45367edd8679cbc15ccee56693da8e4fb#e14d5bf45367edd8679cbc15ccee56693da8e4fb" dependencies = [ "log", ] diff --git a/rust/cubenativeutils/Cargo.lock b/rust/cubenativeutils/Cargo.lock index 9fbd818a0bd8b..931fb867f7e80 100644 --- a/rust/cubenativeutils/Cargo.lock +++ b/rust/cubenativeutils/Cargo.lock @@ -623,7 +623,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "chrono", @@ -715,7 +715,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -748,7 +748,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -759,7 +759,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "async-trait", "chrono", @@ -772,7 +772,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -783,7 +783,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -2796,7 +2796,7 @@ dependencies = [ [[package]] name = "sqlparser" version = "0.16.0" -source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=34f22de680caa5fe586def5b336d56efe43c8cc4#34f22de680caa5fe586def5b336d56efe43c8cc4" +source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=e14d5bf45367edd8679cbc15ccee56693da8e4fb#e14d5bf45367edd8679cbc15ccee56693da8e4fb" dependencies = [ "log", ] diff --git a/rust/cubesql/Cargo.lock b/rust/cubesql/Cargo.lock index 1681340c2bb7a..9fdd9795c99cf 100644 --- a/rust/cubesql/Cargo.lock +++ b/rust/cubesql/Cargo.lock @@ -722,7 +722,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "chrono", @@ -846,7 +846,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -879,7 +879,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "ordered-float 2.10.0", @@ -890,7 +890,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "async-trait", "chrono", @@ -903,7 +903,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -914,7 +914,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -3002,7 +3002,7 @@ dependencies = [ [[package]] name = "sqlparser" version = "0.16.0" -source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=34f22de680caa5fe586def5b336d56efe43c8cc4#34f22de680caa5fe586def5b336d56efe43c8cc4" +source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=e14d5bf45367edd8679cbc15ccee56693da8e4fb#e14d5bf45367edd8679cbc15ccee56693da8e4fb" dependencies = [ "log", ] diff --git a/rust/cubesql/cubesql/Cargo.toml b/rust/cubesql/cubesql/Cargo.toml index f23b5d9aaf933..96c0f4bc2bf70 100644 --- a/rust/cubesql/cubesql/Cargo.toml +++ b/rust/cubesql/cubesql/Cargo.toml @@ -10,14 +10,14 @@ homepage = "https://cube.dev" [dependencies] arc-swap = "1" -datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6", default-features = false, features = [ +datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "016c22f74b82f241fc01abd205020cb52b6c911e", default-features = false, features = [ "regex_expressions", "unicode_expressions", ] } thiserror = "2" cubeclient = { path = "../cubeclient" } pg-srv = { path = "../pg-srv" } -sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "34f22de680caa5fe586def5b336d56efe43c8cc4" } +sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "e14d5bf45367edd8679cbc15ccee56693da8e4fb" } base64 = "0.13.0" tokio = { version = "^1.35", features = ["full", "rt", "tracing"] } serde = { version = "^1.0", features = ["derive"] } diff --git a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_class.snap b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_class.snap index 5fc3c2b3b0a29..71514dac32c7c 100644 --- a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_class.snap +++ b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_class.snap @@ -1,6 +1,5 @@ --- source: cubesql/e2e/tests/postgres.rs -assertion_line: 316 expression: "self.print_query_result(res, true, false).await" --- oid type: 23 (int4) @@ -36,4 +35,5 @@ relminmxid type: 23 (int4) relacl type: 25 (text) reloptions type: 25 (text) relpartbound type: 25 (text) +xmin type: 23 (int4) relhasoids type: 16 (bool) diff --git a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_proc.snap b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_proc.snap index 55684b7afbf8f..5e5b47cbf615a 100644 --- a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_proc.snap +++ b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_proc.snap @@ -1,6 +1,5 @@ --- source: cubesql/e2e/tests/postgres.rs -assertion_line: 316 expression: "self.print_query_result(res, true, false).await" --- oid type: 23 (int4) @@ -33,3 +32,4 @@ probin type: 25 (text) prosqlbody type: 25 (text) proconfig type: 25 (text) proacl type: 25 (text) +xmin type: 23 (int4) diff --git a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_type.snap b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_type.snap index 3de96a8c0e058..c4d3b4241e955 100644 --- a/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_type.snap +++ b/rust/cubesql/cubesql/e2e/tests/snapshots/e2e__tests__postgres__system_pg_catalog.pg_type.snap @@ -1,6 +1,5 @@ --- source: cubesql/e2e/tests/postgres.rs -assertion_line: 316 expression: "self.print_query_result(res, true, false).await" --- oid type: 23 (int4) @@ -35,3 +34,4 @@ typcollation type: 25 (text) typdefaultbin type: 25 (text) typdefault type: 25 (text) typacl type: 25 (text) +xmin type: 23 (int4) diff --git a/rust/cubesql/cubesql/src/compile/engine/context_postgresql.rs b/rust/cubesql/cubesql/src/compile/engine/context_postgresql.rs index b7952f7d32b18..b51db77398491 100644 --- a/rust/cubesql/cubesql/src/compile/engine/context_postgresql.rs +++ b/rust/cubesql/cubesql/src/compile/engine/context_postgresql.rs @@ -17,16 +17,21 @@ use super::information_schema::postgres::{ InfoSchemaSqlImplementationInfoProvider as PostgresInfoSchemaSqlImplementationInfoProvider, InfoSchemaSqlSizingProvider as PostgresInfoSchemaSqlSizingProvider, InfoSchemaTestingBlockingProvider, InfoSchemaTestingDatasetProvider, PgCatalogAmProvider, - PgCatalogAttrdefProvider, PgCatalogAttributeProvider, PgCatalogClassProvider, + PgCatalogAttrdefProvider, PgCatalogAttributeProvider, PgCatalogAuthMembersProvider, + PgCatalogAvailableExtensionVersionsProvider, PgCatalogCastProvider, PgCatalogClassProvider, PgCatalogConstraintProvider, PgCatalogDatabaseProvider, PgCatalogDependProvider, - PgCatalogDescriptionProvider, PgCatalogEnumProvider, PgCatalogExtensionProvider, - PgCatalogIndexProvider, PgCatalogInheritsProvider, PgCatalogMatviewsProvider, - PgCatalogNamespaceProvider, PgCatalogPartitionedTableProvider, PgCatalogProcProvider, - PgCatalogRangeProvider, PgCatalogRolesProvider, PgCatalogSequenceProvider, + PgCatalogDescriptionProvider, PgCatalogEnumProvider, PgCatalogEventTriggerProvider, + PgCatalogExtensionProvider, PgCatalogForeignDataWrapperProvider, + PgCatalogForeignServerProvider, PgCatalogForeignTableProvider, PgCatalogIndexProvider, + PgCatalogInheritsProvider, PgCatalogLanguageProvider, PgCatalogLocksProvider, + PgCatalogMatviewsProvider, PgCatalogNamespaceProvider, PgCatalogOperatorProvider, + PgCatalogPartitionedTableProvider, PgCatalogProcProvider, PgCatalogRangeProvider, + PgCatalogRewriteProvider, PgCatalogRolesProvider, PgCatalogSequenceProvider, PgCatalogSettingsProvider, PgCatalogShdescriptionProvider, PgCatalogStatActivityProvider, PgCatalogStatUserTablesProvider, PgCatalogStatioUserTablesProvider, PgCatalogStatsProvider, - PgCatalogTableProvider, PgCatalogTypeProvider, PgCatalogUserProvider, PgCatalogViewsProvider, - PgPreparedStatementsProvider, + PgCatalogTableProvider, PgCatalogTablespaceProvider, PgCatalogTimezoneAbbrevsProvider, + PgCatalogTimezoneNamesProvider, PgCatalogTypeProvider, PgCatalogUserMappingProvider, + PgCatalogUserProvider, PgCatalogViewsProvider, PgPreparedStatementsProvider, }; use crate::{ compile::{ @@ -138,6 +143,36 @@ impl DatabaseProtocol { "pg_catalog.pg_stat_user_tables".to_string() } else if let Some(_) = any.downcast_ref::() { "pg_catalog.pg_shdescription".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_locks".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_timezone_names".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_timezone_abbrevs".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_auth_members".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_tablespace".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_event_trigger".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_foreign_data_wrapper".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_foreign_server".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_user_mapping".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_available_extension_versions".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_language".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_cast".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_foreign_table".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_operator".to_string() + } else if let Some(_) = any.downcast_ref::() { + "pg_catalog.pg_rewrite".to_string() } else if let Some(_) = any.downcast_ref::() { "pg_catalog.pg_external_schema".to_string() } else if let Some(_) = any.downcast_ref::() { @@ -404,6 +439,31 @@ impl DatabaseProtocol { ))) } "pg_shdescription" => return Some(Arc::new(PgCatalogShdescriptionProvider::new())), + "pg_locks" => return Some(Arc::new(PgCatalogLocksProvider::new())), + "pg_timezone_names" => { + return Some(Arc::new(PgCatalogTimezoneNamesProvider::new())) + } + "pg_timezone_abbrevs" => { + return Some(Arc::new(PgCatalogTimezoneAbbrevsProvider::new())) + } + "pg_auth_members" => return Some(Arc::new(PgCatalogAuthMembersProvider::new())), + "pg_tablespace" => return Some(Arc::new(PgCatalogTablespaceProvider::new())), + "pg_event_trigger" => return Some(Arc::new(PgCatalogEventTriggerProvider::new())), + "pg_foreign_data_wrapper" => { + return Some(Arc::new(PgCatalogForeignDataWrapperProvider::new())) + } + "pg_foreign_server" => { + return Some(Arc::new(PgCatalogForeignServerProvider::new())) + } + "pg_user_mapping" => return Some(Arc::new(PgCatalogUserMappingProvider::new())), + "pg_available_extension_versions" => { + return Some(Arc::new(PgCatalogAvailableExtensionVersionsProvider::new())) + } + "pg_language" => return Some(Arc::new(PgCatalogLanguageProvider::new())), + "pg_cast" => return Some(Arc::new(PgCatalogCastProvider::new())), + "pg_foreign_table" => return Some(Arc::new(PgCatalogForeignTableProvider::new())), + "pg_operator" => return Some(Arc::new(PgCatalogOperatorProvider::new())), + "pg_rewrite" => return Some(Arc::new(PgCatalogRewriteProvider::new())), "pg_external_schema" => { return Some(Arc::new(RedshiftPgExternalSchemaProvider::new())) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/mod.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/mod.rs index 9b5e52bd30a67..7a589b083a2a9 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/mod.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/mod.rs @@ -16,21 +16,32 @@ pub mod views; mod pg_am; mod pg_attrdef; mod pg_attribute; +mod pg_auth_members; +mod pg_available_extension_versions; +mod pg_cast; mod pg_class; mod pg_constraint; mod pg_database; mod pg_depend; mod pg_description; mod pg_enum; +mod pg_event_trigger; mod pg_extension; +mod pg_foreign_data_wrapper; +mod pg_foreign_server; +mod pg_foreign_table; mod pg_index; mod pg_inherits; +mod pg_language; +mod pg_locks; mod pg_matviews; mod pg_namespace; +mod pg_operator; mod pg_partitioned_table; mod pg_prepared_statements; mod pg_proc; mod pg_range; +mod pg_rewrite; mod pg_roles; mod pg_sequence; mod pg_settings; @@ -40,8 +51,12 @@ mod pg_stat_user_tables; mod pg_statio_user_tables; mod pg_stats; mod pg_tables; +mod pg_tablespace; +mod pg_timezone_abbrevs; +mod pg_timezone_names; mod pg_type; mod pg_user; +mod pg_user_mapping; mod pg_views; mod role_column_grants; mod role_table_grants; @@ -52,21 +67,32 @@ use super::utils; pub use pg_am::*; pub use pg_attrdef::*; pub use pg_attribute::*; +pub use pg_auth_members::*; +pub use pg_available_extension_versions::*; +pub use pg_cast::*; pub use pg_class::*; pub use pg_constraint::*; pub use pg_database::*; pub use pg_depend::*; pub use pg_description::*; pub use pg_enum::*; +pub use pg_event_trigger::*; pub use pg_extension::*; +pub use pg_foreign_data_wrapper::*; +pub use pg_foreign_server::*; +pub use pg_foreign_table::*; pub use pg_index::*; pub use pg_inherits::*; +pub use pg_language::*; +pub use pg_locks::*; pub use pg_matviews::*; pub use pg_namespace::*; +pub use pg_operator::*; pub use pg_partitioned_table::*; pub use pg_prepared_statements::*; pub use pg_proc::*; pub use pg_range::*; +pub use pg_rewrite::*; pub use pg_roles::*; pub use pg_sequence::*; pub use pg_settings::*; @@ -76,8 +102,12 @@ pub use pg_stat_user_tables::*; pub use pg_statio_user_tables::*; pub use pg_stats::*; pub use pg_tables::*; +pub use pg_tablespace::*; +pub use pg_timezone_abbrevs::*; +pub use pg_timezone_names::*; pub use pg_type::*; pub use pg_user::*; +pub use pg_user_mapping::*; pub use pg_views::*; pub use role_column_grants::*; pub use role_table_grants::*; diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_am.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_am.rs index 81d77ad08c83e..cf5a1931a396f 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_am.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_am.rs @@ -18,6 +18,7 @@ struct PgCatalogAmBuilder { amname: StringBuilder, amhandler: StringBuilder, amtype: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogAmBuilder { @@ -29,6 +30,7 @@ impl PgCatalogAmBuilder { amname: StringBuilder::new(capacity), amhandler: StringBuilder::new(capacity), amtype: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -38,6 +40,7 @@ impl PgCatalogAmBuilder { Arc::new(self.amname.finish()), Arc::new(self.amhandler.finish()), Arc::new(self.amtype.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -74,6 +77,7 @@ impl TableProvider for PgCatalogAmProvider { Field::new("amname", DataType::Utf8, false), Field::new("amhandler", DataType::Utf8, false), Field::new("amtype", DataType::Utf8, false), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_attribute.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_attribute.rs index 2664af7fb7487..92478b77fa126 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_attribute.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_attribute.rs @@ -46,6 +46,7 @@ struct PgCatalogAttributeBuilder { attoptions: StringBuilder, attfdwoptions: StringBuilder, attmissingval: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogAttributeBuilder { @@ -79,6 +80,7 @@ impl PgCatalogAttributeBuilder { attoptions: StringBuilder::new(capacity), attfdwoptions: StringBuilder::new(capacity), attmissingval: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -121,6 +123,7 @@ impl PgCatalogAttributeBuilder { self.attoptions.append_null().unwrap(); self.attfdwoptions.append_null().unwrap(); self.attmissingval.append_null().unwrap(); + self.xmin.append_value(1).unwrap(); } fn finish(mut self) -> Vec> { @@ -151,6 +154,7 @@ impl PgCatalogAttributeBuilder { Arc::new(self.attoptions.finish()), Arc::new(self.attfdwoptions.finish()), Arc::new(self.attmissingval.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -224,6 +228,7 @@ impl TableProvider for PgCatalogAttributeProvider { Field::new("attoptions", DataType::Utf8, true), Field::new("attfdwoptions", DataType::Utf8, true), Field::new("attmissingval", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_auth_members.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_auth_members.rs new file mode 100644 index 0000000000000..5fa54ca29f8c6 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_auth_members.rs @@ -0,0 +1,103 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogAuthMembersBuilder { + roleid: UInt32Builder, + member: UInt32Builder, + grantor: UInt32Builder, + admin_option: BooleanBuilder, +} + +impl PgCatalogAuthMembersBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + roleid: UInt32Builder::new(capacity), + member: UInt32Builder::new(capacity), + grantor: UInt32Builder::new(capacity), + admin_option: BooleanBuilder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.roleid.finish()), + Arc::new(self.member.finish()), + Arc::new(self.grantor.finish()), + Arc::new(self.admin_option.finish()), + ]; + + columns + } +} + +pub struct PgCatalogAuthMembersProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-auth-members.html +impl PgCatalogAuthMembersProvider { + pub fn new() -> Self { + let builder = PgCatalogAuthMembersBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogAuthMembersProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("roleid", DataType::UInt32, false), + Field::new("member", DataType::UInt32, false), + Field::new("grantor", DataType::UInt32, false), + Field::new("admin_option", DataType::Boolean, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_available_extension_versions.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_available_extension_versions.rs new file mode 100644 index 0000000000000..e35087541e6db --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_available_extension_versions.rs @@ -0,0 +1,127 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, ListBuilder, StringBuilder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogAvailableExtensionVersionsBuilder { + name: StringBuilder, + version: StringBuilder, + installed: BooleanBuilder, + superuser: BooleanBuilder, + trusted: BooleanBuilder, + relocatable: BooleanBuilder, + schema: StringBuilder, + requires: ListBuilder, + comment: StringBuilder, +} + +impl PgCatalogAvailableExtensionVersionsBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + name: StringBuilder::new(capacity), + version: StringBuilder::new(capacity), + installed: BooleanBuilder::new(capacity), + superuser: BooleanBuilder::new(capacity), + trusted: BooleanBuilder::new(capacity), + relocatable: BooleanBuilder::new(capacity), + schema: StringBuilder::new(capacity), + requires: ListBuilder::new(StringBuilder::new(capacity)), + comment: StringBuilder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.name.finish()), + Arc::new(self.version.finish()), + Arc::new(self.installed.finish()), + Arc::new(self.superuser.finish()), + Arc::new(self.trusted.finish()), + Arc::new(self.relocatable.finish()), + Arc::new(self.schema.finish()), + Arc::new(self.requires.finish()), + Arc::new(self.comment.finish()), + ]; + + columns + } +} + +pub struct PgCatalogAvailableExtensionVersionsProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/view-pg-available-extension-versions.html +impl PgCatalogAvailableExtensionVersionsProvider { + pub fn new() -> Self { + let builder = PgCatalogAvailableExtensionVersionsBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogAvailableExtensionVersionsProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("name", DataType::Utf8, false), + Field::new("version", DataType::Utf8, false), + Field::new("installed", DataType::Boolean, false), + Field::new("superuser", DataType::Boolean, false), + Field::new("trusted", DataType::Boolean, false), + Field::new("relocatable", DataType::Boolean, false), + Field::new("schema", DataType::Utf8, true), + Field::new( + "requires", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("comment", DataType::Utf8, true), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_cast.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_cast.rs new file mode 100644 index 0000000000000..1d7fa41b841b0 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_cast.rs @@ -0,0 +1,115 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogCastBuilder { + oid: UInt32Builder, + castsource: UInt32Builder, + casttarget: UInt32Builder, + castfunc: UInt32Builder, + castcontext: StringBuilder, + castmethod: StringBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogCastBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + castsource: UInt32Builder::new(capacity), + casttarget: UInt32Builder::new(capacity), + castfunc: UInt32Builder::new(capacity), + castcontext: StringBuilder::new(capacity), + castmethod: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.castsource.finish()), + Arc::new(self.casttarget.finish()), + Arc::new(self.castfunc.finish()), + Arc::new(self.castcontext.finish()), + Arc::new(self.castmethod.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogCastProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-cast.html +impl PgCatalogCastProvider { + pub fn new() -> Self { + let builder = PgCatalogCastBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogCastProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("castsource", DataType::UInt32, false), + Field::new("casttarget", DataType::UInt32, false), + Field::new("castfunc", DataType::UInt32, false), + Field::new("castcontext", DataType::Utf8, false), + Field::new("castmethod", DataType::Utf8, false), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_class.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_class.rs index 9c7ec75dcecc1..ee57c4a444298 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_class.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_class.rs @@ -78,6 +78,7 @@ struct PgCatalogClassBuilder { relacl: StringBuilder, reloptions: StringBuilder, relpartbound: StringBuilder, + xmin: UInt32Builder, // This column was removed after PostgreSQL 12, but it's required to support Tableau Desktop with ODBC // True if we generate an OID for each row of the relation relhasoids: BooleanBuilder, @@ -121,6 +122,7 @@ impl PgCatalogClassBuilder { relacl: StringBuilder::new(capacity), reloptions: StringBuilder::new(capacity), relpartbound: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), relhasoids: BooleanBuilder::new(capacity), } } @@ -161,6 +163,7 @@ impl PgCatalogClassBuilder { self.relacl.append_null().unwrap(); self.reloptions.append_null().unwrap(); self.relpartbound.append_null().unwrap(); + self.xmin.append_value(1).unwrap(); self.relhasoids.append_value(false).unwrap(); } @@ -199,6 +202,7 @@ impl PgCatalogClassBuilder { Arc::new(self.relacl.finish()), Arc::new(self.reloptions.finish()), Arc::new(self.relpartbound.finish()), + Arc::new(self.xmin.finish()), Arc::new(self.relhasoids.finish()), ]; @@ -317,6 +321,7 @@ impl TableProvider for PgCatalogClassProvider { Field::new("relacl", DataType::Utf8, true), Field::new("reloptions", DataType::Utf8, true), Field::new("relpartbound", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), Field::new("relhasoids", DataType::Boolean, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_constraint.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_constraint.rs index 46d1c7bce5eab..b55cfc6c5f153 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_constraint.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_constraint.rs @@ -43,6 +43,7 @@ struct PgCatalogConstraintBuilder { conffeqop: StringBuilder, conexclop: StringBuilder, conbin: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogConstraintBuilder { @@ -75,6 +76,7 @@ impl PgCatalogConstraintBuilder { conffeqop: StringBuilder::new(capacity), conexclop: StringBuilder::new(capacity), conbin: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -105,6 +107,7 @@ impl PgCatalogConstraintBuilder { Arc::new(self.conffeqop.finish()), Arc::new(self.conexclop.finish()), Arc::new(self.conbin.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -170,6 +173,7 @@ impl TableProvider for PgCatalogConstraintProvider { Field::new("conffeqop", DataType::Utf8, true), Field::new("conexclop", DataType::Utf8, true), Field::new("conbin", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_description.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_description.rs index b3de6e0d25779..a370dd03cef4f 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_description.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_description.rs @@ -28,6 +28,7 @@ struct PgCatalogDescriptionBuilder { objsubid: Int32Builder, /// Arbitrary text that serves as the description of this object description: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogDescriptionBuilder { @@ -39,6 +40,7 @@ impl PgCatalogDescriptionBuilder { classoid: UInt32Builder::new(capacity), objsubid: Int32Builder::new(capacity), description: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -47,6 +49,7 @@ impl PgCatalogDescriptionBuilder { self.classoid.append_value(PG_CLASS_CLASS_OID).unwrap(); self.objsubid.append_value(0).unwrap(); self.description.append_value(description).unwrap(); + self.xmin.append_value(1).unwrap(); } fn add_column(&mut self, table_oid: u32, column_idx: usize, description: impl AsRef) { @@ -57,6 +60,7 @@ impl PgCatalogDescriptionBuilder { .append_value(i32::try_from(column_idx).unwrap() + 1) .unwrap(); self.description.append_value(description).unwrap(); + self.xmin.append_value(1).unwrap(); } fn finish(mut self) -> Vec> { @@ -65,6 +69,7 @@ impl PgCatalogDescriptionBuilder { Arc::new(self.classoid.finish()), Arc::new(self.objsubid.finish()), Arc::new(self.description.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -113,6 +118,7 @@ impl TableProvider for PgCatalogDescriptionProvider { Field::new("classoid", DataType::UInt32, false), Field::new("objsubid", DataType::Int32, false), Field::new("description", DataType::Utf8, false), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_event_trigger.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_event_trigger.rs new file mode 100644 index 0000000000000..a375d169b4059 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_event_trigger.rs @@ -0,0 +1,123 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogEventTriggerBuilder { + oid: UInt32Builder, + evtname: StringBuilder, + evtevent: StringBuilder, + evtowner: UInt32Builder, + evtfoid: UInt32Builder, + evtenabled: StringBuilder, + evttags: ListBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogEventTriggerBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + evtname: StringBuilder::new(capacity), + evtevent: StringBuilder::new(capacity), + evtowner: UInt32Builder::new(capacity), + evtfoid: UInt32Builder::new(capacity), + evtenabled: StringBuilder::new(capacity), + evttags: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.evtname.finish()), + Arc::new(self.evtevent.finish()), + Arc::new(self.evtowner.finish()), + Arc::new(self.evtfoid.finish()), + Arc::new(self.evtenabled.finish()), + Arc::new(self.evttags.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogEventTriggerProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-event-trigger.html +impl PgCatalogEventTriggerProvider { + pub fn new() -> Self { + let builder = PgCatalogEventTriggerBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogEventTriggerProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("evtname", DataType::Utf8, false), + Field::new("evtevent", DataType::Utf8, false), + Field::new("evtowner", DataType::UInt32, false), + Field::new("evtfoid", DataType::UInt32, false), + Field::new("evtenabled", DataType::Utf8, false), + Field::new( + "evttags", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_extension.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_extension.rs index feed20c165805..2db70426963cd 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_extension.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_extension.rs @@ -23,6 +23,7 @@ struct PgCatalogExtensionBuilder { extversion: StringBuilder, extconfig: ListBuilder, extcondition: ListBuilder, + xmin: UInt32Builder, } impl PgCatalogExtensionBuilder { @@ -38,6 +39,7 @@ impl PgCatalogExtensionBuilder { extversion: StringBuilder::new(capacity), extconfig: ListBuilder::new(UInt32Builder::new(capacity)), extcondition: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), } } @@ -51,6 +53,7 @@ impl PgCatalogExtensionBuilder { Arc::new(self.extversion.finish()), Arc::new(self.extconfig.finish()), Arc::new(self.extcondition.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -99,6 +102,7 @@ impl TableProvider for PgCatalogExtensionProvider { DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), true, ), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_data_wrapper.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_data_wrapper.rs new file mode 100644 index 0000000000000..3381aee62d92c --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_data_wrapper.rs @@ -0,0 +1,127 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogForeignDataWrapperBuilder { + oid: UInt32Builder, + fdwname: StringBuilder, + fdwowner: UInt32Builder, + fdwhandler: UInt32Builder, + fdwvalidator: UInt32Builder, + fdwacl: ListBuilder, + fdwoptions: ListBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogForeignDataWrapperBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + fdwname: StringBuilder::new(capacity), + fdwowner: UInt32Builder::new(capacity), + fdwhandler: UInt32Builder::new(capacity), + fdwvalidator: UInt32Builder::new(capacity), + fdwacl: ListBuilder::new(StringBuilder::new(capacity)), + fdwoptions: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.fdwname.finish()), + Arc::new(self.fdwowner.finish()), + Arc::new(self.fdwhandler.finish()), + Arc::new(self.fdwvalidator.finish()), + Arc::new(self.fdwacl.finish()), + Arc::new(self.fdwoptions.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogForeignDataWrapperProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-foreign-data-wrapper.html +impl PgCatalogForeignDataWrapperProvider { + pub fn new() -> Self { + let builder = PgCatalogForeignDataWrapperBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogForeignDataWrapperProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("fdwname", DataType::Utf8, false), + Field::new("fdwowner", DataType::UInt32, false), + Field::new("fdwhandler", DataType::UInt32, false), + Field::new("fdwvalidator", DataType::UInt32, false), + Field::new( + "fdwacl", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new( + "fdwoptions", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_server.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_server.rs new file mode 100644 index 0000000000000..0d97adb233914 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_server.rs @@ -0,0 +1,131 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogForeignServerBuilder { + oid: UInt32Builder, + srvname: StringBuilder, + srvowner: UInt32Builder, + srvfdw: UInt32Builder, + srvtype: StringBuilder, + srvversion: StringBuilder, + srvacl: ListBuilder, + srvoptions: ListBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogForeignServerBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + srvname: StringBuilder::new(capacity), + srvowner: UInt32Builder::new(capacity), + srvfdw: UInt32Builder::new(capacity), + srvtype: StringBuilder::new(capacity), + srvversion: StringBuilder::new(capacity), + srvacl: ListBuilder::new(StringBuilder::new(capacity)), + srvoptions: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.srvname.finish()), + Arc::new(self.srvowner.finish()), + Arc::new(self.srvfdw.finish()), + Arc::new(self.srvtype.finish()), + Arc::new(self.srvversion.finish()), + Arc::new(self.srvacl.finish()), + Arc::new(self.srvoptions.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogForeignServerProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-foreign-server.html +impl PgCatalogForeignServerProvider { + pub fn new() -> Self { + let builder = PgCatalogForeignServerBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogForeignServerProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("srvname", DataType::Utf8, false), + Field::new("srvowner", DataType::UInt32, false), + Field::new("srvfdw", DataType::UInt32, false), + Field::new("srvtype", DataType::Utf8, true), + Field::new("srvversion", DataType::Utf8, true), + Field::new( + "srvacl", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new( + "srvoptions", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_table.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_table.rs new file mode 100644 index 0000000000000..b53aec1128ee5 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_foreign_table.rs @@ -0,0 +1,103 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogForeignTableBuilder { + ftrelid: UInt32Builder, + ftserver: UInt32Builder, + ftoptions: ListBuilder, +} + +impl PgCatalogForeignTableBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + ftrelid: UInt32Builder::new(capacity), + ftserver: UInt32Builder::new(capacity), + ftoptions: ListBuilder::new(StringBuilder::new(capacity)), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.ftrelid.finish()), + Arc::new(self.ftserver.finish()), + Arc::new(self.ftoptions.finish()), + ]; + + columns + } +} + +pub struct PgCatalogForeignTableProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-foreign-table.html +impl PgCatalogForeignTableProvider { + pub fn new() -> Self { + let builder = PgCatalogForeignTableBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogForeignTableProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("ftrelid", DataType::UInt32, false), + Field::new("ftserver", DataType::UInt32, false), + Field::new( + "ftoptions", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_index.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_index.rs index 45839de1d7fd7..db12036d71cef 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_index.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_index.rs @@ -37,6 +37,7 @@ struct PgCatalogIndexBuilder { indoption: ListBuilder, indexprs: StringBuilder, indpred: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogIndexBuilder { @@ -64,6 +65,7 @@ impl PgCatalogIndexBuilder { indoption: ListBuilder::new(Int16Builder::new(capacity)), indexprs: StringBuilder::new(capacity), indpred: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -89,6 +91,7 @@ impl PgCatalogIndexBuilder { Arc::new(self.indoption.finish()), Arc::new(self.indexprs.finish()), Arc::new(self.indpred.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -157,6 +160,7 @@ impl TableProvider for PgCatalogIndexProvider { ), Field::new("indexprs", DataType::Utf8, true), Field::new("indpred", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_language.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_language.rs new file mode 100644 index 0000000000000..835782012cb7e --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_language.rs @@ -0,0 +1,185 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgLanguage { + oid: u32, + lanname: &'static str, + lanowner: u32, + lanispl: bool, + lanpltrusted: bool, + lanplcallfoid: u32, + laninline: u32, + lanvalidator: u32, +} + +struct PgCatalogLanguageBuilder { + oid: UInt32Builder, + lanname: StringBuilder, + lanowner: UInt32Builder, + lanispl: BooleanBuilder, + lanpltrusted: BooleanBuilder, + lanplcallfoid: UInt32Builder, + laninline: UInt32Builder, + lanvalidator: UInt32Builder, + lanacl: ListBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogLanguageBuilder { + fn new() -> Self { + let capacity = 3; + + Self { + oid: UInt32Builder::new(capacity), + lanname: StringBuilder::new(capacity), + lanowner: UInt32Builder::new(capacity), + lanispl: BooleanBuilder::new(capacity), + lanpltrusted: BooleanBuilder::new(capacity), + lanplcallfoid: UInt32Builder::new(capacity), + laninline: UInt32Builder::new(capacity), + lanvalidator: UInt32Builder::new(capacity), + lanacl: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), + } + } + + fn add_language(&mut self, lan: &PgLanguage) { + self.oid.append_value(lan.oid).unwrap(); + self.lanname.append_value(lan.lanname).unwrap(); + self.lanowner.append_value(lan.lanowner).unwrap(); + self.lanispl.append_value(lan.lanispl).unwrap(); + self.lanpltrusted.append_value(lan.lanpltrusted).unwrap(); + self.lanplcallfoid.append_value(lan.lanplcallfoid).unwrap(); + self.laninline.append_value(lan.laninline).unwrap(); + self.lanvalidator.append_value(lan.lanvalidator).unwrap(); + self.lanacl.append(false).unwrap(); + self.xmin.append_value(1).unwrap(); + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.lanname.finish()), + Arc::new(self.lanowner.finish()), + Arc::new(self.lanispl.finish()), + Arc::new(self.lanpltrusted.finish()), + Arc::new(self.lanplcallfoid.finish()), + Arc::new(self.laninline.finish()), + Arc::new(self.lanvalidator.finish()), + Arc::new(self.lanacl.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogLanguageProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-language.html +impl PgCatalogLanguageProvider { + pub fn new() -> Self { + let mut builder = PgCatalogLanguageBuilder::new(); + builder.add_language(&PgLanguage { + oid: 12, + lanname: "internal", + lanowner: 10, + lanispl: false, + lanpltrusted: false, + lanplcallfoid: 0, + laninline: 0, + lanvalidator: 2246, + }); + builder.add_language(&PgLanguage { + oid: 13, + lanname: "c", + lanowner: 10, + lanispl: false, + lanpltrusted: false, + lanplcallfoid: 0, + laninline: 0, + lanvalidator: 2247, + }); + builder.add_language(&PgLanguage { + oid: 14, + lanname: "sql", + lanowner: 10, + lanispl: false, + lanpltrusted: true, + lanplcallfoid: 0, + laninline: 0, + lanvalidator: 2248, + }); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogLanguageProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("lanname", DataType::Utf8, false), + Field::new("lanowner", DataType::UInt32, false), + Field::new("lanispl", DataType::Boolean, false), + Field::new("lanpltrusted", DataType::Boolean, false), + Field::new("lanplcallfoid", DataType::UInt32, false), + Field::new("laninline", DataType::UInt32, false), + Field::new("lanvalidator", DataType::UInt32, false), + Field::new( + "lanacl", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_locks.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_locks.rs new file mode 100644 index 0000000000000..462df8066ed93 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_locks.rs @@ -0,0 +1,158 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{ + Array, ArrayRef, BooleanBuilder, Int16Builder, Int32Builder, StringBuilder, + TimestampNanosecondBuilder, UInt32Builder, + }, + datatypes::{DataType, Field, Schema, SchemaRef, TimeUnit}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogLocksBuilder { + locktype: StringBuilder, + database: UInt32Builder, + relation: UInt32Builder, + page: Int32Builder, + tuple: Int16Builder, + virtualxid: StringBuilder, + transactionid: UInt32Builder, + classid: UInt32Builder, + objid: UInt32Builder, + objsubid: Int16Builder, + virtualtransaction: StringBuilder, + pid: Int32Builder, + mode: StringBuilder, + granted: BooleanBuilder, + fastpath: BooleanBuilder, + waitstart: TimestampNanosecondBuilder, +} + +impl PgCatalogLocksBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + locktype: StringBuilder::new(capacity), + database: UInt32Builder::new(capacity), + relation: UInt32Builder::new(capacity), + page: Int32Builder::new(capacity), + tuple: Int16Builder::new(capacity), + virtualxid: StringBuilder::new(capacity), + transactionid: UInt32Builder::new(capacity), + classid: UInt32Builder::new(capacity), + objid: UInt32Builder::new(capacity), + objsubid: Int16Builder::new(capacity), + virtualtransaction: StringBuilder::new(capacity), + pid: Int32Builder::new(capacity), + mode: StringBuilder::new(capacity), + granted: BooleanBuilder::new(capacity), + fastpath: BooleanBuilder::new(capacity), + waitstart: TimestampNanosecondBuilder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.locktype.finish()), + Arc::new(self.database.finish()), + Arc::new(self.relation.finish()), + Arc::new(self.page.finish()), + Arc::new(self.tuple.finish()), + Arc::new(self.virtualxid.finish()), + Arc::new(self.transactionid.finish()), + Arc::new(self.classid.finish()), + Arc::new(self.objid.finish()), + Arc::new(self.objsubid.finish()), + Arc::new(self.virtualtransaction.finish()), + Arc::new(self.pid.finish()), + Arc::new(self.mode.finish()), + Arc::new(self.granted.finish()), + Arc::new(self.fastpath.finish()), + Arc::new(self.waitstart.finish()), + ]; + + columns + } +} + +pub struct PgCatalogLocksProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/view-pg-locks.html +impl PgCatalogLocksProvider { + pub fn new() -> Self { + let builder = PgCatalogLocksBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogLocksProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("locktype", DataType::Utf8, true), + Field::new("database", DataType::UInt32, true), + Field::new("relation", DataType::UInt32, true), + Field::new("page", DataType::Int32, true), + Field::new("tuple", DataType::Int16, true), + Field::new("virtualxid", DataType::Utf8, true), + Field::new("transactionid", DataType::UInt32, true), + Field::new("classid", DataType::UInt32, true), + Field::new("objid", DataType::UInt32, true), + Field::new("objsubid", DataType::Int16, true), + Field::new("virtualtransaction", DataType::Utf8, true), + Field::new("pid", DataType::Int32, true), + Field::new("mode", DataType::Utf8, true), + Field::new("granted", DataType::Boolean, true), + Field::new("fastpath", DataType::Boolean, true), + Field::new( + "waitstart", + DataType::Timestamp(TimeUnit::Nanosecond, None), + true, + ), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_namespace.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_namespace.rs index efd17ef01a5af..76dd681ad4392 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_namespace.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_namespace.rs @@ -4,7 +4,7 @@ use async_trait::async_trait; use datafusion::{ arrow::{ - array::{Array, ArrayRef, StringBuilder, UInt32Builder}, + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, datatypes::{DataType, Field, Schema, SchemaRef}, record_batch::RecordBatch, }, @@ -25,14 +25,14 @@ struct PgNamespace { oid: u32, nspname: &'static str, nspowner: u32, - nspacl: &'static str, } struct PgCatalogNamespaceBuilder { oid: UInt32Builder, nspname: StringBuilder, nspowner: UInt32Builder, - nspacl: StringBuilder, + nspacl: ListBuilder, + xmin: UInt32Builder, } impl PgCatalogNamespaceBuilder { @@ -43,7 +43,8 @@ impl PgCatalogNamespaceBuilder { oid: UInt32Builder::new(capacity), nspname: StringBuilder::new(capacity), nspowner: UInt32Builder::new(capacity), - nspacl: StringBuilder::new(capacity), + nspacl: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), } } @@ -51,7 +52,8 @@ impl PgCatalogNamespaceBuilder { self.oid.append_value(ns.oid).unwrap(); self.nspname.append_value(ns.nspname).unwrap(); self.nspowner.append_value(ns.nspowner).unwrap(); - self.nspacl.append_value(ns.nspacl).unwrap(); + self.nspacl.append(false).unwrap(); + self.xmin.append_value(1).unwrap(); } fn finish(mut self) -> Vec> { @@ -60,6 +62,7 @@ impl PgCatalogNamespaceBuilder { Arc::new(self.nspname.finish()), Arc::new(self.nspowner.finish()), Arc::new(self.nspacl.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -77,19 +80,16 @@ impl PgCatalogNamespaceProvider { oid: PG_NAMESPACE_CATALOG_OID, nspname: "pg_catalog", nspowner: 10, - nspacl: "{test=UC/test,=U/test}", }); builder.add_namespace(&PgNamespace { oid: PG_NAMESPACE_PUBLIC_OID, nspname: "public", nspowner: 10, - nspacl: "{test=UC/test,=U/test}", }); builder.add_namespace(&PgNamespace { oid: 13000, nspname: "information_schema", nspowner: 10, - nspacl: "{test=UC/test,=U/test}", }); Self { @@ -113,7 +113,12 @@ impl TableProvider for PgCatalogNamespaceProvider { Field::new("oid", DataType::UInt32, false), Field::new("nspname", DataType::Utf8, false), Field::new("nspowner", DataType::UInt32, false), - Field::new("nspacl", DataType::Utf8, true), + Field::new( + "nspacl", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_operator.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_operator.rs new file mode 100644 index 0000000000000..5f3a3c3e41079 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_operator.rs @@ -0,0 +1,151 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogOperatorBuilder { + oid: UInt32Builder, + oprname: StringBuilder, + oprnamespace: UInt32Builder, + oprowner: UInt32Builder, + oprkind: StringBuilder, + oprcanmerge: BooleanBuilder, + oprcanhash: BooleanBuilder, + oprleft: UInt32Builder, + oprright: UInt32Builder, + oprresult: UInt32Builder, + oprcom: UInt32Builder, + oprnegate: UInt32Builder, + oprcode: StringBuilder, + oprrest: StringBuilder, + oprjoin: StringBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogOperatorBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + oprname: StringBuilder::new(capacity), + oprnamespace: UInt32Builder::new(capacity), + oprowner: UInt32Builder::new(capacity), + oprkind: StringBuilder::new(capacity), + oprcanmerge: BooleanBuilder::new(capacity), + oprcanhash: BooleanBuilder::new(capacity), + oprleft: UInt32Builder::new(capacity), + oprright: UInt32Builder::new(capacity), + oprresult: UInt32Builder::new(capacity), + oprcom: UInt32Builder::new(capacity), + oprnegate: UInt32Builder::new(capacity), + oprcode: StringBuilder::new(capacity), + oprrest: StringBuilder::new(capacity), + oprjoin: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.oprname.finish()), + Arc::new(self.oprnamespace.finish()), + Arc::new(self.oprowner.finish()), + Arc::new(self.oprkind.finish()), + Arc::new(self.oprcanmerge.finish()), + Arc::new(self.oprcanhash.finish()), + Arc::new(self.oprleft.finish()), + Arc::new(self.oprright.finish()), + Arc::new(self.oprresult.finish()), + Arc::new(self.oprcom.finish()), + Arc::new(self.oprnegate.finish()), + Arc::new(self.oprcode.finish()), + Arc::new(self.oprrest.finish()), + Arc::new(self.oprjoin.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogOperatorProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-operator.html +impl PgCatalogOperatorProvider { + pub fn new() -> Self { + let builder = PgCatalogOperatorBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogOperatorProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("oprname", DataType::Utf8, false), + Field::new("oprnamespace", DataType::UInt32, false), + Field::new("oprowner", DataType::UInt32, false), + Field::new("oprkind", DataType::Utf8, false), + Field::new("oprcanmerge", DataType::Boolean, false), + Field::new("oprcanhash", DataType::Boolean, false), + Field::new("oprleft", DataType::UInt32, false), + Field::new("oprright", DataType::UInt32, false), + Field::new("oprresult", DataType::UInt32, false), + Field::new("oprcom", DataType::UInt32, false), + Field::new("oprnegate", DataType::UInt32, false), + Field::new("oprcode", DataType::Utf8, false), + Field::new("oprrest", DataType::Utf8, false), + Field::new("oprjoin", DataType::Utf8, false), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_proc.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_proc.rs index 6e2936a328781..85c2281920627 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_proc.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_proc.rs @@ -65,6 +65,7 @@ struct PgCatalogProcBuilder { prosqlbody: StringBuilder, proconfig: StringBuilder, proacl: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogProcBuilder { @@ -102,6 +103,7 @@ impl PgCatalogProcBuilder { prosqlbody: StringBuilder::new(capacity), proconfig: StringBuilder::new(capacity), proacl: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -150,6 +152,7 @@ impl PgCatalogProcBuilder { self.prosqlbody.append_null().unwrap(); self.proconfig.append_null().unwrap(); self.proacl.append_null().unwrap(); + self.xmin.append_value(1).unwrap(); } fn finish(mut self) -> Vec> { @@ -184,6 +187,7 @@ impl PgCatalogProcBuilder { Arc::new(self.prosqlbody.finish()), Arc::new(self.proconfig.finish()), Arc::new(self.proacl.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -793,6 +797,7 @@ impl TableProvider for PgCatalogProcProvider { Field::new("prosqlbody", DataType::Utf8, true), Field::new("proconfig", DataType::Utf8, true), Field::new("proacl", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_rewrite.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_rewrite.rs new file mode 100644 index 0000000000000..808a0cf286e8e --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_rewrite.rs @@ -0,0 +1,123 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogRewriteBuilder { + oid: UInt32Builder, + rulename: StringBuilder, + ev_class: UInt32Builder, + ev_type: StringBuilder, + ev_enabled: StringBuilder, + is_instead: BooleanBuilder, + ev_qual: StringBuilder, // FIXME: actual type "pg_node_tree" + ev_action: StringBuilder, // FIXME: actual type "pg_node_tree" + xmin: UInt32Builder, +} + +impl PgCatalogRewriteBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + rulename: StringBuilder::new(capacity), + ev_class: UInt32Builder::new(capacity), + ev_type: StringBuilder::new(capacity), + ev_enabled: StringBuilder::new(capacity), + is_instead: BooleanBuilder::new(capacity), + ev_qual: StringBuilder::new(capacity), + ev_action: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.rulename.finish()), + Arc::new(self.ev_class.finish()), + Arc::new(self.ev_type.finish()), + Arc::new(self.ev_enabled.finish()), + Arc::new(self.is_instead.finish()), + Arc::new(self.ev_qual.finish()), + Arc::new(self.ev_action.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogRewriteProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-rewrite.html +impl PgCatalogRewriteProvider { + pub fn new() -> Self { + let builder = PgCatalogRewriteBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogRewriteProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("rulename", DataType::Utf8, false), + Field::new("ev_class", DataType::UInt32, false), + Field::new("ev_type", DataType::Utf8, false), + Field::new("ev_enabled", DataType::Utf8, false), + Field::new("is_instead", DataType::Boolean, false), + Field::new("ev_qual", DataType::Utf8, false), + Field::new("ev_action", DataType::Utf8, false), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_tablespace.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_tablespace.rs new file mode 100644 index 0000000000000..868f06ea1381a --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_tablespace.rs @@ -0,0 +1,144 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgTablespace { + oid: u32, + spcname: &'static str, + spcowner: u32, +} + +struct PgCatalogTablespaceBuilder { + oid: UInt32Builder, + spcname: StringBuilder, + spcowner: UInt32Builder, + spcacl: ListBuilder, + spcoptions: ListBuilder, + xmin: UInt32Builder, +} + +impl PgCatalogTablespaceBuilder { + fn new() -> Self { + let capacity = 2; + + Self { + oid: UInt32Builder::new(capacity), + spcname: StringBuilder::new(capacity), + spcowner: UInt32Builder::new(capacity), + spcacl: ListBuilder::new(StringBuilder::new(capacity)), + spcoptions: ListBuilder::new(StringBuilder::new(capacity)), + xmin: UInt32Builder::new(capacity), + } + } + + fn add_tablespace(&mut self, ts: &PgTablespace) { + self.oid.append_value(ts.oid).unwrap(); + self.spcname.append_value(ts.spcname).unwrap(); + self.spcowner.append_value(ts.spcowner).unwrap(); + self.spcacl.append(false).unwrap(); + self.spcoptions.append(false).unwrap(); + self.xmin.append_value(1).unwrap(); + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.spcname.finish()), + Arc::new(self.spcowner.finish()), + Arc::new(self.spcacl.finish()), + Arc::new(self.spcoptions.finish()), + Arc::new(self.xmin.finish()), + ]; + + columns + } +} + +pub struct PgCatalogTablespaceProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-tablespace.html +impl PgCatalogTablespaceProvider { + pub fn new() -> Self { + let mut builder = PgCatalogTablespaceBuilder::new(); + builder.add_tablespace(&PgTablespace { + oid: 1663, + spcname: "pg_default", + spcowner: 10, + }); + builder.add_tablespace(&PgTablespace { + oid: 1664, + spcname: "pg_global", + spcowner: 10, + }); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogTablespaceProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("spcname", DataType::Utf8, false), + Field::new("spcowner", DataType::UInt32, false), + Field::new( + "spcacl", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new( + "spcoptions", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + Field::new("xmin", DataType::UInt32, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_abbrevs.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_abbrevs.rs new file mode 100644 index 0000000000000..7078170cf46d5 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_abbrevs.rs @@ -0,0 +1,120 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, IntervalMonthDayNanoBuilder, StringBuilder}, + datatypes::{DataType, Field, IntervalMonthDayNanoType, IntervalUnit, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgTimezoneAbbrev { + abbrev: &'static str, + utc_offset: i128, // IntervalMonthDayNano + is_dst: bool, +} + +struct PgCatalogTimezoneAbbrevsBuilder { + abbrev: StringBuilder, + utc_offset: IntervalMonthDayNanoBuilder, + is_dst: BooleanBuilder, +} + +impl PgCatalogTimezoneAbbrevsBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + abbrev: StringBuilder::new(capacity), + utc_offset: IntervalMonthDayNanoBuilder::new(capacity), + is_dst: BooleanBuilder::new(capacity), + } + } + + fn add_timezone_abbrev(&mut self, tzabbrev: &PgTimezoneAbbrev) { + self.abbrev.append_value(tzabbrev.abbrev).unwrap(); + self.utc_offset.append_value(tzabbrev.utc_offset).unwrap(); + self.is_dst.append_value(tzabbrev.is_dst).unwrap(); + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.abbrev.finish()), + Arc::new(self.utc_offset.finish()), + Arc::new(self.is_dst.finish()), + ]; + + columns + } +} + +pub struct PgCatalogTimezoneAbbrevsProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/view-pg-timezone-abbrevs.html +impl PgCatalogTimezoneAbbrevsProvider { + pub fn new() -> Self { + let mut builder = PgCatalogTimezoneAbbrevsBuilder::new(); + builder.add_timezone_abbrev(&PgTimezoneAbbrev { + abbrev: "UTC", + utc_offset: IntervalMonthDayNanoType::make_value(0, 0, 0), + is_dst: false, + }); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogTimezoneAbbrevsProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("abbrev", DataType::Utf8, false), + Field::new( + "utc_offset", + DataType::Interval(IntervalUnit::MonthDayNano), + false, + ), + Field::new("is_dst", DataType::Boolean, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_names.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_names.rs new file mode 100644 index 0000000000000..1f9122623cff4 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_timezone_names.rs @@ -0,0 +1,127 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, BooleanBuilder, IntervalMonthDayNanoBuilder, StringBuilder}, + datatypes::{DataType, Field, IntervalMonthDayNanoType, IntervalUnit, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgTimezoneName { + name: &'static str, + abbrev: &'static str, + utc_offset: i128, // IntervalMonthDayNano + is_dst: bool, +} + +struct PgCatalogTimezoneNamesBuilder { + name: StringBuilder, + abbrev: StringBuilder, + utc_offset: IntervalMonthDayNanoBuilder, + is_dst: BooleanBuilder, +} + +impl PgCatalogTimezoneNamesBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + name: StringBuilder::new(capacity), + abbrev: StringBuilder::new(capacity), + utc_offset: IntervalMonthDayNanoBuilder::new(capacity), + is_dst: BooleanBuilder::new(capacity), + } + } + + fn add_timezone_name(&mut self, tzname: &PgTimezoneName) { + self.name.append_value(tzname.name).unwrap(); + self.abbrev.append_value(tzname.abbrev).unwrap(); + self.utc_offset.append_value(tzname.utc_offset).unwrap(); + self.is_dst.append_value(tzname.is_dst).unwrap(); + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.name.finish()), + Arc::new(self.abbrev.finish()), + Arc::new(self.utc_offset.finish()), + Arc::new(self.is_dst.finish()), + ]; + + columns + } +} + +pub struct PgCatalogTimezoneNamesProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/view-pg-timezone-names.html +impl PgCatalogTimezoneNamesProvider { + pub fn new() -> Self { + let mut builder = PgCatalogTimezoneNamesBuilder::new(); + builder.add_timezone_name(&PgTimezoneName { + name: "UTC", + abbrev: "UTC", + utc_offset: IntervalMonthDayNanoType::make_value(0, 0, 0), + is_dst: false, + }); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogTimezoneNamesProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("name", DataType::Utf8, false), + Field::new("abbrev", DataType::Utf8, false), + Field::new( + "utc_offset", + DataType::Interval(IntervalUnit::MonthDayNano), + false, + ), + Field::new("is_dst", DataType::Boolean, false), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_type.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_type.rs index c3608efad2f5f..445064ef28804 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_type.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_type.rs @@ -59,6 +59,7 @@ struct PgCatalogTypeBuilder { typdefaultbin: StringBuilder, typdefault: StringBuilder, typacl: StringBuilder, + xmin: UInt32Builder, } impl PgCatalogTypeBuilder { @@ -100,6 +101,7 @@ impl PgCatalogTypeBuilder { typdefaultbin: StringBuilder::new(capacity), typdefault: StringBuilder::new(capacity), typacl: StringBuilder::new(capacity), + xmin: UInt32Builder::new(capacity), } } @@ -137,6 +139,7 @@ impl PgCatalogTypeBuilder { self.typdefaultbin.append_null().unwrap(); self.typdefault.append_null().unwrap(); self.typacl.append_null().unwrap(); + self.xmin.append_value(1).unwrap(); } fn finish(mut self) -> Vec> { @@ -173,6 +176,7 @@ impl PgCatalogTypeBuilder { Arc::new(self.typdefaultbin.finish()), Arc::new(self.typdefault.finish()), Arc::new(self.typacl.finish()), + Arc::new(self.xmin.finish()), ]; columns @@ -297,6 +301,7 @@ impl TableProvider for PgCatalogTypeProvider { Field::new("typdefaultbin", DataType::Utf8, true), Field::new("typdefault", DataType::Utf8, true), Field::new("typacl", DataType::Utf8, true), + Field::new("xmin", DataType::UInt32, false), ])) } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_user_mapping.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_user_mapping.rs new file mode 100644 index 0000000000000..073eb199172b3 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_user_mapping.rs @@ -0,0 +1,107 @@ +use std::{any::Any, sync::Arc}; + +use async_trait::async_trait; + +use datafusion::{ + arrow::{ + array::{Array, ArrayRef, ListBuilder, StringBuilder, UInt32Builder}, + datatypes::{DataType, Field, Schema, SchemaRef}, + record_batch::RecordBatch, + }, + datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, + error::DataFusionError, + logical_plan::Expr, + physical_plan::{memory::MemoryExec, ExecutionPlan}, +}; + +struct PgCatalogUserMappingBuilder { + oid: UInt32Builder, + umuser: UInt32Builder, + umserver: UInt32Builder, + umoptions: ListBuilder, +} + +impl PgCatalogUserMappingBuilder { + fn new() -> Self { + let capacity = 1; + + Self { + oid: UInt32Builder::new(capacity), + umuser: UInt32Builder::new(capacity), + umserver: UInt32Builder::new(capacity), + umoptions: ListBuilder::new(StringBuilder::new(capacity)), + } + } + + fn finish(mut self) -> Vec> { + let columns: Vec> = vec![ + Arc::new(self.oid.finish()), + Arc::new(self.umuser.finish()), + Arc::new(self.umserver.finish()), + Arc::new(self.umoptions.finish()), + ]; + + columns + } +} + +pub struct PgCatalogUserMappingProvider { + data: Arc>, +} + +// https://www.postgresql.org/docs/14/catalog-pg-user-mapping.html +impl PgCatalogUserMappingProvider { + pub fn new() -> Self { + let builder = PgCatalogUserMappingBuilder::new(); + + Self { + data: Arc::new(builder.finish()), + } + } +} + +#[async_trait] +impl TableProvider for PgCatalogUserMappingProvider { + fn as_any(&self) -> &dyn Any { + self + } + + fn table_type(&self) -> TableType { + TableType::View + } + + fn schema(&self) -> SchemaRef { + Arc::new(Schema::new(vec![ + Field::new("oid", DataType::UInt32, false), + Field::new("umuser", DataType::UInt32, false), + Field::new("umserver", DataType::UInt32, false), + Field::new( + "umoptions", + DataType::List(Box::new(Field::new("item", DataType::Utf8, true))), + true, + ), + ])) + } + + async fn scan( + &self, + projection: &Option>, + _filters: &[Expr], + _limit: Option, + ) -> Result, DataFusionError> { + let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; + + Ok(Arc::new(MemoryExec::try_new( + &[vec![batch]], + self.schema(), + projection.clone(), + )?)) + } + + fn supports_filter_pushdown( + &self, + _filter: &Expr, + ) -> Result { + Ok(TableProviderFilterPushDown::Unsupported) + } +} diff --git a/rust/cubesql/cubesql/src/compile/engine/udf/common.rs b/rust/cubesql/cubesql/src/compile/engine/udf/common.rs index 6535634178916..ee5d3e2310140 100644 --- a/rust/cubesql/cubesql/src/compile/engine/udf/common.rs +++ b/rust/cubesql/cubesql/src/compile/engine/udf/common.rs @@ -11,11 +11,12 @@ use datafusion::{ arrow::{ array::{ new_null_array, Array, ArrayBuilder, ArrayRef, BooleanArray, BooleanBuilder, - Date32Array, Float64Array, Float64Builder, GenericStringArray, Int32Builder, - Int64Array, Int64Builder, IntervalDayTimeBuilder, IntervalMonthDayNanoArray, ListArray, - ListBuilder, PrimitiveArray, PrimitiveBuilder, StringArray, StringBuilder, - StructBuilder, TimestampMicrosecondArray, TimestampMillisecondArray, - TimestampNanosecondArray, TimestampSecondArray, UInt32Builder, UInt64Builder, + Date32Array, Float64Array, Float64Builder, GenericStringArray, Int32Array, + Int32Builder, Int64Array, Int64Builder, IntervalDayTimeBuilder, + IntervalMonthDayNanoArray, ListArray, ListBuilder, PrimitiveArray, PrimitiveBuilder, + StringArray, StringBuilder, StructBuilder, TimestampMicrosecondArray, + TimestampMillisecondArray, TimestampNanosecondArray, TimestampNanosecondBuilder, + TimestampSecondArray, UInt32Builder, UInt64Builder, }, compute::{cast, concat}, datatypes::{ @@ -1876,6 +1877,44 @@ pub fn create_format_type_udf() -> ScalarUDF { PgTypeId::ARRAYINT8MULTIRANGE => { format!("int8multirange{}[]", typemod_str()) } + PgTypeId::ARRAYPGAM => { + format!("pg_am{}[]", typemod_str()) + } + PgTypeId::PGAM => { + format!("pg_am{}", typemod_str()) + } + PgTypeId::ARRAYPGLANGUAGE => { + format!("pg_language{}[]", typemod_str()) + } + PgTypeId::PGLANGUAGE => { + format!("pg_language{}", typemod_str()) + } + PgTypeId::ARRAYPGEVENTTRIGGER => { + format!("pg_event_trigger{}[]", typemod_str()) + } + PgTypeId::PGEVENTTRIGGER => { + format!("pg_event_trigger{}", typemod_str()) + } + PgTypeId::ARRAYPGCAST => { + format!("pg_cast{}[]", typemod_str()) + } + PgTypeId::PGCAST => format!("pg_cast{}", typemod_str()), + PgTypeId::ARRAYPGEXTENSION => { + format!("pg_extension{}[]", typemod_str()) + } + PgTypeId::PGEXTENSION => format!("pg_extension{}", typemod_str()), + PgTypeId::ARRAYPGFOREIGNDATAWRAPPER => { + format!("pg_foreign_data_wrapper{}[]", typemod_str()) + } + PgTypeId::PGFOREIGNDATAWRAPPER => { + format!("pg_foreign_data_wrapper{}", typemod_str()) + } + PgTypeId::ARRAYPGFOREIGNSERVER => { + format!("pg_foreign_server{}[]", typemod_str()) + } + PgTypeId::PGFOREIGNSERVER => { + format!("pg_foreign_server{}", typemod_str()) + } PgTypeId::ARRAYPGCONSTRAINT => { format!("pg_constraint{}[]", typemod_str()) } @@ -3758,6 +3797,18 @@ pub fn create_pg_get_indexdef_udf() -> ScalarUDF { pub fn create_age_udf() -> ScalarUDF { let fun = make_scalar_function(move |args: &[ArrayRef]| match args.len() { 1 => { + // Special handling for `AGE(xid)` + if args[0].data_type() == &DataType::UInt32 { + let xids = downcast_primitive_arg!(args[0], "xid", OidType); + + let result = xids + .iter() + .map(|xid| xid.map(|_| i32::MAX)) + .collect::(); + + return Ok(Arc::new(result) as ArrayRef); + } + let older_dates = downcast_primitive_arg!(args[0], "older_date", TimestampNanosecondType); let current_date = Utc::now().date_naive().and_time(NaiveTime::default()); @@ -3806,8 +3857,13 @@ pub fn create_age_udf() -> ScalarUDF { )), }); - let return_type: ReturnTypeFunction = - Arc::new(move |_| Ok(Arc::new(DataType::Interval(IntervalUnit::MonthDayNano)))); + let return_type: ReturnTypeFunction = Arc::new(move |dt| { + // Special handling for `AGE(xid)` which returns Int32 + if dt.len() == 1 && dt[0] == DataType::UInt32 { + return Ok(Arc::new(DataType::Int32)); + } + Ok(Arc::new(DataType::Interval(IntervalUnit::MonthDayNano))) + }); ScalarUDF::new( "age", @@ -3818,6 +3874,7 @@ pub fn create_age_udf() -> ScalarUDF { DataType::Timestamp(TimeUnit::Nanosecond, None), DataType::Timestamp(TimeUnit::Nanosecond, None), ]), + TypeSignature::Exact(vec![DataType::UInt32]), ], // NOTE: volatility should be `Stable` but we have no access // to `query_execution_start_time` @@ -4052,6 +4109,85 @@ pub fn create_pg_relation_size_udf() -> ScalarUDF { ) } +pub fn create_pg_postmaster_start_time_udf() -> ScalarUDF { + let fun_registration_nanos = Utc::now() + .timestamp_nanos_opt() + .expect("Unable to get current time as nanoseconds"); + + let fun = make_scalar_function(move |_args: &[ArrayRef]| { + let mut builder = TimestampNanosecondBuilder::new(1); + builder.append_value(fun_registration_nanos).unwrap(); + + Ok(Arc::new(builder.finish()) as ArrayRef) + }); + + let return_type: ReturnTypeFunction = + Arc::new(move |_| Ok(Arc::new(DataType::Timestamp(TimeUnit::Nanosecond, None)))); + + ScalarUDF::new( + "pg_postmaster_start_time", + &Signature::exact(vec![], Volatility::Stable), + &return_type, + &fun, + ) +} + +pub fn create_txid_current_udf() -> ScalarUDF { + let fun = make_scalar_function(move |_args: &[ArrayRef]| { + let mut builder = Int64Builder::new(1); + builder.append_value(1).unwrap(); + + Ok(Arc::new(builder.finish()) as ArrayRef) + }); + + let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Int64))); + + ScalarUDF::new( + "txid_current", + &Signature::exact(vec![], Volatility::Stable), + &return_type, + &fun, + ) +} + +pub fn create_pg_is_in_recovery_udf() -> ScalarUDF { + let fun = make_scalar_function(move |_args: &[ArrayRef]| { + let mut builder = BooleanBuilder::new(1); + builder.append_value(false).unwrap(); + + Ok(Arc::new(builder.finish()) as ArrayRef) + }); + + let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Boolean))); + + ScalarUDF::new( + "pg_is_in_recovery", + &Signature::exact(vec![], Volatility::Stable), + &return_type, + &fun, + ) +} + +pub fn create_pg_tablespace_location_udf() -> ScalarUDF { + let fun = make_scalar_function(move |args: &[ArrayRef]| { + assert!(args.len() == 1); + + let oids = downcast_primitive_arg!(args[0], "oid", OidType); + let result = oids.iter().map(|_| Some("")).collect::(); + + Ok(Arc::new(result)) + }); + + let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Utf8))); + + ScalarUDF::new( + "pg_tablespace_location", + &Signature::exact(vec![DataType::UInt32], Volatility::Stable), + &return_type, + &fun, + ) +} + pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { macro_rules! register_fun_stub { ($FTYP:ident, $NAME:expr, argc=$ARGC:expr $(, rettyp=$RETTYP:ident)? $(, vol=$VOL:ident)?) => { @@ -4804,13 +4940,6 @@ pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { rettyp = Int64, vol = Stable ); - register_fun_stub!( - udf, - "pg_is_in_recovery", - argc = 0, - rettyp = Boolean, - vol = Volatile - ); register_fun_stub!( udf, "pg_is_wal_replay_paused", @@ -4874,13 +5003,6 @@ pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { rettyp = Regclass, vol = Stable ); - register_fun_stub!( - udf, - "pg_postmaster_start_time", - argc = 0, - rettyp = TimestampTz, - vol = Stable - ); register_fun_stub!( udf, "pg_promote", @@ -5010,13 +5132,6 @@ pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { rettyp = Int64, vol = Volatile ); - register_fun_stub!( - udf, - "pg_tablespace_location", - tsig = [Oid], - rettyp = Utf8, - vol = Stable - ); register_fun_stub!( udf, "pg_tablespace_size", @@ -5202,7 +5317,6 @@ pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { vol = Stable ); register_fun_stub!(udf, "trim_scale", tsig = [Float64], rettyp = Float64); - register_fun_stub!(udf, "txid_current", argc = 0, rettyp = Int64, vol = Stable); register_fun_stub!( udf, "txid_current_if_assigned", diff --git a/rust/cubesql/cubesql/src/compile/parser.rs b/rust/cubesql/cubesql/src/compile/parser.rs index 6b4e1ccc4c097..32b0ff8e2e67f 100644 --- a/rust/cubesql/cubesql/src/compile/parser.rs +++ b/rust/cubesql/cubesql/src/compile/parser.rs @@ -242,6 +242,9 @@ pub fn parse_sql_to_statements( .to_string() }; + // DataGrip CTID workaround + let query = query.replace("SELECT t.*, CTID\nFROM ", "SELECT t.*, NULL AS ctid\nFROM "); + if let Some(qtrace) = qtrace { qtrace.set_replaced_query(&query) } diff --git a/rust/cubesql/cubesql/src/compile/query_engine.rs b/rust/cubesql/cubesql/src/compile/query_engine.rs index a9ff013c3dce2..fee95d644b756 100644 --- a/rust/cubesql/cubesql/src/compile/query_engine.rs +++ b/rust/cubesql/cubesql/src/compile/query_engine.rs @@ -518,6 +518,10 @@ impl QueryEngine for SqlQueryEngine { ctx.register_udf(create_age_udf()); ctx.register_udf(create_pg_get_partkeydef_udf()); ctx.register_udf(create_pg_relation_size_udf()); + ctx.register_udf(create_pg_postmaster_start_time_udf()); + ctx.register_udf(create_txid_current_udf()); + ctx.register_udf(create_pg_is_in_recovery_udf()); + ctx.register_udf(create_pg_tablespace_location_udf()); // udaf ctx.register_udaf(create_measure_udaf()); diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgam_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgam_postgres.snap index 4c143074c3fcf..2c2cf40368da1 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgam_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgam_postgres.snap @@ -1,9 +1,8 @@ --- source: cubesql/src/compile/mod.rs -assertion_line: 5296 -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_am\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_am\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-----+--------+-----------+--------+ -| oid | amname | amhandler | amtype | -+-----+--------+-----------+--------+ -+-----+--------+-----------+--------+ ++-----+--------+-----------+--------+------+ +| oid | amname | amhandler | amtype | xmin | ++-----+--------+-----------+--------+------+ ++-----+--------+-----------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgattribute_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgattribute_postgres.snap index df0aceb304c20..b3b845f986339 100644 Binary files a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgattribute_postgres.snap and b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgattribute_postgres.snap differ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgclass_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgclass_postgres.snap index e49f5cee79a95..21e255cbb5107 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgclass_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgclass_postgres.snap @@ -2,13 +2,13 @@ source: cubesql/src/compile/mod.rs expression: "execute_query(\"SELECT * FROM pg_catalog.pg_class\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+ -| oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasrules | relhastriggers | relhassubclass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relrewrite | relfrozenxid | relminmxid | relacl | reloptions | relpartbound | relhasoids | -+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+ -| 1259 | pg_class | 11 | 83 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 34 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -| 18000 | KibanaSampleDataEcommerce | 2200 | 18001 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 17 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -| 18020 | Logs | 2200 | 18021 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 7 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -| 18030 | NumberCube | 2200 | 18031 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 3 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -| 18036 | WideCube | 2200 | 18037 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 207 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -| 18246 | MultiTypeCube | 2200 | 18247 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 67 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | -+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+ ++-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+ +| oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasrules | relhastriggers | relhassubclass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relrewrite | relfrozenxid | relminmxid | relacl | reloptions | relpartbound | xmin | relhasoids | ++-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+ +| 1259 | pg_class | 11 | 83 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 34 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | +| 18000 | KibanaSampleDataEcommerce | 2200 | 18001 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 17 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | +| 18020 | Logs | 2200 | 18021 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 7 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | +| 18030 | NumberCube | 2200 | 18031 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 3 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | +| 18036 | WideCube | 2200 | 18037 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 207 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | +| 18246 | MultiTypeCube | 2200 | 18247 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 67 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | ++-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgconstraint_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgconstraint_postgres.snap index dfc5e793a216f..2e1a7b8790204 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgconstraint_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgconstraint_postgres.snap @@ -1,8 +1,8 @@ --- source: cubesql/src/compile/mod.rs -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_constraint\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_constraint\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+ -| oid | conname | connamespace | contype | condeferrable | condeferred | convalidated | conrelid | contypid | conindid | conparentid | confrelid | confupdtype | confdeltype | confmatchtype | conislocal | coninhcount | connoinherit | conkey | confkey | conpfeqop | conppeqop | conffeqop | conexclop | conbin | -+-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+ -+-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+ ++-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+------+ +| oid | conname | connamespace | contype | condeferrable | condeferred | convalidated | conrelid | contypid | conindid | conparentid | confrelid | confupdtype | confdeltype | confmatchtype | conislocal | coninhcount | connoinherit | conkey | confkey | conpfeqop | conppeqop | conffeqop | conexclop | conbin | xmin | ++-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+------+ ++-----+---------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+-----------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgdescription_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgdescription_postgres.snap index 8701368a7b634..1ef79fbeb7b4f 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgdescription_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgdescription_postgres.snap @@ -2,87 +2,87 @@ source: cubesql/src/compile/mod.rs expression: "execute_query(\"SELECT * FROM pg_catalog.pg_description\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+--------+----------+----------+-------------------------------------------------------+ -| objoid | classoid | objsubid | description | -+--------+----------+----------+-------------------------------------------------------+ -| 18000 | 1259 | 0 | Sample data for tracking eCommerce orders from Kibana | -| 18000 | 1259 | 1 | Events count | -| 18000 | 1259 | 10 | Customer gender | -| 18000 | 1259 | 14 | Male users segment | -| 18000 | 1259 | 16 | Virtual column for security context switching | -| 18000 | 1259 | 17 | Virtual column for joining cubes | -| 18020 | 1259 | 6 | Virtual column for security context switching | -| 18020 | 1259 | 7 | Virtual column for joining cubes | -| 18030 | 1259 | 2 | Virtual column for security context switching | -| 18030 | 1259 | 3 | Virtual column for joining cubes | -| 18036 | 1259 | 206 | Virtual column for security context switching | -| 18036 | 1259 | 207 | Virtual column for joining cubes | -| 18246 | 1259 | 0 | Test cube with a little bit of everything | -| 18246 | 1259 | 1 | Test number measure 0 | -| 18246 | 1259 | 2 | Test max(string) measure 0 | -| 18246 | 1259 | 3 | Test max(time) measure 0 | -| 18246 | 1259 | 4 | Test number measure 1 | -| 18246 | 1259 | 5 | Test max(string) measure 1 | -| 18246 | 1259 | 6 | Test max(time) measure 1 | -| 18246 | 1259 | 7 | Test number measure 2 | -| 18246 | 1259 | 8 | Test max(string) measure 2 | -| 18246 | 1259 | 9 | Test max(time) measure 2 | -| 18246 | 1259 | 10 | Test number measure 3 | -| 18246 | 1259 | 11 | Test max(string) measure 3 | -| 18246 | 1259 | 12 | Test max(time) measure 3 | -| 18246 | 1259 | 13 | Test number measure 4 | -| 18246 | 1259 | 14 | Test max(string) measure 4 | -| 18246 | 1259 | 15 | Test max(time) measure 4 | -| 18246 | 1259 | 16 | Test number measure 5 | -| 18246 | 1259 | 17 | Test max(string) measure 5 | -| 18246 | 1259 | 18 | Test max(time) measure 5 | -| 18246 | 1259 | 19 | Test number measure 6 | -| 18246 | 1259 | 20 | Test max(string) measure 6 | -| 18246 | 1259 | 21 | Test max(time) measure 6 | -| 18246 | 1259 | 22 | Test number measure 7 | -| 18246 | 1259 | 23 | Test max(string) measure 7 | -| 18246 | 1259 | 24 | Test max(time) measure 7 | -| 18246 | 1259 | 25 | Test number measure 8 | -| 18246 | 1259 | 26 | Test max(string) measure 8 | -| 18246 | 1259 | 27 | Test max(time) measure 8 | -| 18246 | 1259 | 28 | Test number measure 9 | -| 18246 | 1259 | 29 | Test max(string) measure 9 | -| 18246 | 1259 | 30 | Test max(time) measure 9 | -| 18246 | 1259 | 31 | Test count measure | -| 18246 | 1259 | 32 | Test maxPrice measure | -| 18246 | 1259 | 33 | Test minPrice measure | -| 18246 | 1259 | 34 | Test avgPrice measure | -| 18246 | 1259 | 35 | Test countDistinct measure | -| 18246 | 1259 | 36 | Test numeric dimention 0 | -| 18246 | 1259 | 37 | Test string dimention 0 | -| 18246 | 1259 | 38 | Test time dimention 0 | -| 18246 | 1259 | 39 | Test numeric dimention 1 | -| 18246 | 1259 | 40 | Test string dimention 1 | -| 18246 | 1259 | 41 | Test time dimention 1 | -| 18246 | 1259 | 42 | Test numeric dimention 2 | -| 18246 | 1259 | 43 | Test string dimention 2 | -| 18246 | 1259 | 44 | Test time dimention 2 | -| 18246 | 1259 | 45 | Test numeric dimention 3 | -| 18246 | 1259 | 46 | Test string dimention 3 | -| 18246 | 1259 | 47 | Test time dimention 3 | -| 18246 | 1259 | 48 | Test numeric dimention 4 | -| 18246 | 1259 | 49 | Test string dimention 4 | -| 18246 | 1259 | 50 | Test time dimention 4 | -| 18246 | 1259 | 51 | Test numeric dimention 5 | -| 18246 | 1259 | 52 | Test string dimention 5 | -| 18246 | 1259 | 53 | Test time dimention 5 | -| 18246 | 1259 | 54 | Test numeric dimention 6 | -| 18246 | 1259 | 55 | Test string dimention 6 | -| 18246 | 1259 | 56 | Test time dimention 6 | -| 18246 | 1259 | 57 | Test numeric dimention 7 | -| 18246 | 1259 | 58 | Test string dimention 7 | -| 18246 | 1259 | 59 | Test time dimention 7 | -| 18246 | 1259 | 60 | Test numeric dimention 8 | -| 18246 | 1259 | 61 | Test string dimention 8 | -| 18246 | 1259 | 62 | Test time dimention 8 | -| 18246 | 1259 | 63 | Test numeric dimention 9 | -| 18246 | 1259 | 64 | Test string dimention 9 | -| 18246 | 1259 | 65 | Test time dimention 9 | -| 18246 | 1259 | 66 | Virtual column for security context switching | -| 18246 | 1259 | 67 | Virtual column for joining cubes | -+--------+----------+----------+-------------------------------------------------------+ ++--------+----------+----------+-------------------------------------------------------+------+ +| objoid | classoid | objsubid | description | xmin | ++--------+----------+----------+-------------------------------------------------------+------+ +| 18000 | 1259 | 0 | Sample data for tracking eCommerce orders from Kibana | 1 | +| 18000 | 1259 | 1 | Events count | 1 | +| 18000 | 1259 | 10 | Customer gender | 1 | +| 18000 | 1259 | 14 | Male users segment | 1 | +| 18000 | 1259 | 16 | Virtual column for security context switching | 1 | +| 18000 | 1259 | 17 | Virtual column for joining cubes | 1 | +| 18020 | 1259 | 6 | Virtual column for security context switching | 1 | +| 18020 | 1259 | 7 | Virtual column for joining cubes | 1 | +| 18030 | 1259 | 2 | Virtual column for security context switching | 1 | +| 18030 | 1259 | 3 | Virtual column for joining cubes | 1 | +| 18036 | 1259 | 206 | Virtual column for security context switching | 1 | +| 18036 | 1259 | 207 | Virtual column for joining cubes | 1 | +| 18246 | 1259 | 0 | Test cube with a little bit of everything | 1 | +| 18246 | 1259 | 1 | Test number measure 0 | 1 | +| 18246 | 1259 | 2 | Test max(string) measure 0 | 1 | +| 18246 | 1259 | 3 | Test max(time) measure 0 | 1 | +| 18246 | 1259 | 4 | Test number measure 1 | 1 | +| 18246 | 1259 | 5 | Test max(string) measure 1 | 1 | +| 18246 | 1259 | 6 | Test max(time) measure 1 | 1 | +| 18246 | 1259 | 7 | Test number measure 2 | 1 | +| 18246 | 1259 | 8 | Test max(string) measure 2 | 1 | +| 18246 | 1259 | 9 | Test max(time) measure 2 | 1 | +| 18246 | 1259 | 10 | Test number measure 3 | 1 | +| 18246 | 1259 | 11 | Test max(string) measure 3 | 1 | +| 18246 | 1259 | 12 | Test max(time) measure 3 | 1 | +| 18246 | 1259 | 13 | Test number measure 4 | 1 | +| 18246 | 1259 | 14 | Test max(string) measure 4 | 1 | +| 18246 | 1259 | 15 | Test max(time) measure 4 | 1 | +| 18246 | 1259 | 16 | Test number measure 5 | 1 | +| 18246 | 1259 | 17 | Test max(string) measure 5 | 1 | +| 18246 | 1259 | 18 | Test max(time) measure 5 | 1 | +| 18246 | 1259 | 19 | Test number measure 6 | 1 | +| 18246 | 1259 | 20 | Test max(string) measure 6 | 1 | +| 18246 | 1259 | 21 | Test max(time) measure 6 | 1 | +| 18246 | 1259 | 22 | Test number measure 7 | 1 | +| 18246 | 1259 | 23 | Test max(string) measure 7 | 1 | +| 18246 | 1259 | 24 | Test max(time) measure 7 | 1 | +| 18246 | 1259 | 25 | Test number measure 8 | 1 | +| 18246 | 1259 | 26 | Test max(string) measure 8 | 1 | +| 18246 | 1259 | 27 | Test max(time) measure 8 | 1 | +| 18246 | 1259 | 28 | Test number measure 9 | 1 | +| 18246 | 1259 | 29 | Test max(string) measure 9 | 1 | +| 18246 | 1259 | 30 | Test max(time) measure 9 | 1 | +| 18246 | 1259 | 31 | Test count measure | 1 | +| 18246 | 1259 | 32 | Test maxPrice measure | 1 | +| 18246 | 1259 | 33 | Test minPrice measure | 1 | +| 18246 | 1259 | 34 | Test avgPrice measure | 1 | +| 18246 | 1259 | 35 | Test countDistinct measure | 1 | +| 18246 | 1259 | 36 | Test numeric dimention 0 | 1 | +| 18246 | 1259 | 37 | Test string dimention 0 | 1 | +| 18246 | 1259 | 38 | Test time dimention 0 | 1 | +| 18246 | 1259 | 39 | Test numeric dimention 1 | 1 | +| 18246 | 1259 | 40 | Test string dimention 1 | 1 | +| 18246 | 1259 | 41 | Test time dimention 1 | 1 | +| 18246 | 1259 | 42 | Test numeric dimention 2 | 1 | +| 18246 | 1259 | 43 | Test string dimention 2 | 1 | +| 18246 | 1259 | 44 | Test time dimention 2 | 1 | +| 18246 | 1259 | 45 | Test numeric dimention 3 | 1 | +| 18246 | 1259 | 46 | Test string dimention 3 | 1 | +| 18246 | 1259 | 47 | Test time dimention 3 | 1 | +| 18246 | 1259 | 48 | Test numeric dimention 4 | 1 | +| 18246 | 1259 | 49 | Test string dimention 4 | 1 | +| 18246 | 1259 | 50 | Test time dimention 4 | 1 | +| 18246 | 1259 | 51 | Test numeric dimention 5 | 1 | +| 18246 | 1259 | 52 | Test string dimention 5 | 1 | +| 18246 | 1259 | 53 | Test time dimention 5 | 1 | +| 18246 | 1259 | 54 | Test numeric dimention 6 | 1 | +| 18246 | 1259 | 55 | Test string dimention 6 | 1 | +| 18246 | 1259 | 56 | Test time dimention 6 | 1 | +| 18246 | 1259 | 57 | Test numeric dimention 7 | 1 | +| 18246 | 1259 | 58 | Test string dimention 7 | 1 | +| 18246 | 1259 | 59 | Test time dimention 7 | 1 | +| 18246 | 1259 | 60 | Test numeric dimention 8 | 1 | +| 18246 | 1259 | 61 | Test string dimention 8 | 1 | +| 18246 | 1259 | 62 | Test time dimention 8 | 1 | +| 18246 | 1259 | 63 | Test numeric dimention 9 | 1 | +| 18246 | 1259 | 64 | Test string dimention 9 | 1 | +| 18246 | 1259 | 65 | Test time dimention 9 | 1 | +| 18246 | 1259 | 66 | Virtual column for security context switching | 1 | +| 18246 | 1259 | 67 | Virtual column for joining cubes | 1 | ++--------+----------+----------+-------------------------------------------------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgextension_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgextension_postgres.snap index ad573a8758d1b..5b62a550c88a4 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgextension_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgextension_postgres.snap @@ -1,8 +1,8 @@ --- source: cubesql/src/compile/mod.rs -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_extension\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_extension\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-----+---------+----------+--------------+----------------+------------+-----------+--------------+ -| oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition | -+-----+---------+----------+--------------+----------------+------------+-----------+--------------+ -+-----+---------+----------+--------------+----------------+------------+-----------+--------------+ ++-----+---------+----------+--------------+----------------+------------+-----------+--------------+------+ +| oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition | xmin | ++-----+---------+----------+--------------+----------------+------------+-----------+--------------+------+ ++-----+---------+----------+--------------+----------------+------------+-----------+--------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgindex_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgindex_postgres.snap index cd741baea3d83..3c7df46f4bcbf 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgindex_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgindex_postgres.snap @@ -1,8 +1,8 @@ --- source: cubesql/src/compile/mod.rs -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_index\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_index\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+ -| indexrelid | indrelid | indnatts | indnkeyatts | indisunique | indisprimary | indisexclusion | indimmediate | indisclustered | indisvalid | indcheckxmin | indisready | indislive | indisreplident | indkey | indcollation | indclass | indoption | indexprs | indpred | -+------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+ -+------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+ ++------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+------+ +| indexrelid | indrelid | indnatts | indnkeyatts | indisunique | indisprimary | indisexclusion | indimmediate | indisclustered | indisvalid | indcheckxmin | indisready | indislive | indisreplident | indkey | indcollation | indclass | indoption | indexprs | indpred | xmin | ++------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+------+ ++------------+----------+----------+-------------+-------------+--------------+----------------+--------------+----------------+------------+--------------+------------+-----------+----------------+--------+--------------+----------+-----------+----------+---------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgnamespace_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgnamespace_postgres.snap index 1b009fb2be487..57ec935029e98 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgnamespace_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgnamespace_postgres.snap @@ -1,13 +1,11 @@ --- source: cubesql/src/compile/mod.rs -assertion_line: 4840 -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_namespace\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" - +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_namespace\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+--------------------+----------+------------------------+ -| oid | nspname | nspowner | nspacl | -+-------+--------------------+----------+------------------------+ -| 11 | pg_catalog | 10 | {test=UC/test,=U/test} | -| 2200 | public | 10 | {test=UC/test,=U/test} | -| 13000 | information_schema | 10 | {test=UC/test,=U/test} | -+-------+--------------------+----------+------------------------+ ++-------+--------------------+----------+--------+------+ +| oid | nspname | nspowner | nspacl | xmin | ++-------+--------------------+----------+--------+------+ +| 11 | pg_catalog | 10 | NULL | 1 | +| 2200 | public | 10 | NULL | 1 | +| 13000 | information_schema | 10 | NULL | 1 | ++-------+--------------------+----------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgproc_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgproc_postgres.snap index fabb29b366e3f..bf03e2e83b5e7 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgproc_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgproc_postgres.snap @@ -1,55 +1,54 @@ --- source: cubesql/src/compile/mod.rs -assertion_line: 6227 -expression: "execute_query(\"SELECT * FROM pg_catalog.pg_proc\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"SELECT * FROM pg_catalog.pg_proc\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+ -| oid | proname | pronamespace | proowner | prolang | procost | prorows | provariadic | prosupport | prokind | prosecdef | proleakproof | proisstrict | proretset | provolatile | proparallel | pronargs | pronargdefaults | prorettype | proargtypes | proallargtypes | proargmodes | proargnames | proargdefaults | protrftypes | prosrc | probin | prosqlbody | proconfig | proacl | -+------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+ -| 89 | version | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 0 | 0 | 25 | | | | | NULL | NULL | pgsql_version | NULL | NULL | NULL | NULL | -| 1191 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 3 | 0 | 23 | | | | | NULL | NULL | generate_subscripts | NULL | NULL | NULL | NULL | -| 1191 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 3 | 0 | 23 | | | | | NULL | NULL | generate_subscripts | NULL | NULL | NULL | NULL | -| 1192 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 2 | 0 | 23 | | | | | NULL | NULL | generate_subscripts_nodir | NULL | NULL | NULL | NULL | -| 2331 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 2283 | | | | | NULL | NULL | array_unnest | NULL | NULL | NULL | NULL | -| 1081 | format_type | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | false | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | format_type | NULL | NULL | NULL | NULL | -| 1402 | current_schema | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | u | 0 | 0 | 19 | | | | | NULL | NULL | current_schema | NULL | NULL | NULL | NULL | -| 1387 | pg_get_constraintdef | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 25 | | | | | NULL | NULL | pg_get_constraintdef | NULL | NULL | NULL | NULL | -| 1716 | pg_get_expr | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | pg_get_expr | NULL | NULL | NULL | NULL | -| 2080 | pg_type_is_visible | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 16 | | | | | NULL | NULL | pg_type_is_visible | NULL | NULL | NULL | NULL | -| 2115 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 20 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2116 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 23 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2117 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 21 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2118 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 26 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2119 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 700 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2120 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 701 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2122 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1082 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2123 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1083 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2124 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1266 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2125 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 790 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2126 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1114 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2127 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1184 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2129 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 25 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2130 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1700 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2150 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 2277 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2244 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1042 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2797 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 27 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 3564 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 869 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 4189 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 3220 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 3526 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 3500 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | -| 2508 | pg_get_constraintdef | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | pg_get_constraintdef_ext | NULL | NULL | NULL | NULL | -| 2509 | pg_get_expr | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 25 | | | | | NULL | NULL | pg_get_expr_ext | NULL | NULL | NULL | NULL | -| 3322 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 2249 | | | | | NULL | NULL | tsvector_unnest | NULL | NULL | NULL | NULL | -| 1293 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 3831 | | | | | NULL | NULL | multirange_unnest | NULL | NULL | NULL | NULL | -| 2400 | array_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 2277 | 2281 26 23 | | | | NULL | NULL | array_recv | NULL | NULL | NULL | NULL | -| 2404 | int2recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 21 | 2281 | | | | NULL | NULL | int2recv | NULL | NULL | NULL | NULL | -| 2406 | int4recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 23 | 2281 | | | | NULL | NULL | int4recv | NULL | NULL | NULL | NULL | -| 2408 | int8recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 20 | 2281 | | | | NULL | NULL | int8recv | NULL | NULL | NULL | NULL | -| 2414 | textrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 25 | 2281 | | | | NULL | NULL | textrecv | NULL | NULL | NULL | NULL | -| 2424 | float4recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 700 | 2281 | | | | NULL | NULL | float4recv | NULL | NULL | NULL | NULL | -| 2426 | float8recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 701 | 2281 | | | | NULL | NULL | float8recv | NULL | NULL | NULL | NULL | -| 2432 | varcharrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 1043 | 2281 26 23 | | | | NULL | NULL | varcharrecv | NULL | NULL | NULL | NULL | -| 2460 | numeric_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 3 | 0 | 1700 | 2281 26 23 | | | | NULL | NULL | numeric_recv | NULL | NULL | NULL | NULL | -| 2474 | timestamp_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 3 | 0 | 1114 | 2281 26 23 | | | | NULL | NULL | timestamp_recv | NULL | NULL | NULL | NULL | -| 2436 | boolrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 16 | 2281 | | | | NULL | NULL | boolrecv | NULL | NULL | NULL | NULL | -| 2420 | oidvectorrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 30 | 2281 | | | | NULL | NULL | oidvectorrecv | NULL | NULL | NULL | NULL | -+------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+ ++------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+------+ +| oid | proname | pronamespace | proowner | prolang | procost | prorows | provariadic | prosupport | prokind | prosecdef | proleakproof | proisstrict | proretset | provolatile | proparallel | pronargs | pronargdefaults | prorettype | proargtypes | proallargtypes | proargmodes | proargnames | proargdefaults | protrftypes | prosrc | probin | prosqlbody | proconfig | proacl | xmin | ++------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+------+ +| 89 | version | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 0 | 0 | 25 | | | | | NULL | NULL | pgsql_version | NULL | NULL | NULL | NULL | 1 | +| 1191 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 3 | 0 | 23 | | | | | NULL | NULL | generate_subscripts | NULL | NULL | NULL | NULL | 1 | +| 1191 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 3 | 0 | 23 | | | | | NULL | NULL | generate_subscripts | NULL | NULL | NULL | NULL | 1 | +| 1192 | generate_subscripts | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 2 | 0 | 23 | | | | | NULL | NULL | generate_subscripts_nodir | NULL | NULL | NULL | NULL | 1 | +| 2331 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 2283 | | | | | NULL | NULL | array_unnest | NULL | NULL | NULL | NULL | 1 | +| 1081 | format_type | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | false | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | format_type | NULL | NULL | NULL | NULL | 1 | +| 1402 | current_schema | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | u | 0 | 0 | 19 | | | | | NULL | NULL | current_schema | NULL | NULL | NULL | NULL | 1 | +| 1387 | pg_get_constraintdef | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 25 | | | | | NULL | NULL | pg_get_constraintdef | NULL | NULL | NULL | NULL | 1 | +| 1716 | pg_get_expr | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | pg_get_expr | NULL | NULL | NULL | NULL | 1 | +| 2080 | pg_type_is_visible | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 16 | | | | | NULL | NULL | pg_type_is_visible | NULL | NULL | NULL | NULL | 1 | +| 2115 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 20 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2116 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 23 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2117 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 21 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2118 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 26 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2119 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 700 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2120 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 701 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2122 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1082 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2123 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1083 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2124 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1266 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2125 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 790 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2126 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1114 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2127 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1184 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2129 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 25 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2130 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1700 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2150 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 2277 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2244 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 1042 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2797 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 27 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 3564 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 869 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 4189 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 3220 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 3526 | max | 11 | 10 | 12 | 1 | 0 | 0 | - | a | false | false | false | false | i | s | 1 | 0 | 3500 | | | | | NULL | NULL | aggregate_dummy | NULL | NULL | NULL | NULL | 1 | +| 2508 | pg_get_constraintdef | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 2 | 0 | 25 | | | | | NULL | NULL | pg_get_constraintdef_ext | NULL | NULL | NULL | NULL | 1 | +| 2509 | pg_get_expr | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 25 | | | | | NULL | NULL | pg_get_expr_ext | NULL | NULL | NULL | NULL | 1 | +| 3322 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 2249 | | | | | NULL | NULL | tsvector_unnest | NULL | NULL | NULL | NULL | 1 | +| 1293 | unnest | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | true | i | s | 1 | 0 | 3831 | | | | | NULL | NULL | multirange_unnest | NULL | NULL | NULL | NULL | 1 | +| 2400 | array_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 2277 | 2281 26 23 | | | | NULL | NULL | array_recv | NULL | NULL | NULL | NULL | 1 | +| 2404 | int2recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 21 | 2281 | | | | NULL | NULL | int2recv | NULL | NULL | NULL | NULL | 1 | +| 2406 | int4recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 23 | 2281 | | | | NULL | NULL | int4recv | NULL | NULL | NULL | NULL | 1 | +| 2408 | int8recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 20 | 2281 | | | | NULL | NULL | int8recv | NULL | NULL | NULL | NULL | 1 | +| 2414 | textrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 25 | 2281 | | | | NULL | NULL | textrecv | NULL | NULL | NULL | NULL | 1 | +| 2424 | float4recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 700 | 2281 | | | | NULL | NULL | float4recv | NULL | NULL | NULL | NULL | 1 | +| 2426 | float8recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 701 | 2281 | | | | NULL | NULL | float8recv | NULL | NULL | NULL | NULL | 1 | +| 2432 | varcharrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 3 | 0 | 1043 | 2281 26 23 | | | | NULL | NULL | varcharrecv | NULL | NULL | NULL | NULL | 1 | +| 2460 | numeric_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 3 | 0 | 1700 | 2281 26 23 | | | | NULL | NULL | numeric_recv | NULL | NULL | NULL | NULL | 1 | +| 2474 | timestamp_recv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 3 | 0 | 1114 | 2281 26 23 | | | | NULL | NULL | timestamp_recv | NULL | NULL | NULL | NULL | 1 | +| 2436 | boolrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | s | s | 1 | 0 | 16 | 2281 | | | | NULL | NULL | boolrecv | NULL | NULL | NULL | NULL | 1 | +| 2420 | oidvectorrecv | 11 | 10 | 12 | 1 | 0 | 0 | - | f | false | false | true | false | i | s | 1 | 0 | 30 | 2281 | | | | NULL | NULL | oidvectorrecv | NULL | NULL | NULL | NULL | 1 | ++------+----------------------+--------------+----------+---------+---------+---------+-------------+------------+---------+-----------+--------------+-------------+-----------+-------------+-------------+----------+-----------------+------------+-------------+----------------+-------------+-------------+----------------+-------------+---------------------------+--------+------------+-----------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgtype_postgres.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgtype_postgres.snap index 15f6c2da4cae8..e01d1f51f1af3 100644 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgtype_postgres.snap +++ b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pgcatalog_pgtype_postgres.snap @@ -2,101 +2,115 @@ source: cubesql/src/compile/mod.rs expression: "execute_query(\"SELECT * FROM pg_catalog.pg_type ORDER BY oid ASC\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+ -| oid | typname | typnamespace | typowner | typlen | typbyval | typtype | typcategory | typisprefered | typisdefined | typdelim | typrelid | typsubscript | typelem | typarray | typinput | typoutput | typreceive | typsend | typmodin | typmodout | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typcollation | typdefaultbin | typdefault | typacl | -+-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+ -| 16 | bool | 11 | 10 | 1 | true | b | B | true | true | , | 0 | - | 0 | 1000 | boolin | NULL | 2436 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 17 | bytea | 11 | 10 | -1 | false | b | U | false | true | , | 0 | - | 0 | 1001 | byteain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 19 | name | 11 | 10 | 64 | false | b | S | false | true | , | 0 | raw_array_subscript_handler | 0 | 1003 | namein | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 20 | int8 | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 1016 | int8in | NULL | 2408 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 21 | int2 | 11 | 10 | 2 | true | b | N | false | true | , | 0 | - | 0 | 1005 | int2in | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 23 | int4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1007 | int4in | NULL | 2406 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 25 | text | 11 | 10 | -1 | false | b | S | true | true | , | 0 | - | 0 | 1009 | textin | NULL | 2414 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 26 | oid | 11 | 10 | 4 | true | b | N | true | true | , | 0 | - | 0 | 1028 | oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 27 | tid | 11 | 10 | 6 | false | b | U | false | true | , | 0 | - | 0 | 1010 | tidin | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 83 | pg_class | 11 | 10 | -1 | false | c | C | false | true | , | 1259 | - | 0 | 273 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 273 | _pg_class | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 83 | 0 | _pg_classin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 700 | float4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1021 | float4in | NULL | 2424 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 701 | float8 | 11 | 10 | 8 | true | b | N | true | true | , | 0 | - | 0 | 1022 | float8in | NULL | 2426 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 790 | money | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 791 | cash_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 791 | _money | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 790 | 0 | _moneyin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 869 | inet | 11 | 10 | -1 | false | b | I | true | true | , | 0 | - | 0 | 1041 | inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1000 | _bool | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 16 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1001 | _bytea | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 17 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1003 | _name | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 19 | 0 | _namein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1005 | _int2 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 21 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1007 | _int4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 23 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1009 | _text | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 25 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1010 | _tid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 27 | 0 | _tidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1014 | _bpchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1042 | 0 | _bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1015 | _varchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1043 | 0 | _varcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1016 | _int8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 20 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1021 | _float4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 700 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1022 | _float8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 701 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1028 | _oid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 26 | 0 | _oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1033 | aclitem | 11 | 10 | 12 | false | b | U | false | true | , | 0 | - | 0 | 1034 | aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1034 | _aclitem | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1033 | 0 | _aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1041 | _inet | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 869 | 0 | _inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1042 | bpchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1014 | bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1043 | varchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1015 | varcharin | NULL | 2432 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1082 | date | 11 | 10 | 4 | true | b | D | false | true | , | 0 | - | 0 | 1182 | date_in | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1083 | time | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1183 | time_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1114 | timestamp | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1115 | timestamp_in | NULL | 2474 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1115 | _timestamp | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1114 | 0 | _timestampin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1182 | _date | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1082 | 0 | _datein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1183 | _time | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1083 | 0 | _timein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1184 | timestamptz | 11 | 10 | 8 | true | b | D | true | true | , | 0 | - | 0 | 1185 | timestamptz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1185 | _timestamptz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1184 | 0 | _timestamptzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1186 | interval | 11 | 10 | 16 | false | b | T | true | true | , | 0 | - | 0 | 1187 | intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1187 | _interval | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1186 | 0 | _intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1231 | _numeric | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1700 | 0 | _numericin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1266 | timetz | 11 | 10 | 12 | false | b | D | false | true | , | 0 | - | 0 | 1270 | timetz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1270 | _timetz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1266 | 0 | _timetzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 1700 | numeric | 11 | 10 | -1 | false | b | N | false | true | , | 0 | - | 0 | 1231 | numericin | NULL | 2460 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 2249 | record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 2287 | recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 2277 | anyarray | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyarrayin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 2283 | anyelement | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyelementin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 2287 | _record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | array_subscript_handler | 2249 | 0 | _recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3220 | pg_lsn | 11 | 10 | 8 | true | b | U | false | true | , | 0 | - | 0 | 3221 | pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3221 | _pg_lsn | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3220 | 0 | _pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3500 | anyenum | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyenumin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3831 | anyrange | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3904 | int4range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3905 | int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3905 | _int4range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3904 | 0 | _int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3906 | numrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3907 | numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3907 | _numrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3906 | 0 | _numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3908 | tsrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3909 | tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3909 | _tsrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3908 | 0 | _tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3910 | tstzrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3911 | tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3911 | _tstzrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3910 | 0 | _tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3912 | daterange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3913 | daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3913 | _daterange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3912 | 0 | _daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3926 | int8range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3927 | int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 3927 | _int8range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3926 | 0 | _int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 4451 | int4multirange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 6150 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 4532 | nummultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6151 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 4533 | tsmultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6152 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 4535 | datemultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6155 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 4536 | int8multirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6157 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 6150 | _int4multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4451 | 0 | _int4multirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 6151 | _nummultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4532 | 0 | _nummultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 6152 | _tsmultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4533 | 0 | _tsmultirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 6155 | _datemultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4535 | 0 | _datemultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 6157 | _int8multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4536 | 0 | _int8multirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 12002 | _pg_constraint | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 12003 | 0 | _pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 12003 | pg_constraint | 11 | 10 | -1 | false | c | C | false | true | , | 2606 | - | 0 | 12002 | pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 12046 | _pg_namespace | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 12047 | 0 | _pg_namespacein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 12047 | pg_namespace | 11 | 10 | -1 | false | c | C | false | true | , | 2615 | - | 0 | 12046 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 13408 | character_data | 13000 | 10 | -1 | false | d | S | false | true | , | 0 | - | 0 | 0 | character_datain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 1043 | -1 | NULL | NULL | NULL | NULL | NULL | -| 13410 | sql_identifier | 13000 | 10 | 64 | false | d | S | false | true | , | 0 | - | 0 | 0 | sql_identifierin | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 19 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18001 | KibanaSampleDataEcommerce | 2200 | 10 | -1 | false | c | C | false | true | , | 18000 | - | 0 | 18002 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18002 | _KibanaSampleDataEcommerce | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18001 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18021 | Logs | 2200 | 10 | -1 | false | c | C | false | true | , | 18020 | - | 0 | 18022 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18022 | _Logs | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18021 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18031 | NumberCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18030 | - | 0 | 18032 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18032 | _NumberCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18031 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18037 | WideCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18036 | - | 0 | 18038 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18038 | _WideCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18037 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18247 | MultiTypeCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18246 | - | 0 | 18248 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -| 18248 | _MultiTypeCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18247 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | -+-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+ ++-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+----------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+ +| oid | typname | typnamespace | typowner | typlen | typbyval | typtype | typcategory | typisprefered | typisdefined | typdelim | typrelid | typsubscript | typelem | typarray | typinput | typoutput | typreceive | typsend | typmodin | typmodout | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typcollation | typdefaultbin | typdefault | typacl | xmin | ++-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+----------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+ +| 16 | bool | 11 | 10 | 1 | true | b | B | true | true | , | 0 | - | 0 | 1000 | boolin | NULL | 2436 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 17 | bytea | 11 | 10 | -1 | false | b | U | false | true | , | 0 | - | 0 | 1001 | byteain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 19 | name | 11 | 10 | 64 | false | b | S | false | true | , | 0 | raw_array_subscript_handler | 0 | 1003 | namein | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 20 | int8 | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 1016 | int8in | NULL | 2408 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 21 | int2 | 11 | 10 | 2 | true | b | N | false | true | , | 0 | - | 0 | 1005 | int2in | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 23 | int4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1007 | int4in | NULL | 2406 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 25 | text | 11 | 10 | -1 | false | b | S | true | true | , | 0 | - | 0 | 1009 | textin | NULL | 2414 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 26 | oid | 11 | 10 | 4 | true | b | N | true | true | , | 0 | - | 0 | 1028 | oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 27 | tid | 11 | 10 | 6 | false | b | U | false | true | , | 0 | - | 0 | 1010 | tidin | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 83 | pg_class | 11 | 10 | -1 | false | c | C | false | true | , | 1259 | - | 0 | 273 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 273 | _pg_class | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 83 | 0 | _pg_classin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 700 | float4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1021 | float4in | NULL | 2424 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 701 | float8 | 11 | 10 | 8 | true | b | N | true | true | , | 0 | - | 0 | 1022 | float8in | NULL | 2426 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 790 | money | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 791 | cash_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 791 | _money | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 790 | 0 | _moneyin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 869 | inet | 11 | 10 | -1 | false | b | I | true | true | , | 0 | - | 0 | 1041 | inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1000 | _bool | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 16 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1001 | _bytea | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 17 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1003 | _name | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 19 | 0 | _namein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1005 | _int2 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 21 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1007 | _int4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 23 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1009 | _text | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 25 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1010 | _tid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 27 | 0 | _tidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1014 | _bpchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1042 | 0 | _bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1015 | _varchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1043 | 0 | _varcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1016 | _int8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 20 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1021 | _float4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 700 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1022 | _float8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 701 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1028 | _oid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 26 | 0 | _oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1033 | aclitem | 11 | 10 | 12 | false | b | U | false | true | , | 0 | - | 0 | 1034 | aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1034 | _aclitem | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1033 | 0 | _aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1041 | _inet | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 869 | 0 | _inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1042 | bpchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1014 | bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1043 | varchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1015 | varcharin | NULL | 2432 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1082 | date | 11 | 10 | 4 | true | b | D | false | true | , | 0 | - | 0 | 1182 | date_in | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1083 | time | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1183 | time_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1114 | timestamp | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1115 | timestamp_in | NULL | 2474 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1115 | _timestamp | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1114 | 0 | _timestampin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1182 | _date | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1082 | 0 | _datein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1183 | _time | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1083 | 0 | _timein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1184 | timestamptz | 11 | 10 | 8 | true | b | D | true | true | , | 0 | - | 0 | 1185 | timestamptz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1185 | _timestamptz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1184 | 0 | _timestamptzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1186 | interval | 11 | 10 | 16 | false | b | T | true | true | , | 0 | - | 0 | 1187 | intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1187 | _interval | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1186 | 0 | _intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1231 | _numeric | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1700 | 0 | _numericin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1266 | timetz | 11 | 10 | 12 | false | b | D | false | true | , | 0 | - | 0 | 1270 | timetz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1270 | _timetz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1266 | 0 | _timetzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 1700 | numeric | 11 | 10 | -1 | false | b | N | false | true | , | 0 | - | 0 | 1231 | numericin | NULL | 2460 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 2249 | record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 2287 | recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 2277 | anyarray | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyarrayin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 2283 | anyelement | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyelementin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 2287 | _record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | array_subscript_handler | 2249 | 0 | _recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3220 | pg_lsn | 11 | 10 | 8 | true | b | U | false | true | , | 0 | - | 0 | 3221 | pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3221 | _pg_lsn | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3220 | 0 | _pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3500 | anyenum | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyenumin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3831 | anyrange | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3904 | int4range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3905 | int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3905 | _int4range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3904 | 0 | _int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3906 | numrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3907 | numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3907 | _numrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3906 | 0 | _numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3908 | tsrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3909 | tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3909 | _tsrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3908 | 0 | _tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3910 | tstzrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3911 | tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3911 | _tstzrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3910 | 0 | _tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3912 | daterange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3913 | daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3913 | _daterange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3912 | 0 | _daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3926 | int8range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3927 | int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 3927 | _int8range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3926 | 0 | _int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 4451 | int4multirange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 6150 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 4532 | nummultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6151 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 4533 | tsmultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6152 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 4535 | datemultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6155 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 4536 | int8multirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6157 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 6150 | _int4multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4451 | 0 | _int4multirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 6151 | _nummultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4532 | 0 | _nummultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 6152 | _tsmultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4533 | 0 | _tsmultirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 6155 | _datemultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4535 | 0 | _datemultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 6157 | _int8multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4536 | 0 | _int8multirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10014 | _pg_am | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10015 | 0 | _pg_amin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10015 | pg_am | 11 | 10 | -1 | false | c | C | false | true | , | 2601 | - | 0 | 10014 | pg_amin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10020 | _pg_language | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10021 | 0 | _pg_languagein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10021 | pg_language | 11 | 10 | -1 | false | c | C | false | true | , | 2612 | - | 0 | 10020 | pg_languagein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10038 | _pg_event_trigger | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10039 | 0 | _pg_event_triggerin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10039 | pg_event_trigger | 11 | 10 | -1 | false | c | C | false | true | , | 3466 | - | 0 | 10038 | pg_event_triggerin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10042 | _pg_cast | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10043 | 0 | _pg_castin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10043 | pg_cast | 11 | 10 | -1 | false | c | C | false | true | , | 2605 | - | 0 | 10042 | pg_castin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10073 | _pg_extension | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10074 | 0 | _pg_extensionin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10074 | pg_extension | 11 | 10 | -1 | false | c | C | false | true | , | 3079 | - | 0 | 10073 | pg_extensionin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10075 | _pg_foreign_data_wrapper | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10076 | 0 | _pg_foreign_data_wrapperin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10076 | pg_foreign_data_wrapper | 11 | 10 | -1 | false | c | C | false | true | , | 2328 | - | 0 | 10075 | pg_foreign_data_wrapperin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10077 | _pg_foreign_server | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 10078 | 0 | _pg_foreign_serverin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 10078 | pg_foreign_server | 11 | 10 | -1 | false | c | C | false | true | , | 1417 | - | 0 | 10077 | pg_foreign_serverin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 12002 | _pg_constraint | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 12003 | 0 | _pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 12003 | pg_constraint | 11 | 10 | -1 | false | c | C | false | true | , | 2606 | - | 0 | 12002 | pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 12046 | _pg_namespace | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 12047 | 0 | _pg_namespacein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 12047 | pg_namespace | 11 | 10 | -1 | false | c | C | false | true | , | 2615 | - | 0 | 12046 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 13408 | character_data | 13000 | 10 | -1 | false | d | S | false | true | , | 0 | - | 0 | 0 | character_datain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 1043 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 13410 | sql_identifier | 13000 | 10 | 64 | false | d | S | false | true | , | 0 | - | 0 | 0 | sql_identifierin | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 19 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18001 | KibanaSampleDataEcommerce | 2200 | 10 | -1 | false | c | C | false | true | , | 18000 | - | 0 | 18002 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18002 | _KibanaSampleDataEcommerce | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18001 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18021 | Logs | 2200 | 10 | -1 | false | c | C | false | true | , | 18020 | - | 0 | 18022 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18022 | _Logs | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18021 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18031 | NumberCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18030 | - | 0 | 18032 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18032 | _NumberCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18031 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18037 | WideCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18036 | - | 0 | 18038 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18038 | _WideCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18037 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18247 | MultiTypeCube | 2200 | 10 | -1 | false | c | C | false | true | , | 18246 | - | 0 | 18248 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | +| 18248 | _MultiTypeCube | 2200 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 18247 | 0 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | ++-------+----------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+----------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_columns.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_columns.snap index 4148f0d56245f..e144628d548a9 100644 Binary files a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_columns.snap and b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_columns.snap differ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_namespaces.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_namespaces.snap index bffad4c29d043..27ab049a0a774 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_namespaces.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_namespaces.snap @@ -2,10 +2,10 @@ source: cubesql/src/compile/test/test_introspection.rs expression: "execute_query(\"SELECT n.oid,n.*,d.description FROM pg_catalog.pg_namespace n\n LEFT OUTER JOIN pg_catalog.pg_description d ON d.objoid=n.oid AND d.objsubid=0 AND d.classoid='pg_namespace'::regclass\n ORDER BY nspname\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+-------+--------------------+----------+------------------------+-------------+ -| _oid | oid | nspname | nspowner | nspacl | description | -+-------+-------+--------------------+----------+------------------------+-------------+ -| 13000 | 13000 | information_schema | 10 | {test=UC/test,=U/test} | NULL | -| 11 | 11 | pg_catalog | 10 | {test=UC/test,=U/test} | NULL | -| 2200 | 2200 | public | 10 | {test=UC/test,=U/test} | NULL | -+-------+-------+--------------------+----------+------------------------+-------------+ ++-------+-------+--------------------+----------+--------+------+-------------+ +| _oid | oid | nspname | nspowner | nspacl | xmin | description | ++-------+-------+--------------------+----------+--------+------+-------------+ +| 13000 | 13000 | information_schema | 10 | NULL | 1 | NULL | +| 11 | 11 | pg_catalog | 10 | NULL | 1 | NULL | +| 2200 | 2200 | public | 10 | NULL | 1 | NULL | ++-------+-------+--------------------+----------+--------+------+-------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_tables_with_descriptions.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_tables_with_descriptions.snap index 6656934629127..290b8453ff5a5 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_tables_with_descriptions.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_tables_with_descriptions.snap @@ -2,12 +2,12 @@ source: cubesql/src/compile/test/test_introspection.rs expression: "execute_query(r#\"\n SELECT c.oid,c.*,d.description,pg_catalog.pg_get_expr(c.relpartbound, c.oid) as partition_expr, pg_catalog.pg_get_partkeydef(c.oid) as partition_key \n FROM pg_catalog.pg_class c\n LEFT OUTER JOIN pg_catalog.pg_description d ON d.objoid=c.oid AND d.objsubid=0 AND d.classoid='pg_class'::regclass\n WHERE c.relnamespace=2200 AND c.relkind not in ('i','I','c')\n ORDER BY c.oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+-------------------------------------------------------+----------------+---------------+ -| _oid | oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasrules | relhastriggers | relhassubclass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relrewrite | relfrozenxid | relminmxid | relacl | reloptions | relpartbound | relhasoids | description | partition_expr | partition_key | -+-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+-------------------------------------------------------+----------------+---------------+ -| 18000 | 18000 | KibanaSampleDataEcommerce | 2200 | 18001 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 17 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | Sample data for tracking eCommerce orders from Kibana | NULL | NULL | -| 18020 | 18020 | Logs | 2200 | 18021 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 7 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | NULL | NULL | NULL | -| 18030 | 18030 | NumberCube | 2200 | 18031 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 3 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | NULL | NULL | NULL | -| 18036 | 18036 | WideCube | 2200 | 18037 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 207 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | NULL | NULL | NULL | -| 18246 | 18246 | MultiTypeCube | 2200 | 18247 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 67 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | false | Test cube with a little bit of everything | NULL | NULL | -+-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------------+-------------------------------------------------------+----------------+---------------+ ++-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+-------------------------------------------------------+----------------+---------------+ +| _oid | oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasrules | relhastriggers | relhassubclass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relrewrite | relfrozenxid | relminmxid | relacl | reloptions | relpartbound | xmin | relhasoids | description | partition_expr | partition_key | ++-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+-------------------------------------------------------+----------------+---------------+ +| 18000 | 18000 | KibanaSampleDataEcommerce | 2200 | 18001 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 17 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | Sample data for tracking eCommerce orders from Kibana | NULL | NULL | +| 18020 | 18020 | Logs | 2200 | 18021 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 7 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | NULL | NULL | NULL | +| 18030 | 18030 | NumberCube | 2200 | 18031 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 3 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | NULL | NULL | NULL | +| 18036 | 18036 | WideCube | 2200 | 18037 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 207 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | NULL | NULL | NULL | +| 18246 | 18246 | MultiTypeCube | 2200 | 18247 | 0 | 10 | 2 | 0 | 0 | 0 | -1 | 0 | 0 | false | false | p | r | 67 | 0 | false | false | false | false | false | true | p | false | 0 | 0 | 1 | NULL | NULL | NULL | 1 | false | Test cube with a little bit of everything | NULL | NULL | ++-------+-------+---------------------------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+------------+--------------+------------+--------+------------+--------------+------+------------+-------------------------------------------------------+----------------+---------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_types.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_types.snap index f8780f2c652ec..7cecadd5fafff 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_types.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_types.snap @@ -2,87 +2,94 @@ source: cubesql/src/compile/test/test_introspection.rs expression: "execute_query(\"SELECT t.oid,t.*,c.relkind,format_type(nullif(t.typbasetype, 0), t.typtypmod) as base_type_name, d.description\n FROM pg_catalog.pg_type t\n LEFT OUTER JOIN pg_catalog.pg_type et ON et.oid=t.typelem\n LEFT OUTER JOIN pg_catalog.pg_class c ON c.oid=t.typrelid\n LEFT OUTER JOIN pg_catalog.pg_description d ON t.oid=d.objoid\n WHERE t.typname IS NOT NULL\n AND (c.relkind IS NULL OR c.relkind = 'c') AND (et.typcategory IS NULL OR et.typcategory <> 'C')\n ORDER BY t.oid ASC\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+-------+-------+-----------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+---------+-------------------+-------------+ -| _oid | oid | typname | typnamespace | typowner | typlen | typbyval | typtype | typcategory | typisprefered | typisdefined | typdelim | typrelid | typsubscript | typelem | typarray | typinput | typoutput | typreceive | typsend | typmodin | typmodout | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typcollation | typdefaultbin | typdefault | typacl | relkind | base_type_name | description | -+-------+-------+-----------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+---------+-------------------+-------------+ -| 16 | 16 | bool | 11 | 10 | 1 | true | b | B | true | true | , | 0 | - | 0 | 1000 | boolin | NULL | 2436 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 17 | 17 | bytea | 11 | 10 | -1 | false | b | U | false | true | , | 0 | - | 0 | 1001 | byteain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 19 | 19 | name | 11 | 10 | 64 | false | b | S | false | true | , | 0 | raw_array_subscript_handler | 0 | 1003 | namein | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 20 | 20 | int8 | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 1016 | int8in | NULL | 2408 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 21 | 21 | int2 | 11 | 10 | 2 | true | b | N | false | true | , | 0 | - | 0 | 1005 | int2in | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 23 | 23 | int4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1007 | int4in | NULL | 2406 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 25 | 25 | text | 11 | 10 | -1 | false | b | S | true | true | , | 0 | - | 0 | 1009 | textin | NULL | 2414 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 26 | 26 | oid | 11 | 10 | 4 | true | b | N | true | true | , | 0 | - | 0 | 1028 | oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 27 | 27 | tid | 11 | 10 | 6 | false | b | U | false | true | , | 0 | - | 0 | 1010 | tidin | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 700 | 700 | float4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1021 | float4in | NULL | 2424 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 701 | 701 | float8 | 11 | 10 | 8 | true | b | N | true | true | , | 0 | - | 0 | 1022 | float8in | NULL | 2426 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 790 | 790 | money | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 791 | cash_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 791 | 791 | _money | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 790 | 0 | _moneyin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 869 | 869 | inet | 11 | 10 | -1 | false | b | I | true | true | , | 0 | - | 0 | 1041 | inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1000 | 1000 | _bool | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 16 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1001 | 1001 | _bytea | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 17 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1003 | 1003 | _name | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 19 | 0 | _namein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1005 | 1005 | _int2 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 21 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1007 | 1007 | _int4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 23 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1009 | 1009 | _text | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 25 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1010 | 1010 | _tid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 27 | 0 | _tidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1014 | 1014 | _bpchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1042 | 0 | _bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1015 | 1015 | _varchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1043 | 0 | _varcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1016 | 1016 | _int8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 20 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1021 | 1021 | _float4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 700 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1022 | 1022 | _float8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 701 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1028 | 1028 | _oid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 26 | 0 | _oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1033 | 1033 | aclitem | 11 | 10 | 12 | false | b | U | false | true | , | 0 | - | 0 | 1034 | aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1034 | 1034 | _aclitem | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1033 | 0 | _aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1041 | 1041 | _inet | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 869 | 0 | _inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1042 | 1042 | bpchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1014 | bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1043 | 1043 | varchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1015 | varcharin | NULL | 2432 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1082 | 1082 | date | 11 | 10 | 4 | true | b | D | false | true | , | 0 | - | 0 | 1182 | date_in | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1083 | 1083 | time | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1183 | time_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1114 | 1114 | timestamp | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1115 | timestamp_in | NULL | 2474 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1115 | 1115 | _timestamp | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1114 | 0 | _timestampin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1182 | 1182 | _date | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1082 | 0 | _datein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1183 | 1183 | _time | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1083 | 0 | _timein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1184 | 1184 | timestamptz | 11 | 10 | 8 | true | b | D | true | true | , | 0 | - | 0 | 1185 | timestamptz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1185 | 1185 | _timestamptz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1184 | 0 | _timestamptzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1186 | 1186 | interval | 11 | 10 | 16 | false | b | T | true | true | , | 0 | - | 0 | 1187 | intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1187 | 1187 | _interval | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1186 | 0 | _intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1231 | 1231 | _numeric | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1700 | 0 | _numericin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1266 | 1266 | timetz | 11 | 10 | 12 | false | b | D | false | true | , | 0 | - | 0 | 1270 | timetz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1270 | 1270 | _timetz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1266 | 0 | _timetzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 1700 | 1700 | numeric | 11 | 10 | -1 | false | b | N | false | true | , | 0 | - | 0 | 1231 | numericin | NULL | 2460 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 2249 | 2249 | record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 2287 | recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 2277 | 2277 | anyarray | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyarrayin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 2283 | 2283 | anyelement | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyelementin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 2287 | 2287 | _record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | array_subscript_handler | 2249 | 0 | _recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3220 | 3220 | pg_lsn | 11 | 10 | 8 | true | b | U | false | true | , | 0 | - | 0 | 3221 | pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3221 | 3221 | _pg_lsn | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3220 | 0 | _pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3500 | 3500 | anyenum | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyenumin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3831 | 3831 | anyrange | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3904 | 3904 | int4range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3905 | int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3905 | 3905 | _int4range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3904 | 0 | _int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3906 | 3906 | numrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3907 | numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3907 | 3907 | _numrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3906 | 0 | _numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3908 | 3908 | tsrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3909 | tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3909 | 3909 | _tsrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3908 | 0 | _tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3910 | 3910 | tstzrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3911 | tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3911 | 3911 | _tstzrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3910 | 0 | _tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3912 | 3912 | daterange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3913 | daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3913 | 3913 | _daterange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3912 | 0 | _daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3926 | 3926 | int8range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3927 | int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 3927 | 3927 | _int8range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3926 | 0 | _int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 4451 | 4451 | int4multirange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 6150 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 4532 | 4532 | nummultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6151 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 4533 | 4533 | tsmultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6152 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 4535 | 4535 | datemultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6155 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 4536 | 4536 | int8multirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6157 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 6150 | 6150 | _int4multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4451 | 0 | _int4multirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 6151 | 6151 | _nummultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4532 | 0 | _nummultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 6152 | 6152 | _tsmultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4533 | 0 | _tsmultirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 6155 | 6155 | _datemultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4535 | 0 | _datemultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 6157 | 6157 | _int8multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4536 | 0 | _int8multirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 12003 | 12003 | pg_constraint | 11 | 10 | -1 | false | c | C | false | true | , | 2606 | - | 0 | 12002 | pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 12047 | 12047 | pg_namespace | 11 | 10 | -1 | false | c | C | false | true | , | 2615 | - | 0 | 12046 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | -| 13408 | 13408 | character_data | 13000 | 10 | -1 | false | d | S | false | true | , | 0 | - | 0 | 0 | character_datain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 1043 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | character varying | NULL | -| 13410 | 13410 | sql_identifier | 13000 | 10 | 64 | false | d | S | false | true | , | 0 | - | 0 | 0 | sql_identifierin | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 19 | -1 | NULL | NULL | NULL | NULL | NULL | NULL | name | NULL | -+-------+-------+-----------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+-------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+---------+-------------------+-------------+ ++-------+-------+-------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+---------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+---------+-------------------+-------------+ +| _oid | oid | typname | typnamespace | typowner | typlen | typbyval | typtype | typcategory | typisprefered | typisdefined | typdelim | typrelid | typsubscript | typelem | typarray | typinput | typoutput | typreceive | typsend | typmodin | typmodout | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typcollation | typdefaultbin | typdefault | typacl | xmin | relkind | base_type_name | description | ++-------+-------+-------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+---------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+---------+-------------------+-------------+ +| 16 | 16 | bool | 11 | 10 | 1 | true | b | B | true | true | , | 0 | - | 0 | 1000 | boolin | NULL | 2436 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 17 | 17 | bytea | 11 | 10 | -1 | false | b | U | false | true | , | 0 | - | 0 | 1001 | byteain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 19 | 19 | name | 11 | 10 | 64 | false | b | S | false | true | , | 0 | raw_array_subscript_handler | 0 | 1003 | namein | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 20 | 20 | int8 | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 1016 | int8in | NULL | 2408 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 21 | 21 | int2 | 11 | 10 | 2 | true | b | N | false | true | , | 0 | - | 0 | 1005 | int2in | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 23 | 23 | int4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1007 | int4in | NULL | 2406 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 25 | 25 | text | 11 | 10 | -1 | false | b | S | true | true | , | 0 | - | 0 | 1009 | textin | NULL | 2414 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 26 | 26 | oid | 11 | 10 | 4 | true | b | N | true | true | , | 0 | - | 0 | 1028 | oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 27 | 27 | tid | 11 | 10 | 6 | false | b | U | false | true | , | 0 | - | 0 | 1010 | tidin | NULL | 0 | NULL | NULL | NULL | NULL | s | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 700 | 700 | float4 | 11 | 10 | 4 | true | b | N | false | true | , | 0 | - | 0 | 1021 | float4in | NULL | 2424 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 701 | 701 | float8 | 11 | 10 | 8 | true | b | N | true | true | , | 0 | - | 0 | 1022 | float8in | NULL | 2426 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 790 | 790 | money | 11 | 10 | 8 | true | b | N | false | true | , | 0 | - | 0 | 791 | cash_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 791 | 791 | _money | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 790 | 0 | _moneyin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 869 | 869 | inet | 11 | 10 | -1 | false | b | I | true | true | , | 0 | - | 0 | 1041 | inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1000 | 1000 | _bool | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 16 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1001 | 1001 | _bytea | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 17 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1003 | 1003 | _name | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 19 | 0 | _namein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1005 | 1005 | _int2 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 21 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1007 | 1007 | _int4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 23 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1009 | 1009 | _text | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 25 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1010 | 1010 | _tid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 27 | 0 | _tidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1014 | 1014 | _bpchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1042 | 0 | _bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1015 | 1015 | _varchar | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1043 | 0 | _varcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1016 | 1016 | _int8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 20 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1021 | 1021 | _float4 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 700 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1022 | 1022 | _float8 | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 701 | 0 | array_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1028 | 1028 | _oid | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 26 | 0 | _oidin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1033 | 1033 | aclitem | 11 | 10 | 12 | false | b | U | false | true | , | 0 | - | 0 | 1034 | aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1034 | 1034 | _aclitem | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1033 | 0 | _aclitemin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1041 | 1041 | _inet | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 869 | 0 | _inetin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1042 | 1042 | bpchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1014 | bpcharin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1043 | 1043 | varchar | 11 | 10 | -1 | false | b | S | false | true | , | 0 | - | 0 | 1015 | varcharin | NULL | 2432 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1082 | 1082 | date | 11 | 10 | 4 | true | b | D | false | true | , | 0 | - | 0 | 1182 | date_in | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1083 | 1083 | time | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1183 | time_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1114 | 1114 | timestamp | 11 | 10 | 8 | true | b | D | false | true | , | 0 | - | 0 | 1115 | timestamp_in | NULL | 2474 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1115 | 1115 | _timestamp | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1114 | 0 | _timestampin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1182 | 1182 | _date | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1082 | 0 | _datein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1183 | 1183 | _time | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1083 | 0 | _timein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1184 | 1184 | timestamptz | 11 | 10 | 8 | true | b | D | true | true | , | 0 | - | 0 | 1185 | timestamptz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1185 | 1185 | _timestamptz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1184 | 0 | _timestamptzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1186 | 1186 | interval | 11 | 10 | 16 | false | b | T | true | true | , | 0 | - | 0 | 1187 | intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1187 | 1187 | _interval | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1186 | 0 | _intervalin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1231 | 1231 | _numeric | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1700 | 0 | _numericin | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1266 | 1266 | timetz | 11 | 10 | 12 | false | b | D | false | true | , | 0 | - | 0 | 1270 | timetz_in | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1270 | 1270 | _timetz | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 1266 | 0 | _timetzin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 1700 | 1700 | numeric | 11 | 10 | -1 | false | b | N | false | true | , | 0 | - | 0 | 1231 | numericin | NULL | 2460 | NULL | NULL | NULL | NULL | i | m | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 2249 | 2249 | record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 2287 | recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 2277 | 2277 | anyarray | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyarrayin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 2283 | 2283 | anyelement | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyelementin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 2287 | 2287 | _record | 11 | 10 | -1 | false | p | P | false | true | , | 0 | array_subscript_handler | 2249 | 0 | _recordin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3220 | 3220 | pg_lsn | 11 | 10 | 8 | true | b | U | false | true | , | 0 | - | 0 | 3221 | pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3221 | 3221 | _pg_lsn | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3220 | 0 | _pg_lsnin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3500 | 3500 | anyenum | 11 | 10 | 4 | true | p | P | false | true | , | 0 | - | 0 | 0 | anyenumin | NULL | 0 | NULL | NULL | NULL | NULL | i | p | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3831 | 3831 | anyrange | 11 | 10 | -1 | false | p | P | false | true | , | 0 | - | 0 | 0 | anyrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3904 | 3904 | int4range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3905 | int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3905 | 3905 | _int4range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3904 | 0 | _int4rangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3906 | 3906 | numrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3907 | numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3907 | 3907 | _numrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3906 | 0 | _numrangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3908 | 3908 | tsrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3909 | tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3909 | 3909 | _tsrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3908 | 0 | _tsrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3910 | 3910 | tstzrange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3911 | tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3911 | 3911 | _tstzrange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3910 | 0 | _tstzrangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3912 | 3912 | daterange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3913 | daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3913 | 3913 | _daterange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3912 | 0 | _daterangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3926 | 3926 | int8range | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 3927 | int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 3927 | 3927 | _int8range | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 3926 | 0 | _int8rangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 4451 | 4451 | int4multirange | 11 | 10 | -1 | false | r | R | false | true | , | 0 | - | 0 | 6150 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 4532 | 4532 | nummultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6151 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 4533 | 4533 | tsmultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6152 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 4535 | 4535 | datemultirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6155 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 4536 | 4536 | int8multirange | 11 | 10 | -1 | false | m | R | false | true | , | 0 | - | 0 | 6157 | multirange_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 6150 | 6150 | _int4multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4451 | 0 | _int4multirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 6151 | 6151 | _nummultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4532 | 0 | _nummultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 6152 | 6152 | _tsmultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4533 | 0 | _tsmultirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 6155 | 6155 | _datemultirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4535 | 0 | _datemultirangein | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 6157 | 6157 | _int8multirange | 11 | 10 | -1 | false | b | A | false | true | , | 0 | array_subscript_handler | 4536 | 0 | _int8multirangein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10015 | 10015 | pg_am | 11 | 10 | -1 | false | c | C | false | true | , | 2601 | - | 0 | 10014 | pg_amin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10021 | 10021 | pg_language | 11 | 10 | -1 | false | c | C | false | true | , | 2612 | - | 0 | 10020 | pg_languagein | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10039 | 10039 | pg_event_trigger | 11 | 10 | -1 | false | c | C | false | true | , | 3466 | - | 0 | 10038 | pg_event_triggerin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10043 | 10043 | pg_cast | 11 | 10 | -1 | false | c | C | false | true | , | 2605 | - | 0 | 10042 | pg_castin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10074 | 10074 | pg_extension | 11 | 10 | -1 | false | c | C | false | true | , | 3079 | - | 0 | 10073 | pg_extensionin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10076 | 10076 | pg_foreign_data_wrapper | 11 | 10 | -1 | false | c | C | false | true | , | 2328 | - | 0 | 10075 | pg_foreign_data_wrapperin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 10078 | 10078 | pg_foreign_server | 11 | 10 | -1 | false | c | C | false | true | , | 1417 | - | 0 | 10077 | pg_foreign_serverin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 12003 | 12003 | pg_constraint | 11 | 10 | -1 | false | c | C | false | true | , | 2606 | - | 0 | 12002 | pg_constraintin | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 12047 | 12047 | pg_namespace | 11 | 10 | -1 | false | c | C | false | true | , | 2615 | - | 0 | 12046 | record_in | NULL | 0 | NULL | NULL | NULL | NULL | d | x | false | 0 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | NULL | NULL | +| 13408 | 13408 | character_data | 13000 | 10 | -1 | false | d | S | false | true | , | 0 | - | 0 | 0 | character_datain | NULL | 0 | NULL | NULL | NULL | NULL | i | x | false | 1043 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | character varying | NULL | +| 13410 | 13410 | sql_identifier | 13000 | 10 | 64 | false | d | S | false | true | , | 0 | - | 0 | 0 | sql_identifierin | NULL | 0 | NULL | NULL | NULL | NULL | c | p | false | 19 | -1 | NULL | NULL | NULL | NULL | NULL | 1 | NULL | name | NULL | ++-------+-------+-------------------------+--------------+----------+--------+----------+---------+-------------+---------------+--------------+----------+----------+-----------------------------+---------+----------+---------------------------+-----------+------------+---------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------+------+---------+-------------------+-------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_auth_members.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_auth_members.snap new file mode 100644 index 0000000000000..1cb6afdb6b478 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_auth_members.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_auth_members\n ORDER BY roleid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++--------+--------+---------+--------------+ +| roleid | member | grantor | admin_option | ++--------+--------+---------+--------------+ ++--------+--------+---------+--------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_available_extension_versions.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_available_extension_versions.snap new file mode 100644 index 0000000000000..bf78b04acb23a --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_available_extension_versions.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_available_extension_versions\n ORDER BY name\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++------+---------+-----------+-----------+---------+-------------+--------+----------+---------+ +| name | version | installed | superuser | trusted | relocatable | schema | requires | comment | ++------+---------+-----------+-----------+---------+-------------+--------+----------+---------+ ++------+---------+-----------+-----------+---------+-------------+--------+----------+---------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_cast.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_cast.snap new file mode 100644 index 0000000000000..5b622a37ed51d --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_cast.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_cast\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+------------+------------+----------+-------------+------------+------+ +| oid | castsource | casttarget | castfunc | castcontext | castmethod | xmin | ++-----+------------+------------+----------+-------------+------------+------+ ++-----+------------+------------+----------+-------------+------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_event_trigger.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_event_trigger.snap new file mode 100644 index 0000000000000..584f314b8c0be --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_event_trigger.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_event_trigger\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+---------+----------+----------+---------+------------+---------+------+ +| oid | evtname | evtevent | evtowner | evtfoid | evtenabled | evttags | xmin | ++-----+---------+----------+----------+---------+------------+---------+------+ ++-----+---------+----------+----------+---------+------------+---------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_data_wrapper.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_data_wrapper.snap new file mode 100644 index 0000000000000..ab262c65738a9 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_data_wrapper.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_foreign_data_wrapper\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+---------+----------+------------+--------------+--------+------------+------+ +| oid | fdwname | fdwowner | fdwhandler | fdwvalidator | fdwacl | fdwoptions | xmin | ++-----+---------+----------+------------+--------------+--------+------------+------+ ++-----+---------+----------+------------+--------------+--------+------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_server.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_server.snap new file mode 100644 index 0000000000000..74c903a01289a --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_server.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_foreign_server\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+---------+----------+--------+---------+------------+--------+------------+------+ +| oid | srvname | srvowner | srvfdw | srvtype | srvversion | srvacl | srvoptions | xmin | ++-----+---------+----------+--------+---------+------------+--------+------------+------+ ++-----+---------+----------+--------+---------+------------+--------+------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_table.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_table.snap new file mode 100644 index 0000000000000..28ac58f0f5a53 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_foreign_table.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_foreign_table\n ORDER BY ftrelid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++---------+----------+-----------+ +| ftrelid | ftserver | ftoptions | ++---------+----------+-----------+ ++---------+----------+-----------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_language.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_language.snap new file mode 100644 index 0000000000000..5a7734b79c6d8 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_language.snap @@ -0,0 +1,11 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_language\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+----------+----------+---------+--------------+---------------+-----------+--------------+--------+------+ +| oid | lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl | xmin | ++-----+----------+----------+---------+--------------+---------------+-----------+--------------+--------+------+ +| 12 | internal | 10 | false | false | 0 | 0 | 2246 | NULL | 1 | +| 13 | c | 10 | false | false | 0 | 0 | 2247 | NULL | 1 | +| 14 | sql | 10 | false | true | 0 | 0 | 2248 | NULL | 1 | ++-----+----------+----------+---------+--------------+---------------+-----------+--------------+--------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_locks.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_locks.snap new file mode 100644 index 0000000000000..bbb997da62f5d --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_locks.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_locks\n ORDER BY locktype, database, relation\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+----------+-----------+ +| locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath | waitstart | ++----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+----------+-----------+ ++----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+----------+-----------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_operator.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_operator.snap new file mode 100644 index 0000000000000..a917145a7bbfd --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_operator.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_operator\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+---------+--------------+----------+---------+-------------+------------+---------+----------+-----------+--------+-----------+---------+---------+---------+------+ +| oid | oprname | oprnamespace | oprowner | oprkind | oprcanmerge | oprcanhash | oprleft | oprright | oprresult | oprcom | oprnegate | oprcode | oprrest | oprjoin | xmin | ++-----+---------+--------------+----------+---------+-------------+------------+---------+----------+-----------+--------+-----------+---------+---------+---------+------+ ++-----+---------+--------------+----------+---------+-------------+------------+---------+----------+-----------+--------+-----------+---------+---------+---------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_rewrite.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_rewrite.snap new file mode 100644 index 0000000000000..7fcc28ec25f61 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_rewrite.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_rewrite\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+----------+----------+---------+------------+------------+---------+-----------+------+ +| oid | rulename | ev_class | ev_type | ev_enabled | is_instead | ev_qual | ev_action | xmin | ++-----+----------+----------+---------+------------+------------+---------+-----------+------+ ++-----+----------+----------+---------+------------+------------+---------+-----------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_tablespace.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_tablespace.snap new file mode 100644 index 0000000000000..7e828250df7ba --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_tablespace.snap @@ -0,0 +1,10 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_tablespace\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++------+------------+----------+--------+------------+------+ +| oid | spcname | spcowner | spcacl | spcoptions | xmin | ++------+------------+----------+--------+------------+------+ +| 1663 | pg_default | 10 | NULL | NULL | 1 | +| 1664 | pg_global | 10 | NULL | NULL | 1 | ++------+------------+----------+--------+------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_abbrevs.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_abbrevs.snap new file mode 100644 index 0000000000000..835a8c9d093d3 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_abbrevs.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_timezone_abbrevs\n ORDER BY abbrev\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++--------+------------------------------------------------+--------+ +| abbrev | utc_offset | is_dst | ++--------+------------------------------------------------+--------+ +| UTC | 0 years 0 mons 0 days 0 hours 0 mins 0.00 secs | false | ++--------+------------------------------------------------+--------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_names.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_names.snap new file mode 100644 index 0000000000000..511595f0fbb0f --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_timezone_names.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_timezone_names\n ORDER BY name\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++------+--------+------------------------------------------------+--------+ +| name | abbrev | utc_offset | is_dst | ++------+--------+------------------------------------------------+--------+ +| UTC | UTC | 0 years 0 mons 0 days 0 hours 0 mins 0.00 secs | false | ++------+--------+------------------------------------------------+--------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_user_mapping.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_user_mapping.snap new file mode 100644 index 0000000000000..c34ee9e33e48b --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__pg_user_mapping.snap @@ -0,0 +1,8 @@ +--- +source: cubesql/src/compile/test/test_introspection.rs +expression: "execute_query(r#\"\n SELECT *\n FROM pg_user_mapping\n ORDER BY oid\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-----+--------+----------+-----------+ +| oid | umuser | umserver | umoptions | ++-----+--------+----------+-----------+ ++-----+--------+----------+-----------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__age_xid.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__age_xid.snap new file mode 100644 index 0000000000000..5b0081dc8cc60 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__age_xid.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_udfs.rs +expression: "execute_query(r#\"SELECT AGE(0::xid) AS age;\"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++------------+ +| age | ++------------+ +| 2147483647 | ++------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__format_type.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__format_type.snap index e8e8fceeaf283..53d7c42a1ac4f 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__format_type.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__format_type.snap @@ -83,6 +83,20 @@ expression: "execute_query(\"\n SELECT\n t.oid | 6152 | _tsmultirange | tsmultirange(20)[] | tsmultirange(5)[] | tsmultirange(4)[] | tsmultirange(0)[] | tsmultirange[] | tsmultirange[] | tsmultirange(5)[] | | 6155 | _datemultirange | datemultirange(20)[] | datemultirange(5)[] | datemultirange(4)[] | datemultirange(0)[] | datemultirange[] | datemultirange[] | datemultirange(5)[] | | 6157 | _int8multirange | int8multirange(20)[] | int8multirange(5)[] | int8multirange(4)[] | int8multirange(0)[] | int8multirange[] | int8multirange[] | int8multirange(5)[] | +| 10014 | _pg_am | pg_am(20)[] | pg_am(5)[] | pg_am(4)[] | pg_am(0)[] | pg_am[] | pg_am[] | pg_am(5)[] | +| 10015 | pg_am | pg_am(20) | pg_am(5) | pg_am(4) | pg_am(0) | pg_am | pg_am | pg_am(5) | +| 10020 | _pg_language | pg_language(20)[] | pg_language(5)[] | pg_language(4)[] | pg_language(0)[] | pg_language[] | pg_language[] | pg_language(5)[] | +| 10021 | pg_language | pg_language(20) | pg_language(5) | pg_language(4) | pg_language(0) | pg_language | pg_language | pg_language(5) | +| 10038 | _pg_event_trigger | pg_event_trigger(20)[] | pg_event_trigger(5)[] | pg_event_trigger(4)[] | pg_event_trigger(0)[] | pg_event_trigger[] | pg_event_trigger[] | pg_event_trigger(5)[] | +| 10039 | pg_event_trigger | pg_event_trigger(20) | pg_event_trigger(5) | pg_event_trigger(4) | pg_event_trigger(0) | pg_event_trigger | pg_event_trigger | pg_event_trigger(5) | +| 10042 | _pg_cast | pg_cast(20)[] | pg_cast(5)[] | pg_cast(4)[] | pg_cast(0)[] | pg_cast[] | pg_cast[] | pg_cast(5)[] | +| 10043 | pg_cast | pg_cast(20) | pg_cast(5) | pg_cast(4) | pg_cast(0) | pg_cast | pg_cast | pg_cast(5) | +| 10073 | _pg_extension | pg_extension(20)[] | pg_extension(5)[] | pg_extension(4)[] | pg_extension(0)[] | pg_extension[] | pg_extension[] | pg_extension(5)[] | +| 10074 | pg_extension | pg_extension(20) | pg_extension(5) | pg_extension(4) | pg_extension(0) | pg_extension | pg_extension | pg_extension(5) | +| 10075 | _pg_foreign_data_wrapper | pg_foreign_data_wrapper(20)[] | pg_foreign_data_wrapper(5)[] | pg_foreign_data_wrapper(4)[] | pg_foreign_data_wrapper(0)[] | pg_foreign_data_wrapper[] | pg_foreign_data_wrapper[] | pg_foreign_data_wrapper(5)[] | +| 10076 | pg_foreign_data_wrapper | pg_foreign_data_wrapper(20) | pg_foreign_data_wrapper(5) | pg_foreign_data_wrapper(4) | pg_foreign_data_wrapper(0) | pg_foreign_data_wrapper | pg_foreign_data_wrapper | pg_foreign_data_wrapper(5) | +| 10077 | _pg_foreign_server | pg_foreign_server(20)[] | pg_foreign_server(5)[] | pg_foreign_server(4)[] | pg_foreign_server(0)[] | pg_foreign_server[] | pg_foreign_server[] | pg_foreign_server(5)[] | +| 10078 | pg_foreign_server | pg_foreign_server(20) | pg_foreign_server(5) | pg_foreign_server(4) | pg_foreign_server(0) | pg_foreign_server | pg_foreign_server | pg_foreign_server(5) | | 12002 | _pg_constraint | pg_constraint(20)[] | pg_constraint(5)[] | pg_constraint(4)[] | pg_constraint(0)[] | pg_constraint[] | pg_constraint[] | pg_constraint(5)[] | | 12003 | pg_constraint | pg_constraint(20) | pg_constraint(5) | pg_constraint(4) | pg_constraint(0) | pg_constraint | pg_constraint | pg_constraint(5) | | 12046 | _pg_namespace | pg_namespace(20)[] | pg_namespace(5)[] | pg_namespace(4)[] | pg_namespace(0)[] | pg_namespace[] | pg_namespace[] | pg_namespace(5)[] | diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_datetime_precision_types.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_datetime_precision_types.snap index 73700366ed59c..c565aa3057f77 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_datetime_precision_types.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_datetime_precision_types.snap @@ -83,6 +83,20 @@ expression: "execute_query(\"\n SELECT t.oid, information_schema. | 6152 | NULL | | 6155 | NULL | | 6157 | NULL | +| 10014 | NULL | +| 10015 | NULL | +| 10020 | NULL | +| 10021 | NULL | +| 10038 | NULL | +| 10039 | NULL | +| 10042 | NULL | +| 10043 | NULL | +| 10073 | NULL | +| 10074 | NULL | +| 10075 | NULL | +| 10076 | NULL | +| 10077 | NULL | +| 10078 | NULL | | 12002 | NULL | | 12003 | NULL | | 12046 | NULL | diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_is_in_recovery.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_is_in_recovery.snap new file mode 100644 index 0000000000000..25a85365996f1 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_is_in_recovery.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_udfs.rs +expression: "execute_query(r#\"SELECT pg_is_in_recovery();\"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++-------------------+ +| pg_is_in_recovery | ++-------------------+ +| false | ++-------------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_precision_types.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_precision_types.snap index 168341b356205..e0d84c5b694e5 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_precision_types.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_precision_types.snap @@ -83,6 +83,20 @@ expression: "execute_query(\"\n SELECT t.oid, information_schema. | 6152 | NULL | | 6155 | NULL | | 6157 | NULL | +| 10014 | NULL | +| 10015 | NULL | +| 10020 | NULL | +| 10021 | NULL | +| 10038 | NULL | +| 10039 | NULL | +| 10042 | NULL | +| 10043 | NULL | +| 10073 | NULL | +| 10074 | NULL | +| 10075 | NULL | +| 10076 | NULL | +| 10077 | NULL | +| 10078 | NULL | | 12002 | NULL | | 12003 | NULL | | 12046 | NULL | diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_scale_types.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_scale_types.snap index 1cfbd9427e1ac..4a30ff5cca488 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_scale_types.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_numeric_scale_types.snap @@ -83,6 +83,20 @@ expression: "execute_query(\"\n SELECT t.oid, information_schema. | 6152 | NULL | | 6155 | NULL | | 6157 | NULL | +| 10014 | NULL | +| 10015 | NULL | +| 10020 | NULL | +| 10021 | NULL | +| 10038 | NULL | +| 10039 | NULL | +| 10042 | NULL | +| 10043 | NULL | +| 10073 | NULL | +| 10074 | NULL | +| 10075 | NULL | +| 10076 | NULL | +| 10077 | NULL | +| 10078 | NULL | | 12002 | NULL | | 12003 | NULL | | 12046 | NULL | diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_tablespace_location.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_tablespace_location.snap new file mode 100644 index 0000000000000..3764a57b14574 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_tablespace_location.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_udfs.rs +expression: "execute_query(r#\"SELECT pg_tablespace_location(18000::xid) AS pg_tablespace_location;\"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++------------------------+ +| pg_tablespace_location | ++------------------------+ +| | ++------------------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_type_is_visible.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_type_is_visible.snap index f2f0b0738c8c2..88906808961b9 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_type_is_visible.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_type_is_visible.snap @@ -83,6 +83,20 @@ expression: "execute_query(\"\n SELECT t.oid, t.typname, n.nspnam | 6152 | _tsmultirange | pg_catalog | true | | 6155 | _datemultirange | pg_catalog | true | | 6157 | _int8multirange | pg_catalog | true | +| 10014 | _pg_am | pg_catalog | true | +| 10015 | pg_am | pg_catalog | true | +| 10020 | _pg_language | pg_catalog | true | +| 10021 | pg_language | pg_catalog | true | +| 10038 | _pg_event_trigger | pg_catalog | true | +| 10039 | pg_event_trigger | pg_catalog | true | +| 10042 | _pg_cast | pg_catalog | true | +| 10043 | pg_cast | pg_catalog | true | +| 10073 | _pg_extension | pg_catalog | true | +| 10074 | pg_extension | pg_catalog | true | +| 10075 | _pg_foreign_data_wrapper | pg_catalog | true | +| 10076 | pg_foreign_data_wrapper | pg_catalog | true | +| 10077 | _pg_foreign_server | pg_catalog | true | +| 10078 | pg_foreign_server | pg_catalog | true | | 12002 | _pg_constraint | pg_catalog | true | | 12003 | pg_constraint | pg_catalog | true | | 12046 | _pg_namespace | pg_catalog | true | diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__txid_current.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__txid_current.snap new file mode 100644 index 0000000000000..76bc6add2a3d8 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__txid_current.snap @@ -0,0 +1,9 @@ +--- +source: cubesql/src/compile/test/test_udfs.rs +expression: "execute_query(r#\"SELECT txid_current();\"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?" +--- ++--------------+ +| txid_current | ++--------------+ +| 1 | ++--------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs index cafc287b5e2f5..0b17967fc7c05 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs @@ -3356,3 +3356,288 @@ order by "table-schema" asc, "table-name" asc, "database-position" asc ); Ok(()) } + +#[tokio::test] +async fn test_pg_auth_members() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_auth_members", + execute_query( + r#" + SELECT * + FROM pg_auth_members + ORDER BY roleid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_available_extension_versions() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_available_extension_versions", + execute_query( + r#" + SELECT * + FROM pg_available_extension_versions + ORDER BY name + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_cast() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_cast", + execute_query( + r#" + SELECT * + FROM pg_cast + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_event_trigger() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_event_trigger", + execute_query( + r#" + SELECT * + FROM pg_event_trigger + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_foreign_data_wrapper() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_foreign_data_wrapper", + execute_query( + r#" + SELECT * + FROM pg_foreign_data_wrapper + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_foreign_server() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_foreign_server", + execute_query( + r#" + SELECT * + FROM pg_foreign_server + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_foreign_table() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_foreign_table", + execute_query( + r#" + SELECT * + FROM pg_foreign_table + ORDER BY ftrelid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_language() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_language", + execute_query( + r#" + SELECT * + FROM pg_language + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_locks() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_locks", + execute_query( + r#" + SELECT * + FROM pg_locks + ORDER BY locktype, database, relation + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_operator() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_operator", + execute_query( + r#" + SELECT * + FROM pg_operator + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_rewrite() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_rewrite", + execute_query( + r#" + SELECT * + FROM pg_rewrite + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_tablespace() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_tablespace", + execute_query( + r#" + SELECT * + FROM pg_tablespace + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_timezone_abbrevs() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_timezone_abbrevs", + execute_query( + r#" + SELECT * + FROM pg_timezone_abbrevs + ORDER BY abbrev + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_timezone_names() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_timezone_names", + execute_query( + r#" + SELECT * + FROM pg_timezone_names + ORDER BY name + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_user_mapping() -> Result<(), CubeError> { + insta::assert_snapshot!( + "pg_user_mapping", + execute_query( + r#" + SELECT * + FROM pg_user_mapping + ORDER BY oid + "# + .to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} diff --git a/rust/cubesql/cubesql/src/compile/test/test_udfs.rs b/rust/cubesql/cubesql/src/compile/test/test_udfs.rs index 37e884adef88b..a2e41efa3c856 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_udfs.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_udfs.rs @@ -1327,3 +1327,67 @@ async fn test_age() -> Result<(), CubeError> { Ok(()) } + +#[tokio::test] +async fn test_age_xid() -> Result<(), CubeError> { + init_testing_logger(); + + insta::assert_snapshot!( + "age_xid", + execute_query( + r#"SELECT AGE(0::xid) AS age;"#.to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_txid_current() -> Result<(), CubeError> { + init_testing_logger(); + + insta::assert_snapshot!( + "txid_current", + execute_query( + r#"SELECT txid_current();"#.to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_is_in_recovery() -> Result<(), CubeError> { + init_testing_logger(); + + insta::assert_snapshot!( + "pg_is_in_recovery", + execute_query( + r#"SELECT pg_is_in_recovery();"#.to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} + +#[tokio::test] +async fn test_pg_tablespace_location() -> Result<(), CubeError> { + init_testing_logger(); + + insta::assert_snapshot!( + "pg_tablespace_location", + execute_query( + r#"SELECT pg_tablespace_location(18000::xid) AS pg_tablespace_location;"#.to_string(), + DatabaseProtocol::PostgreSQL + ) + .await? + ); + + Ok(()) +} diff --git a/rust/cubesql/cubesql/src/sql/statement.rs b/rust/cubesql/cubesql/src/sql/statement.rs index aec18178e24e5..e12a6ad9ecb74 100644 --- a/rust/cubesql/cubesql/src/sql/statement.rs +++ b/rust/cubesql/cubesql/src/sql/statement.rs @@ -715,6 +715,11 @@ impl<'ast> Visitor<'ast, ConnectionError> for CastReplacer { *expr = *cast_expr.clone(); } + "xid" => { + self.visit_expr(&mut *cast_expr)?; + + *data_type = ast::DataType::UnsignedInt(None); + } "int2" => { self.visit_expr(&mut *cast_expr)?; @@ -767,17 +772,22 @@ impl<'ast> Visitor<'ast, ConnectionError> for CastReplacer { }) } } + "\"char\"" => { + self.visit_expr(&mut *cast_expr)?; + + *data_type = ast::DataType::Text; + } // TODO: _ => (), }, ast::DataType::Regclass => match &**cast_expr { Expr::Value(val) => { let str_val = self.parse_value_to_str(&val); - if str_val.is_none() { + let Some(str_val) = str_val else { return Ok(()); - } + }; + let str_val = str_val.strip_prefix("pg_catalog.").unwrap_or(&str_val); - let str_val = str_val.unwrap(); for typ in PgType::get_all() { if typ.typname == str_val { *expr = Expr::Value(Value::Number(typ.typrelid.to_string(), false)); diff --git a/rust/cubesql/pg-srv/src/pg_type.rs b/rust/cubesql/pg-srv/src/pg_type.rs index 9bf97de13d508..9a89bde9b5a46 100644 --- a/rust/cubesql/pg-srv/src/pg_type.rs +++ b/rust/cubesql/pg-srv/src/pg_type.rs @@ -1921,6 +1921,328 @@ define_pg_types![ typreceive_oid: 0, }, + ARRAYPGAM (10014) { + typname: "_pg_am", + regtype: "pg_am[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10015, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGAM (10015) { + typname: "pg_am", + regtype: "pg_am", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 2601, + typsubscript: "-", + typelem: 0, + typarray: 10014, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGLANGUAGE (10020) { + typname: "_pg_language", + regtype: "pg_language[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10021, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGLANGUAGE (10021) { + typname: "pg_language", + regtype: "pg_language", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 2612, + typsubscript: "-", + typelem: 0, + typarray: 10020, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGEVENTTRIGGER (10038) { + typname: "_pg_event_trigger", + regtype: "pg_event_trigger[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10039, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGEVENTTRIGGER (10039) { + typname: "pg_event_trigger", + regtype: "pg_event_trigger", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 3466, + typsubscript: "-", + typelem: 0, + typarray: 10038, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGCAST (10042) { + typname: "_pg_cast", + regtype: "pg_cast[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10043, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGCAST (10043) { + typname: "pg_cast", + regtype: "pg_cast", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 2605, + typsubscript: "-", + typelem: 0, + typarray: 10042, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGEXTENSION (10073) { + typname: "_pg_extension", + regtype: "pg_extension[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10074, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGEXTENSION (10074) { + typname: "pg_extension", + regtype: "pg_extension", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 3079, + typsubscript: "-", + typelem: 0, + typarray: 10073, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGFOREIGNDATAWRAPPER (10075) { + typname: "_pg_foreign_data_wrapper", + regtype: "pg_foreign_data_wrapper[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10076, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGFOREIGNDATAWRAPPER (10076) { + typname: "pg_foreign_data_wrapper", + regtype: "pg_foreign_data_wrapper", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 2328, + typsubscript: "-", + typelem: 0, + typarray: 10075, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + ARRAYPGFOREIGNSERVER (10077) { + typname: "_pg_foreign_server", + regtype: "pg_foreign_server[]", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "b", + typcategory: "A", + typisprefered: false, + typisdefined: true, + typrelid: 0, + typsubscript: "array_subscript_handler", + typelem: 10078, + typarray: 0, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "array_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + + PGFOREIGNSERVER (10078) { + typname: "pg_foreign_server", + regtype: "pg_foreign_server", + typnamespace: 11, + typowner: 10, + typlen: -1, + typbyval: false, + typtype: "c", + typcategory: "C", + typisprefered: false, + typisdefined: true, + typrelid: 1417, + typsubscript: "-", + typelem: 0, + typarray: 10077, + typalign: "d", + typstorage: "x", + typbasetype: 0, + typreceive: "record_recv", + // TODO: Get from pg_proc + typreceive_oid: 0, + }, + ARRAYPGCONSTRAINT (12002) { typname: "_pg_constraint", regtype: "pg_constraint[]", diff --git a/rust/cubesqlplanner/Cargo.lock b/rust/cubesqlplanner/Cargo.lock index 39d04db2a9904..7a0f6784719b7 100644 --- a/rust/cubesqlplanner/Cargo.lock +++ b/rust/cubesqlplanner/Cargo.lock @@ -664,7 +664,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "chrono", @@ -777,7 +777,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -810,7 +810,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -821,7 +821,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "async-trait", "chrono", @@ -834,7 +834,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6#7803f7e1cb8fa3d7b25451de35b8765e1ce4a3f6" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=016c22f74b82f241fc01abd205020cb52b6c911e#016c22f74b82f241fc01abd205020cb52b6c911e" dependencies = [ "ahash 0.7.8", "arrow", @@ -2871,7 +2871,7 @@ dependencies = [ [[package]] name = "sqlparser" version = "0.16.0" -source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=34f22de680caa5fe586def5b336d56efe43c8cc4#34f22de680caa5fe586def5b336d56efe43c8cc4" +source = "git+https://github.com/cube-js/sqlparser-rs.git?rev=e14d5bf45367edd8679cbc15ccee56693da8e4fb#e14d5bf45367edd8679cbc15ccee56693da8e4fb" dependencies = [ "log", ]