You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#103 rebuilt information_schema_columns (migration v29) and populated several columns that were previously NULL. Two are populated with values that don't match PostgreSQL. Both were NULL before, so neither is a regression — but a wrong value is worse than a missing one for a client that trusts it.
src/migration/registry.rs — the view emits the character length directly.
PostgreSQL reports the octet length: 4× the character length for UTF-8, and 1073741824 for unbounded text.
column
pgsqlite
PostgreSQL
varchar(50)
50
200
text
NULL
1073741824
Low practical impact — few clients read this column.
2. udt_name carries the SQL-standard data_type spelling
The view sets udt_name from __pgsqlite_pg_data_type(...), which returns the SQL-standard spelling. PostgreSQL's udt_name is the internal type name:
column
pgsqlite
PostgreSQL
integer
integer
int4
varchar(50)
character varying
varchar
text[]
ARRAY
_text
This one has real consequences. udt_name is the standard way to recover the element type of an ARRAY column — data_type reports only the useless ARRAY for every array type, so _text vs _int4 is the only signal distinguishing them. SQLAlchemy and Django both read it for that purpose, and neither will recognize the current values.
The fix is a separate mapping alongside pg_column_info in src/catalog/column_type_info.rs (pg type string → internal name), exposed as a UDF the way the existing four are, rather than reusing __pgsqlite_pg_data_type.
Notes
numeric_precision_radix had the same shape of bug and was fixed in fix: namespace-aware information_schema served from SQLite (#88) #103 — it now reports 2 for binary-precision types and 10 only for numeric/decimal, matching _pg_numeric_precision_radix(). Worth using as the pattern.
tests/information_schema_namespace_test.rs already has the eight-column type-fidelity table to extend.
Problem
#103 rebuilt
information_schema_columns(migration v29) and populated several columns that were previouslyNULL. Two are populated with values that don't match PostgreSQL. Both wereNULLbefore, so neither is a regression — but a wrong value is worse than a missing one for a client that trusts it.1.
character_octet_lengthequalscharacter_maximum_lengthsrc/migration/registry.rs— the view emits the character length directly.PostgreSQL reports the octet length: 4× the character length for UTF-8, and
1073741824for unboundedtext.varchar(50)textLow practical impact — few clients read this column.
2.
udt_namecarries the SQL-standarddata_typespellingThe view sets
udt_namefrom__pgsqlite_pg_data_type(...), which returns the SQL-standard spelling. PostgreSQL'sudt_nameis the internal type name:integerintegerint4varchar(50)character varyingvarchartext[]ARRAY_textThis one has real consequences.
udt_nameis the standard way to recover the element type of an ARRAY column —data_typereports only the uselessARRAYfor every array type, so_textvs_int4is the only signal distinguishing them. SQLAlchemy and Django both read it for that purpose, and neither will recognize the current values.The fix is a separate mapping alongside
pg_column_infoinsrc/catalog/column_type_info.rs(pg type string → internal name), exposed as a UDF the way the existing four are, rather than reusing__pgsqlite_pg_data_type.Notes
numeric_precision_radixhad the same shape of bug and was fixed in fix: namespace-aware information_schema served from SQLite (#88) #103 — it now reports 2 for binary-precision types and 10 only fornumeric/decimal, matching_pg_numeric_precision_radix(). Worth using as the pattern.tests/information_schema_namespace_test.rsalready has the eight-column type-fidelity table to extend.Split out of #88 / #103.