Repository navigation
Description
Summary
Retest of #222 against merged main at 47cca76 (release build, PostgreSQL 16). #223 fixed most of #222: array specials and timestamps, interval, money[], bit(n), array inserts, BC dates, the JSON round trip (9 of 9 values read and written back identical), and a trailing -- c. This lists what is still wrong. The BY DEFAULT identity regression is a separate, release-blocking issue (see the linked issue).
The host blocks arrays and reads json as text, so none of these corrupt a copy today. They matter for anyone using read_rows / insert_records directly, and for the host once it supports more types.
1. Silent null on read
read_rows returns null with no error, so it cannot be told from SQL NULL.
| Value | Returned |
|---|---|
multi-dimensional array, '{{1,2},{3,4}}'::int[] |
null (whole cell) |
'1e400'::jsonb |
null |
#223 lists the first as a deferred limitation. Please at least return the PostgreSQL text form ({{1,2},{3,4}}) so the value survives. 1e400 is a valid jsonb (stored as a 401-digit number) and ::text returns it exactly.
2. Changed value on read
- Array lower bounds are dropped.
'[2:3]={1,2}'::int[]reads[1, 2]; the server prints[2:3]={1,2}. fix: array lossless extraction, interval, bit(n), JSON round-trip, BC dates (#222) #223 lists this as deferred. jsonbnumbers pass throughf64.12345678901234567890123.5reads as1.2345678901234568e+22, and{"a":12345678901234567890123.5}as{"a":1.2345678901234568e+22}. Known limitation in fix: array lossless extraction, interval, bit(n), JSON round-trip, BC dates (#222) #223 (needsserde_jsonarbitrary_precision).jsonduplicate keys are collapsed ({"a":1,"a":2}reads{"a":2}).tstzrangestill drops the offset. The server prints["2024-01-01 00:00:00+00","2024-02-01 00:00:00+00");read_rowsreturns["2024-01-01 00:00:00", "2024-02-01 00:00:00"). The value is converted to UTC and the zone dropped, which is equivalent while the session zone is UTC, but the text does not match. Writing the read form back does store the right instant (tested with+05).interval '14 months'reads14 mons; the server prints1 year 2 mons. Equal as values, different as text, and the original issue was exact text. (48 hours,1000000 hoursand arrays of intervals are now exact.)
3. insert_records still rejects
jsonb[]:Unsupported array element type.- Composite types:
Cannot bind a JSON object to a non-JSON column.read_rowsemits{"x": 1, "y": 2}.
4. Smaller
- A trailing line comment followed by a newline still breaks the session path.
strip_trailing_line_comment(copy.rs:58) only inspects the text after the last\n, soselect 1 -- cis fixed butselect 1 -- c\n(what a pasted statement usually ends with) fails withDECLARE cursor failed: syntax error at end of input. Trim trailing whitespace before looking for the last line, or scan for a line comment that is the last token. - Session GUC leak on the one-shot path.
select set_config('probe.leak','yes',false)followed byselect current_setting('probe.leak', true)returnsyeson the same backend pid, repeatedly. fix: array lossless extraction, interval, bit(n), JSON round-trip, BC dates (#222) #223's description saysrun_one_shotrunsRESET ALLafterCOMMIT/ROLLBACK;copy.rs:235still says it deliberately does not (to keep the startup script's GUCs andapp.tabularis_base_search_path). If the intent is to clear leaks,DISCARD ALLwould also clear the startup script, so a targeted reset of just the caller's variables is needed, or the description should be corrected. Low risk: the host only sendsSELECThere. limit: -1is accepted and reported aspage_size: 1000. A negative limit should be rejected, like0is clamped.
Verified fixed in #223, for reference
Reads: time[], float4[]/float8[] NaN and Infinity, numeric[] NaN, date[]/timestamp[]/timestamptz[] infinity, timestamp[]/timestamptz[] microseconds and offset, interval and interval[], money[], jsonb string scalars and JSON null. Writes: bit(3)/bit(8)/varbit, timestamptz[], timestamp[], date[], uuid[], numeric[], inet[], int4range[], and BC / year >9999 dates and timestamps in the form read_rows emits.
Activity
aesslinger commentedon Dec 3, 2026
Fix is up in #227. Instead of patching more binary decoders,
read_rowsnow reads every non-native column as the server's own::text. That covers all the read-side items in one change: multi-dimensional arrays, lower bounds,1e400, big jsonb numbers, json duplicate keys, tstzrange offsets and14 months. The write-side items (jsonb[] objects, composites) and the smaller ones (-- c\n, the GUC leak,limit: -1) are also fixed there. Contract changes are listed in the PR body.fix: keep JSON-array-shaped text as is in text columns (#225)
fix: close the copy gaps found in review (#225)
fix: read non-native copy columns as server text, close remaining cop…
chore: release 1.0.0-rc.16 (#228)