diff --git a/postgres_scanner.cpp b/postgres_scanner.cpp index 77f690a1d..b526b2d9e 100644 --- a/postgres_scanner.cpp +++ b/postgres_scanner.cpp @@ -293,6 +293,7 @@ ORDER BY attnum; info.type_info.typtype = res->GetString(row, 5); info.typelem = res->GetInt64(row, 6); + info.elem_info.nspname = res->GetString(row, 2); info.elem_info.typname = res->GetString(row, 7); info.elem_info.typlen = res->GetInt64(row, 8); info.elem_info.typtype = res->GetString(row, 9); @@ -835,11 +836,6 @@ static void ProcessValue(const LogicalType &type, const PostgresTypeInfo *type_i continue; } - if (elem_info->typlen > 0 && ele_len != elem_info->typlen) { - throw InvalidInputException( - "Expected to read a Postgres list value of length %d, but only have size %d", elem_info->typlen, - ele_len); - } ProcessValue(ListType::GetChildType(type), elem_info, atttypmod, 0, nullptr, value_ptr, ele_len, child_vec, child_offset + child_idx); value_ptr += ele_len; diff --git a/test/all_pg_types.sql b/test/all_pg_types.sql index 3284a5a3b..e455df253 100644 --- a/test/all_pg_types.sql +++ b/test/all_pg_types.sql @@ -27,6 +27,8 @@ CREATE TABLE pg_datetypes ( timestamptz_col timestamptz ); +CREATE TYPE enum_type AS ENUM ('foo', 'bar', 'baz'); + CREATE TABLE pg_numarraytypes ( bool_col _bool, smallint_col _int2, @@ -54,6 +56,9 @@ CREATE TABLE pg_datearraytypes ( timestamp_col _timestamp, timestamptz_col _timestamptz); +CREATE TABLE pg_enumarraytypes ( + enum_col _enum_type); + INSERT INTO pg_numtypes (bool_col, smallint_col, integer_col, bigint_col, float_col, double_col, decimal_col, udecimal_col) VALUES (false, 0, 0, 0, 0, 0, 0, 0), (false, -42, -42, -42, -42.01, -42.01, -42.01, -42.01), @@ -80,3 +85,6 @@ VALUES ('{a, Z, NULL}', '{a, Z, NULL}', '{aaaa, ZZZZ, NULL}', '{aaaa, ZZZZ, NULL insert into pg_datearraytypes (date_col, time_col,timetz_col, timestamp_col, timestamptz_col) VALUES ('{2019-11-26, 2021-03-01, NULL}','{14:42:43, 12:45:01, NULL}','{14:42:43, 12:45:01, NULL}','{2019-11-26T12:45:01, 2021-03-01T12:45:01, NULL}','{2019-11-26T12:45:01, 2021-03-01T12:45:01, NULL}'), (NULL, NULL, NULL, NULL, NULL); + +insert into pg_enumarraytypes (enum_col) +VALUES ('{}'), ('{foo}'), ('{foo, bar}'), ('{foo, bar, baz}'), ('{foo, bar, baz, NULL}'), (NULL);