Skip to content

Releases: PostgREST/postgrest

v12.0.3

09 May 22:30
6a506d1
Compare
Choose a tag to compare

Fixed

devel

04 May 19:36
d03b321
Compare
Choose a tag to compare
devel Pre-release
Pre-release

Added

  • #2887, Add Preference max-affected to limit affected resources - @taimoorzaeem
  • #3171, Add an ability to dump config via admin API - @SkyWriter
  • #3061, Apply all function settings as transaction-scoped settings - @taimoorzaeem
  • #3171, #3046, Log schema cache stats to stderr - @steve-chavez
  • #3210, Dump schema cache through admin API - @taimoorzaeem
  • #2676, Performance improvement on bulk json inserts, around 10% increase on requests per second by removing json_typeof from write queries - @steve-chavez
  • #3214, Log connection pool events on log-level=info - @steve-chavez
  • #3435, Add log-level=debug, for development purposes - @steve-chavez
  • #1526, Add /metrics endpoint on admin server - @steve-chavez
    • Exposes connection pool metrics, schema cache metrics
  • #3404, Show the failed MESSAGE or DETAIL in the details field of the PGRST121 (could not parse RAISE 'PGRST') error - @laurenceisla
  • #3404, Show extra information in the PGRST121 (could not parse RAISE 'PGRST') error - @laurenceisla
    • Shows the failed MESSAGE or DETAIL in the details field
    • Shows the correct JSON format in the hints field
  • #3340, Log when the LISTEN channel gets a notification - @steve-chavez
  • #3184, Log full pg version to stderr on connection - @steve-chavez

Fixed

Deprecated

Documentation

  • #3289, Add dark mode. Can be toggled by a button in the bottom right corner. - @laurenceisla

v12.0.2

20 Dec 23:46
Compare
Choose a tag to compare

Fixed

v12.0.1

13 Dec 00:44
Compare
Choose a tag to compare

Fixed

  • #3054, Fix not allowing special characters in JSON keys - @laurenceisla
  • #2344, Replace JSON parser error with a clearer generic message - @develop7
  • #3100, Add missing in-database configuration option for jwt-cache-max-lifetime - @laurenceisla
  • #3089, The any media type handler now sets Content-Type: application/octet-stream by default instead of Content-Type: application/json - @steve-chavez

v12.0.0

02 Dec 01:09
Compare
Choose a tag to compare

Features

API

Authentication

Connection Pool

Errors

Observability

Transactions

Fixes

API

  • Remove unnecessary count on RPC returning single row by @steve-chavez in #3015

  • HTTP status responses for upserts by @taimoorzaeem in #2926

    • PUT returns 201 instead of 200 when rows are inserted
    • POST with Prefer: resolution=merge-duplicates returns 200 instead of 201 when no rows are inserted

Observability

  • Transaction-Scoped Settings are now shown clearly in the Postgres logs by @laurenceisla in #3032

    • Shows set_config('pgrst.setting_name', $1) instead of setconfig($1, $2)
    • Does not apply to role settings and app.settings.*
  • Display an actual TCP port app is bound to by @develop7 in #3034

  • Fix Acquision Timeout errors logging to stderr when log-level=crit by @laurenceisla in #3067

Breaking changes

API

Transactions

New Contributors

Full Changelog: v11.2.2...v12.0.0

v11.2.2

25 Oct 17:35
f884da7
Compare
Choose a tag to compare

Fixed

v11.2.1

04 Oct 12:38
Compare
Choose a tag to compare

Maintenance Release

v11.2.1 addresses bugs introduced in v11.2.0. Also PostgreSQL 16 is now tested and confirmed to work.

What is fixed

API

Schema Cache

Resource Embedding

  • #2800, Fix not including to-one embed resources that had a NULL value in any of the selected fields when doing null filtering on them - @laurenceisla
  • #2846, Fix error when requesting Prefer: count=<type> and doing null filtering on embedded resources - @laurenceisla
  • #2963, Fix RPCs not embedding correctly when using overloaded functions for computed relationships - @laurenceisla

Authentication

Connection Pool

Full Changelog: v11.2.0...v11.2.1

v11.2.0

10 Aug 14:13
Compare
Choose a tag to compare

Overview

PostgREST serves a RESTful API from any existing PostgreSQL database.

v11.2.0 brings you the possibility of using PostgreSQL domains and casts to change how your data is presented to web users. We call this feature "domain representations" and it holds some advantages over views.

-- having a uuid domain and a table
create domain app_uuid as uuid;

create table profiles(
  id   app_uuid
, name text
);

-- we define a function to convert the uuid domain to base64
create or replace function json(app_uuid) returns json as $$
  select to_json(encode(uuid_send($1),'base64'));
$$ language sql immutable;

-- and use the function for an implicit cast from domain to json 
create cast (app_uuid as json) with function json(app_uuid) as implicit;

-- the format changes when requesting JSON at the API level
curl "http://localhost:3000/profiles" \
  -H "Accept: application/json"

[{"id":"hGxP/ZLOTeeNEY4pkp9OxA==","name":"John Doe"}]

-- while the data is kept as is at the database level
select * from profiles;

                  id                  |   name
--------------------------------------+----------
 846c4ffd-92ce-4de7-8d11-8e29929f4ec4 | John Doe

Domain representations also allow you to change the format of the request payload and the format of the filters values. Check the Domain Representations docs for more details.

What is new

API

  • Domain representations by @aljungberg in #2523
    • Allows for flexible API output formatting and input parsing on a per-column type basis using regular SQL functions configured in the database
    • Enables greater flexibility in the form and shape of your APIs, both for output and input, making PostgREST a more versatile general-purpose API server
    • Examples include base64 encode/decode your binary data (like a bytea column containing an image), choose whether to present a timestamp column as seconds since the Unix epoch or as an ISO 8601 string, or represent fixed precision decimals as strings, not doubles, to preserve precision
    • ...and accept the same in POST/PUT/PATCH by configuring the reverse transformation(s)
    • Other use-cases include custom representation of enums, arrays, nested objects, CSS hex colour strings, gzip compressed fields, metric to imperial conversions, and much more
    • Works when using the select parameter to select only a subset of columns, embedding through complex joins, renaming fields, with views and computed columns
    • Works when filtering on a formatted column without extra indexes by parsing to the canonical representation
    • Works for data RETURNING operations, such as requesting the full body in a POST/PUT/PATCH with Prefer: return=representation
    • Works for batch updates and inserts
    • Completely optional, define the functions in the database and they will be used automatically everywhere
    • Data representations preserve the ability to write to the original column and require no extra storage or complex triggers (compared to using GENERATED ALWAYS columns)
    • Note: data representations require Postgres 10 (Postgres 11 if using IN predicates); data representations are not implemented for RPC

Admin

Resource Embedding

Resource Representation

Tables and Views

What is fixed

Auth

API

  • Fix OPTIONS not accepting all available media types by @steve-chavez in #2821
  • Fix Prefer: missing=default with DOMAIN default values by @steve-chavez in #2840
  • Fix HEAD unnecessarily executing aggregates by @steve-chavez in #2849
  • Fix unused index on jsonb/jsonb arrow filter and order (/bets?data->>contractId=eq.1 and /bets?order=data->>contractId) by @steve-chavez in #2594
  • Fix character and bit columns with fixed length not inserting/updating properly by @laurenceisla in #2861
    • Fixes the error "value too long for type character(1)" when the char length of the column was bigger than one.
  • Fix null filtering on embedded resource when using a column name equal to the relation name by @steve-chavez in #2862
  • Fix function parameters of type character and bit not ignoring length by @laurenceisla in #1586
    • Fixes the error "value too long for type character(1)" when the char length of the parameter was bigger than one.
  • Fix error when a function returns RECORD or SET OF RECORD by @laurenceisla in #2881

Misc

Deprecated

Resource Embedding

  • Deprecate resource embedding target disambiguation by @steve-chavez in #2863
    • The /table?select=*,other!fk(*) must be used to disambiguate
    • The server aids in choosing the !fk by sending a hint on the error whenever an ambiguous request happens.

New Contributors

Full Changelog: v11.1.0...v11.2.0

v11.1.0

08 Jun 00:17
Compare
Choose a tag to compare

Added

  • #2786, Limit idle postgresql connection lifetime - @robx
    • New option db-pool-max-idletime (default 30s).
    • This is equivalent to the old option db-pool-timeout of PostgREST 10.0.0.
    • A config alias for db-pool-timeout is included.
  • #2703, Add pre-config function - @steve-chavez
    • New config option db-pre-config(empty by default)
    • Allows using the in-database configuration without SUPERUSER
  • #2781, When db-channel-enabled is false, start automatic connection recovery on a new request when pool connections are closed with pg_terminate_backend - @steve-chavez
    • Mitigates the lack of LISTEN/NOTIFY for schema cache reloading on read replicas.

Fixed

v11.0.1

28 Apr 02:51
Compare
Choose a tag to compare

Fixed

  • #2762, Fixes "permission denied for schema" error during schema cache load - @steve-chavez
  • #2756, Fix bad error message on generated columns when using Prefer: missing=default - @steve-chavez
  • #1139, Allow a 30 second skew for JWT validation - @steve-chavez
    • It used to be 1 second, which was too strict