Skip to content

v1.0.0-rc.16

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Dec 18:17
· 1 commit to main since this release
2182fe0

Added

  • Manual commit mode (#219) and the manual_commit capability: with
    manual_commit on execute_query/execute_query_batch, the plugin sends
    BEGIN before a session's first statement and keeps the connection pinned
    until the new commit_session or rollback_session RPC ends the
    transaction. get_session_state reports whether a session holds one. A
    connection whose COMMIT/ROLLBACK failed is closed instead of returning to
    the pool. Inert until the host sends manual_commit (tabularis#1752).

Changed

  • read_rows reads every column that is not a native JSON type as the
    server's own ::text output instead of decoding PostgreSQL's binary format
    in the plugin (#225, #227). Native types are unchanged: bool,
    int2/int4/int8, oid, float4/float8 (NaN/±Infinity as
    strings), bytea (full base64), text/varchar/bpchar/name, uuid.
    money reads as ::numeric::text ("123.45"). Contract changes:

    • arrays, ranges, multiranges and composites are PostgreSQL text strings
      ("{{1,2},{3,4}}", "[2:3]={1,2}", "(1,2)"), not JSON arrays or objects;
    • timestamptz is read in UTC with a +00 offset (was +00:00);
    • interval follows IntervalStyle = postgres (14 months reads
      1 year 2 mons);
    • json/jsonb is the server's exact text, so 1e400, wide numbers and
      json duplicate keys survive;
    • hstore reads as its text form ("a"=>"1"), not a JSON object;
    • a zero-row result now reports its columns.

    The read pins DateStyle, IntervalStyle, extra_float_digits,
    bytea_output and TimeZone with SET LOCAL, so a connection's startup
    script does not change the text. The binary lossless decoders (PgNumeric,
    the full-precision temporal decoders, PgIntervalText, PgMoneyText, the
    lossless array decoder) are removed.

  • insert_records, insert_record and update_record cast a value that no
    earlier binding step recognizes to the column's schema-qualified type
    (CAST($N AS public.point2d)), so composites, arrays with lower bounds,
    user-defined ranges and hstore text write back. jsonb[] arrays may
    contain JSON objects (#225, #227).

Fixed

  • read_rows: multi-dimensional arrays, array lower bounds, 1e400 and
    wide jsonb numbers, json duplicate keys, tstzrange offsets and
    interval normalization now match the server (#225, #227). These were
    silent nulls or changed values.
  • read_rows one-shot reads always end with ROLLBACK, so a query that sets
    a session setting (set_config(…, false)) can no longer leak it into the
    pooled connection (#225).
  • read_rows behind a transaction pooler runs on a one-shot connection and
    starts with DEALLOCATE ALL, so describing the query cannot fail with
    42P05 prepared statement "sN" already exists (#227).
  • read_rows accepts a statement ending in a -- comment, a block comment
    or ; on the session path (select 1 -- c\n) (#225).
  • read_rows rejects a negative or non-integer limit with -32602 instead
    of using the default of 1000 (#225).
  • A text-family column keeps its value as is: a JSON-array-shaped string
    ([1,2,3]), a UUID-shaped hash, POINT(…) or ST_…(…) is no longer
    rewritten into an array, a uuid, a geometry or raw SQL (#227).
  • A bytea column accepts only the BLOB: wire format. Any other string,
    such as an unresolved BLOB_FILE_REF: or corrupt base64, is an error (#227).
  • The read_rows cursor no longer over-rewinds on a full batch, which
    duplicated rows across pages (#220, #221).
  • read_rows returns NaN/Infinity, date/timestamp infinity,
    24:00:00 and JSON null instead of SQL null, and money as decimal
    text instead of integer cents (#220, #221).
  • insert_records casts types that have no text assignment cast (inet,
    cidr, macaddr, xml, bit, tsvector, geometric and range types),
    writes JSON strings into json/jsonb, uses the column length for
    bit(n), and decodes the BLOB: format only for bytea columns (#220,
    #221, #222, #223).
  • A session cursor rejects a different query under the same session_id
    instead of returning the old cursor's rows (#220, #221).
  • get_columns: is_generated for stored generated and ALWAYS identity
    columns (not BY DEFAULT identity, which accepts values — #224, #226),
    datetime_precision, full_type, domain base types, and materialized
    view columns (#220, #221).
  • Binding errors no longer echo row values (#220, #221).

Known limitations

  • money[], and money inside a composite, read in the server's locale
    form ({"$1,234.50"}): only a scalar money column is read as
    ::numeric::text. Copying such a value to a server with a different
    lc_monetary can misparse or fail.
  • A user-defined composite named like a built-in type (myschema.date,
    myschema.box) is cast to the built-in type on insert, so the write
    fails (column … is of type myschema.date but expression is of type date). Pre-existing.