diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index c625e8695..707e6cc13 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -75,7 +75,7 @@ jobs: GEN: ninja STATIC_LIBCPP: 1 run: | - make release + make reldebug - name: Test extension env: @@ -84,4 +84,4 @@ jobs: run: | psql -c "SELECT 43" source ./create-postgres-tables.sh - make test_release \ No newline at end of file + make test_reldebug \ No newline at end of file diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 3b6399dac..9c5f0a698 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -16,8 +16,8 @@ jobs: name: Build extension binaries uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.2.2 with: - duckdb_version: v1.2.2 - ci_tools_version: v1.2.2 + duckdb_version: main + ci_tools_version: main extension_name: postgres_scanner exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw' @@ -27,8 +27,8 @@ jobs: uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.2.2 secrets: inherit with: - duckdb_version: v1.2.2 - ci_tools_version: v1.2.2 + duckdb_version: main + ci_tools_version: main extension_name: postgres_scanner exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw' deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} diff --git a/create-postgres-tables.sh b/create-postgres-tables.sh index 408f292f5..7b5bde2ba 100755 --- a/create-postgres-tables.sh +++ b/create-postgres-tables.sh @@ -1,4 +1,15 @@ #!/bin/bash +set -e + +DUCKDB_PATH=duckdb +if test -f build/release/duckdb; then + DUCKDB_PATH=build/release/duckdb +elif test -f build/reldebug/duckdb; then + DUCKDB_PATH=build/reldebug/duckdb +elif test -f build/debug/duckdb; then + DUCKDB_PATH=build/debug/duckdb +fi + echo " CREATE SCHEMA tpch; CREATE SCHEMA tpcds; @@ -6,7 +17,7 @@ CALL dbgen(sf=0.01, schema='tpch'); CALL dsdgen(sf=0.01, schema='tpcds'); EXPORT DATABASE '/tmp/postgresscannertmp'; " | \ -./build/release/duckdb +$DUCKDB_PATH dropdb --if-exists postgresscanner createdb postgresscanner diff --git a/duckdb b/duckdb index 7c039464e..a35d8b6d5 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit 7c039464e452ddc3330e2691d3fa6d305521d09b +Subproject commit a35d8b6d5ba121f2601b917e1a7732207c944ae5 diff --git a/src/include/storage/postgres_catalog.hpp b/src/include/storage/postgres_catalog.hpp index 2935c56ca..b7635823d 100644 --- a/src/include/storage/postgres_catalog.hpp +++ b/src/include/storage/postgres_catalog.hpp @@ -40,18 +40,18 @@ class PostgresCatalog : public Catalog { void ScanSchemas(ClientContext &context, std::function callback) override; - optional_ptr GetSchema(CatalogTransaction transaction, const string &schema_name, - OnEntryNotFound if_not_found, - QueryErrorContext error_context = QueryErrorContext()) override; - - unique_ptr PlanInsert(ClientContext &context, LogicalInsert &op, - unique_ptr plan) override; - unique_ptr PlanCreateTableAs(ClientContext &context, LogicalCreateTable &op, - unique_ptr plan) override; - unique_ptr PlanDelete(ClientContext &context, LogicalDelete &op, - unique_ptr plan) override; - unique_ptr PlanUpdate(ClientContext &context, LogicalUpdate &op, - unique_ptr plan) override; + optional_ptr LookupSchema(CatalogTransaction transaction, const EntryLookupInfo &schema_lookup, + OnEntryNotFound if_not_found) override; + + PhysicalOperator &PlanCreateTableAs(ClientContext &context, PhysicalPlanGenerator &planner, LogicalCreateTable &op, + PhysicalOperator &plan) override; + PhysicalOperator &PlanInsert(ClientContext &context, PhysicalPlanGenerator &planner, LogicalInsert &op, + optional_ptr plan) override; + PhysicalOperator &PlanDelete(ClientContext &context, PhysicalPlanGenerator &planner, LogicalDelete &op, + PhysicalOperator &plan) override; + PhysicalOperator &PlanUpdate(ClientContext &context, PhysicalPlanGenerator &planner, LogicalUpdate &op, + PhysicalOperator &plan) override; + unique_ptr BindCreateIndex(Binder &binder, CreateStatement &stmt, TableCatalogEntry &table, unique_ptr plan) override; diff --git a/src/include/storage/postgres_schema_entry.hpp b/src/include/storage/postgres_schema_entry.hpp index 0615c9d89..75e23643a 100644 --- a/src/include/storage/postgres_schema_entry.hpp +++ b/src/include/storage/postgres_schema_entry.hpp @@ -42,7 +42,7 @@ class PostgresSchemaEntry : public SchemaCatalogEntry { void Scan(ClientContext &context, CatalogType type, const std::function &callback) override; void Scan(CatalogType type, const std::function &callback) override; void DropEntry(ClientContext &context, DropInfo &info) override; - optional_ptr GetEntry(CatalogTransaction transaction, CatalogType type, const string &name) override; + optional_ptr LookupEntry(CatalogTransaction transaction, const EntryLookupInfo &lookup_info) override; static bool SchemaIsInternal(const string &name); diff --git a/src/storage/postgres_catalog.cpp b/src/storage/postgres_catalog.cpp index 2e625565d..b7e482b11 100644 --- a/src/storage/postgres_catalog.cpp +++ b/src/storage/postgres_catalog.cpp @@ -138,15 +138,15 @@ void PostgresCatalog::ScanSchemas(ClientContext &context, std::function()); }); } -optional_ptr PostgresCatalog::GetSchema(CatalogTransaction transaction, const string &schema_name, - OnEntryNotFound if_not_found, - QueryErrorContext error_context) { +optional_ptr PostgresCatalog::LookupSchema(CatalogTransaction transaction, const EntryLookupInfo &schema_lookup, + OnEntryNotFound if_not_found) { + auto schema_name = schema_lookup.GetEntryName(); if (schema_name == DEFAULT_SCHEMA) { - return GetSchema(transaction, default_schema, if_not_found, error_context); + schema_name = default_schema; } auto &postgres_transaction = PostgresTransaction::Get(transaction.GetContext(), *this); if (schema_name == "pg_temp") { - return GetSchema(transaction, postgres_transaction.GetTemporarySchema(), if_not_found, error_context); + schema_name = postgres_transaction.GetTemporarySchema(); } auto entry = schemas.GetEntry(transaction.GetContext(), schema_name); if (!entry && if_not_found != OnEntryNotFound::RETURN_NULL) { diff --git a/src/storage/postgres_delete.cpp b/src/storage/postgres_delete.cpp index 97c0f8c97..88dec2ce5 100644 --- a/src/storage/postgres_delete.cpp +++ b/src/storage/postgres_delete.cpp @@ -119,17 +119,16 @@ InsertionOrderPreservingMap PostgresDelete::ParamsToString() const { //===--------------------------------------------------------------------===// // Plan //===--------------------------------------------------------------------===// -unique_ptr PostgresCatalog::PlanDelete(ClientContext &context, LogicalDelete &op, - unique_ptr plan) { +PhysicalOperator &PostgresCatalog::PlanDelete(ClientContext &context, PhysicalPlanGenerator &planner, LogicalDelete &op, PhysicalOperator &plan) { if (op.return_chunk) { throw BinderException("RETURNING clause not yet supported for deletion of a Postgres table"); } auto &bound_ref = op.expressions[0]->Cast(); - PostgresCatalog::MaterializePostgresScans(*plan); + PostgresCatalog::MaterializePostgresScans(plan); - auto insert = make_uniq(op, op.table, bound_ref.index); - insert->children.push_back(std::move(plan)); - return std::move(insert); + auto &delete_op = planner.Make(op, op.table, bound_ref.index); + delete_op.children.push_back(plan); + return delete_op; } } // namespace duckdb diff --git a/src/storage/postgres_index.cpp b/src/storage/postgres_index.cpp index bfbab3fca..5ce5b3660 100644 --- a/src/storage/postgres_index.cpp +++ b/src/storage/postgres_index.cpp @@ -4,6 +4,10 @@ #include "duckdb/planner/operator/logical_extension_operator.hpp" #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" #include "duckdb/parser/parsed_data/drop_info.hpp" +#include "duckdb/planner/operator/logical_create_index.hpp" +#include "duckdb/parser/parsed_data/create_index_info.hpp" +#include "duckdb/planner/expression_binder/index_binder.hpp" +#include "duckdb/planner/operator/logical_get.hpp" namespace duckdb { @@ -56,8 +60,8 @@ class LogicalPostgresCreateIndex : public LogicalExtensionOperator { unique_ptr info; TableCatalogEntry &table; - unique_ptr CreatePlan(ClientContext &context, PhysicalPlanGenerator &generator) override { - return make_uniq(std::move(info), table); + PhysicalOperator &CreatePlan(ClientContext &context, PhysicalPlanGenerator &planner) override { + return planner.Make(std::move(info), table); } void Serialize(Serializer &serializer) const override { @@ -72,8 +76,21 @@ class LogicalPostgresCreateIndex : public LogicalExtensionOperator { unique_ptr PostgresCatalog::BindCreateIndex(Binder &binder, CreateStatement &stmt, TableCatalogEntry &table, unique_ptr plan) { - return make_uniq(unique_ptr_cast(std::move(stmt.info)), - table); + // FIXME: this is a work-around for the CreateIndexInfo we are getting here not being fully bound + // this needs to be fixed upstream (eventually) + auto create_index_info = unique_ptr_cast(std::move(stmt.info)); + IndexBinder index_binder(binder, binder.context); + + // Bind the index expressions. + vector> expressions; + for (auto &expr : create_index_info->expressions) { + expressions.push_back(index_binder.Bind(expr)); + } + + auto &get = plan->Cast(); + index_binder.InitCreateIndexInfo(get, *create_index_info, table.schema.name); + + return make_uniq(std::move(create_index_info), table); } } // namespace duckdb diff --git a/src/storage/postgres_insert.cpp b/src/storage/postgres_insert.cpp index f6d5193e7..dd616df30 100644 --- a/src/storage/postgres_insert.cpp +++ b/src/storage/postgres_insert.cpp @@ -153,10 +153,10 @@ InsertionOrderPreservingMap PostgresInsert::ParamsToString() const { //===--------------------------------------------------------------------===// // Plan //===--------------------------------------------------------------------===// -unique_ptr AddCastToPostgresTypes(ClientContext &context, unique_ptr plan) { +PhysicalOperator &AddCastToPostgresTypes(ClientContext &context, PhysicalPlanGenerator &planner, PhysicalOperator &plan) { // check if we need to cast anything bool require_cast = false; - auto &child_types = plan->GetTypes(); + auto &child_types = plan.GetTypes(); for (auto &type : child_types) { auto postgres_type = PostgresUtils::ToPostgresType(type); if (postgres_type != type) { @@ -164,30 +164,30 @@ unique_ptr AddCastToPostgresTypes(ClientContext &context, uniq break; } } - if (require_cast) { - vector postgres_types; - vector> select_list; - for (idx_t i = 0; i < child_types.size(); i++) { - auto &type = child_types[i]; - unique_ptr expr; - expr = make_uniq(type, i); - - auto postgres_type = PostgresUtils::ToPostgresType(type); - if (postgres_type != type) { - // add a cast - expr = BoundCastExpression::AddCastToType(context, std::move(expr), postgres_type); - } - postgres_types.push_back(std::move(postgres_type)); - select_list.push_back(std::move(expr)); - } - // we need to cast: add casts - auto proj = make_uniq(std::move(postgres_types), std::move(select_list), - plan->estimated_cardinality); - proj->children.push_back(std::move(plan)); - plan = std::move(proj); - } - - return plan; + if (!require_cast) { + return plan; + } + + vector postgres_types; + vector> select_list; + for (idx_t i = 0; i < child_types.size(); i++) { + auto &type = child_types[i]; + unique_ptr expr; + expr = make_uniq(type, i); + + auto postgres_type = PostgresUtils::ToPostgresType(type); + if (postgres_type != type) { + // add a cast + expr = BoundCastExpression::AddCastToType(context, std::move(expr), postgres_type); + } + postgres_types.push_back(std::move(postgres_type)); + select_list.push_back(std::move(expr)); + } + + // we need to cast: add casts + auto &proj = planner.Make(std::move(postgres_types), std::move(select_list), plan.estimated_cardinality); + proj.children.push_back(plan); + return proj; } bool PostgresCatalog::IsPostgresScan(const string &name) { @@ -206,36 +206,34 @@ void PostgresCatalog::MaterializePostgresScans(PhysicalOperator &op) { } } for (auto &child : op.children) { - MaterializePostgresScans(*child); + MaterializePostgresScans(child); } } -unique_ptr PostgresCatalog::PlanInsert(ClientContext &context, LogicalInsert &op, - unique_ptr plan) { +PhysicalOperator &PostgresCatalog::PlanInsert(ClientContext &context, PhysicalPlanGenerator &planner, LogicalInsert &op, optional_ptr plan) { if (op.return_chunk) { throw BinderException("RETURNING clause not yet supported for insertion into Postgres table"); } if (op.action_type != OnConflictAction::THROW) { throw BinderException("ON CONFLICT clause not yet supported for insertion into Postgres table"); } - MaterializePostgresScans(*plan); - plan = AddCastToPostgresTypes(context, std::move(plan)); + D_ASSERT(plan); + MaterializePostgresScans(*plan); + auto &inner_plan = AddCastToPostgresTypes(context, planner, *plan); - auto insert = make_uniq(op, op.table, op.column_index_map); - insert->children.push_back(std::move(plan)); - return std::move(insert); + auto &insert = planner.Make(op, op.table, op.column_index_map); + insert.children.push_back(inner_plan); + return insert; } -unique_ptr PostgresCatalog::PlanCreateTableAs(ClientContext &context, LogicalCreateTable &op, - unique_ptr plan) { - plan = AddCastToPostgresTypes(context, std::move(plan)); - - MaterializePostgresScans(*plan); +PhysicalOperator &PostgresCatalog::PlanCreateTableAs(ClientContext &context, PhysicalPlanGenerator &planner, LogicalCreateTable &op, PhysicalOperator &plan) { + auto &inner_plan = AddCastToPostgresTypes(context, planner, plan); + MaterializePostgresScans(inner_plan); - auto insert = make_uniq(op, op.schema, std::move(op.info)); - insert->children.push_back(std::move(plan)); - return std::move(insert); + auto &insert = planner.Make(op, op.schema, std::move(op.info)); + insert.children.push_back(inner_plan); + return insert; } } // namespace duckdb diff --git a/src/storage/postgres_schema_entry.cpp b/src/storage/postgres_schema_entry.cpp index 32e2f90c0..c1b34918e 100644 --- a/src/storage/postgres_schema_entry.cpp +++ b/src/storage/postgres_schema_entry.cpp @@ -183,12 +183,12 @@ void PostgresSchemaEntry::DropEntry(ClientContext &context, DropInfo &info) { GetCatalogSet(info.type).DropEntry(context, info); } -optional_ptr PostgresSchemaEntry::GetEntry(CatalogTransaction transaction, CatalogType type, - const string &name) { - if (!CatalogTypeIsSupported(type)) { +optional_ptr PostgresSchemaEntry::LookupEntry(CatalogTransaction transaction, const EntryLookupInfo &lookup_info) { + auto catalog_type = lookup_info.GetCatalogType(); + if (!CatalogTypeIsSupported(catalog_type)) { return nullptr; } - return GetCatalogSet(type).GetEntry(transaction.GetContext(), name); + return GetCatalogSet(catalog_type).GetEntry(transaction.GetContext(), lookup_info.GetEntryName()); } PostgresCatalogSet &PostgresSchemaEntry::GetCatalogSet(CatalogType type) { diff --git a/src/storage/postgres_update.cpp b/src/storage/postgres_update.cpp index 4f0aefa94..8fa4d690b 100644 --- a/src/storage/postgres_update.cpp +++ b/src/storage/postgres_update.cpp @@ -180,8 +180,7 @@ InsertionOrderPreservingMap PostgresUpdate::ParamsToString() const { //===--------------------------------------------------------------------===// // Plan //===--------------------------------------------------------------------===// -unique_ptr PostgresCatalog::PlanUpdate(ClientContext &context, LogicalUpdate &op, - unique_ptr plan) { +PhysicalOperator &PostgresCatalog::PlanUpdate(ClientContext &context, PhysicalPlanGenerator &planner, LogicalUpdate &op, PhysicalOperator &plan) { if (op.return_chunk) { throw BinderException("RETURNING clause not yet supported for updates of a Postgres table"); } @@ -190,10 +189,11 @@ unique_ptr PostgresCatalog::PlanUpdate(ClientContext &context, throw BinderException("SET DEFAULT is not yet supported for updates of a Postgres table"); } } - PostgresCatalog::MaterializePostgresScans(*plan); - auto insert = make_uniq(op, op.table, std::move(op.columns)); - insert->children.push_back(std::move(plan)); - return std::move(insert); + + PostgresCatalog::MaterializePostgresScans(plan); + auto &update = planner.Make(op, op.table, std::move(op.columns)); + update.children.push_back(plan); + return update; } } // namespace duckdb diff --git a/test/sql/scanner/arrays.test b/test/sql/scanner/arrays.test index 45621bfb5..657a481c4 100644 --- a/test/sql/scanner/arrays.test +++ b/test/sql/scanner/arrays.test @@ -33,13 +33,13 @@ SELECT UNNEST(float_col), ROUND(UNNEST(double_col), 1) FROM pg_numarraytypes query IIIIIIII select * from pg_bytearraytypes; ---- -[a, Z, NULL] [a, Z, NULL] [aaaa, ZZZZ, NULL] [aaaa, ZZZZ, NULL] [aaaa, ZZZZ, NULL] [x00, xff, NULL] [{"a":42}, NULL] [a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11, NULL] +[a, Z, NULL] [a, Z, NULL] [aaaa, ZZZZ, NULL] [aaaa, ZZZZ, NULL] [aaaa, ZZZZ, NULL] [x00, xff, NULL] ['{"a":42}', NULL] [a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11, NULL] NULL NULL NULL NULL NULL NULL NULL NULL query IIIII select * from pg_datearraytypes; ---- -[2019-11-26, 2021-03-01, NULL] [14:42:43, 12:45:01, NULL] [14:42:43+05:45, 12:45:01+05:45, NULL] [2019-11-26 12:45:01, 2021-03-01 12:45:01, NULL] [2019-11-26 07:00:01+00, 2021-03-01 07:00:01+00, NULL] +[2019-11-26, 2021-03-01, NULL] ['14:42:43', '12:45:01', NULL] ['14:42:43+05:45', '12:45:01+05:45', NULL] ['2019-11-26 12:45:01', '2021-03-01 12:45:01', NULL] ['2019-11-26 07:00:01+00', '2021-03-01 07:00:01+00', NULL] NULL NULL NULL NULL NULL statement ok diff --git a/test/sql/scanner/daterange_array.test b/test/sql/scanner/daterange_array.test index bddb42712..c0620bc27 100644 --- a/test/sql/scanner/daterange_array.test +++ b/test/sql/scanner/daterange_array.test @@ -20,7 +20,7 @@ loop i 0 2 query II SELECT * from daterange_array; ---- -1108 [["2010-01-01 14:30:00","2010-01-01 15:30:00")] +1108 ['["2010-01-01 14:30:00","2010-01-01 15:30:00")'] statement ok USE memory diff --git a/test/sql/storage/attach_types.test b/test/sql/storage/attach_types.test index 610ce67a8..7819c04fb 100644 --- a/test/sql/storage/attach_types.test +++ b/test/sql/storage/attach_types.test @@ -60,14 +60,14 @@ query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII SELECT COLUMNS(*)::VARCHAR FROM all_types_tbl ---- false -128 -32768 -2147483648 -9223372036854775808 0 0 0 2000-01-01 00:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 -999.9 -99999.9999 -999999999999.999999 -9999999999999999999999999999.9999999999 00000000-0000-0000-0000-000000000000 00:00:00 🦆🦆🦆🦆🦆🦆 thisisalongblob\x00withnullbytes 0010001001011100010101011010111 DUCK_DUCK_ENUM enum_0 enum_0 [] [] [] [] [] [🦆🦆🦆🦆🦆🦆, goose, NULL] -true 127 32767 2147483647 9223372036854775807 255 65535 4294967295 2000-01-01 24:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 999.9 99999.9999 999999999999.999999 9999999999999999999999999999.9999999999 ffffffff-ffff-ffff-ffff-ffffffffffff 83 years 3 months 999 days 00:16:39.999999 goo se \x00\x00\x00a 10101 GOOSE enum_299 enum_69999 [42, 999, NULL, NULL, -42] [42.0, nan, inf, -inf, NULL, -42.0] [1970-01-01, infinity, -infinity, NULL, 2022-05-12] [1970-01-01 00:00:00, infinity, -infinity, NULL, 2022-05-12 16:23:45] [1970-01-01 00:00:00+00, infinity, -infinity, NULL, 2022-05-12 23:23:45+00] [🦆🦆🦆🦆🦆🦆, goose, NULL] +true 127 32767 2147483647 9223372036854775807 255 65535 4294967295 2000-01-01 24:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 999.9 99999.9999 999999999999.999999 9999999999999999999999999999.9999999999 ffffffff-ffff-ffff-ffff-ffffffffffff 83 years 3 months 999 days 00:16:39.999999 goo se \x00\x00\x00a 10101 GOOSE enum_299 enum_69999 [42, 999, NULL, NULL, -42] [42.0, nan, inf, -inf, NULL, -42.0] [1970-01-01, infinity, -infinity, NULL, 2022-05-12] ['1970-01-01 00:00:00', infinity, -infinity, NULL, '2022-05-12 16:23:45'] ['1970-01-01 00:00:00+00', infinity, -infinity, NULL, '2022-05-12 23:23:45+00'] [🦆🦆🦆🦆🦆🦆, goose, NULL] NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII SELECT COLUMNS(*)::VARCHAR FROM s.all_types ---- false -128 -32768 -2147483648 -9223372036854775808 0 0 0 2000-01-01 00:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 -999.9 -99999.9999 -999999999999.999999 -9999999999999999999999999999.9999999999 00000000-0000-0000-0000-000000000000 00:00:00 🦆🦆🦆🦆🦆🦆 thisisalongblob\x00withnullbytes 0010001001011100010101011010111 DUCK_DUCK_ENUM enum_0 enum_0 [] [] [] [] [] [🦆🦆🦆🦆🦆🦆, goose, NULL] -true 127 32767 2147483647 9223372036854775807 255 65535 4294967295 2000-01-01 24:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 999.9 99999.9999 999999999999.999999 9999999999999999999999999999.9999999999 ffffffff-ffff-ffff-ffff-ffffffffffff 83 years 3 months 999 days 00:16:39.999999 goo se \x00\x00\x00a 10101 GOOSE enum_299 enum_69999 [42, 999, NULL, NULL, -42] [42.0, nan, inf, -inf, NULL, -42.0] [1970-01-01, infinity, -infinity, NULL, 2022-05-12] [1970-01-01 00:00:00, infinity, -infinity, NULL, 2022-05-12 16:23:45] [1970-01-01 00:00:00+00, infinity, -infinity, NULL, 2022-05-12 23:23:45+00] [🦆🦆🦆🦆🦆🦆, goose, NULL] +true 127 32767 2147483647 9223372036854775807 255 65535 4294967295 2000-01-01 24:00:00 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 2000-01-01 01:02:03 00:00:00+15:00 2000-01-01 01:02:03 999.9 99999.9999 999999999999.999999 9999999999999999999999999999.9999999999 ffffffff-ffff-ffff-ffff-ffffffffffff 83 years 3 months 999 days 00:16:39.999999 goo se \x00\x00\x00a 10101 GOOSE enum_299 enum_69999 [42, 999, NULL, NULL, -42] [42.0, nan, inf, -inf, NULL, -42.0] [1970-01-01, infinity, -infinity, NULL, 2022-05-12] ['1970-01-01 00:00:00', infinity, -infinity, NULL, '2022-05-12 16:23:45'] ['1970-01-01 00:00:00+00', infinity, -infinity, NULL, '2022-05-12 23:23:45+00'] [🦆🦆🦆🦆🦆🦆, goose, NULL] NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # filter pushdown diff --git a/test/sql/storage/attach_types_lists.test b/test/sql/storage/attach_types_lists.test index d32320b42..7c177bcf4 100644 --- a/test/sql/storage/attach_types_lists.test +++ b/test/sql/storage/attach_types_lists.test @@ -139,21 +139,21 @@ SELECT * FROM lists [] NULL [NULL, string 123, s] -[] -[ 0 ] -[, ] -[a, ] -[a, , b] -[a, }, b] -[a, ", b] -[a, '{}[]()";,\n\\, b] -[[]] -[[, ]] -[[a, ]] -[[a, , b]] -[[a, }, b]] -[[a, ", b]] -[[a, '{}[]()";,\n\\, b], [a, '{}[]()";,\n\\, b]] +[''] +[' 0 '] +['', ''] +[a, ''] +[a, ' ', b] +[a, '}', b] +[a, '"', b] +[a, '\'{}[]()";,\\n\\\\', b] +['[\'\']'] +['[\'\', \'\']'] +['[a, \'\']'] +['[a, \' \', b]'] +['[a, \'}\', b]'] +['[a, \'"\', b]'] +['[a, \'\\\'{}[]()";,\\\\n\\\\\\\\\', b]', '[a, \'\\\'{}[]()";,\\\\n\\\\\\\\\', b]'] # timestamp list foreach type TIMESTAMP TIMESTAMP_MS TIMESTAMP_NS TIMESTAMP_S @@ -176,9 +176,9 @@ INSERT INTO lists VALUES ([NULL, TIMESTAMP '1900-01-01 00:00:00']); query I SELECT * FROM lists ---- -[2010-01-01 01:23:45, infinity, -infinity] +['2010-01-01 01:23:45', infinity, -infinity] [] NULL -[NULL, 1900-01-01 00:00:00] +[NULL, '1900-01-01 00:00:00'] endloop diff --git a/test/sql/storage/attach_types_macaddr.test b/test/sql/storage/attach_types_macaddr.test index fda92627a..c2859aa44 100644 --- a/test/sql/storage/attach_types_macaddr.test +++ b/test/sql/storage/attach_types_macaddr.test @@ -45,7 +45,7 @@ query IIIII SELECT * FROM pg_complex_types_mix ---- 0 -[08:00:2b:01:02:03] +['08:00:2b:01:02:03'] hello world [string, list, NULL] \x00\xFF diff --git a/test/sql/storage/attach_types_struct.test b/test/sql/storage/attach_types_struct.test index d1e05fed5..4a65d9a9a 100644 --- a/test/sql/storage/attach_types_struct.test +++ b/test/sql/storage/attach_types_struct.test @@ -46,7 +46,7 @@ query I SELECT * FROM my_composite_tbl ---- {'id': 42, 'name': test 123} -{'id': 43, 'name': )} +{'id': 43, 'name': ')'} {'id': 100, 'name': xxx} query II @@ -148,5 +148,5 @@ query I SELECT * FROM my_composite_tbl ---- {'id': 42, 'children': [{'id': 43, 'names': [a, b]}]} -{'id': 10, 'children': [{'id': 20, 'names': [a, , '{}[]()";,\n\\, b]}, {'id': 30, 'names': [(, """""""""""", )]}]} -{'id': 10, 'children': [{'id': 20, 'names': [a, b]}, {'id': 30, 'names': NULL}, {'id': 40, 'names': [}, ", NULL]}, {'id': 50, 'names': [, a, )]}, {'id': NULL, 'names': NULL}]} +{'id': 10, 'children': [{'id': 20, 'names': [a, '', '\'{}[]()";,\\n\\\\', b]}, {'id': 30, 'names': ['(', '""""""""""""', ')']}]} +{'id': 10, 'children': [{'id': 20, 'names': [a, b]}, {'id': 30, 'names': NULL}, {'id': 40, 'names': ['}', '"', NULL]}, {'id': 50, 'names': ['', a, ')']}, {'id': NULL, 'names': NULL}]}