Skip to content

v10.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 19 Aug 04:52
· 1335 commits to main since this release

Added

  • #1933, #2109, Add a minimal health check endpoint - @steve-chavez
    • For enabling this, the admin-server-port config must be set explictly
    • A <host>:<admin_server_port>/live endpoint is available for checking if postgrest is running on its port/socket. 200 OK = alive, 503 = dead.
    • A <host>:<admin_server_port>/ready endpoint is available for checking a correct internal state(the database connection plus the schema cache). 200 OK = ready, 503 = not ready.
  • #1988, Add the current user to the request log on stdout - @DavidLindbom, @wolfgangwalther
  • #1823, Add the ability to run postgrest without any configuration. - @wolfgangwalther
    • #1991, Add the ability to run without db-uri using libpq's PG environment variables to connect. - @wolfgangwalther
    • #1769, Add the ability to run without db-schemas, defaulting to db-schemas=public. - @wolfgangwalther
    • #1689, Add the ability to run without db-anon-role disabling anonymous access. - @wolfgangwalther
  • #1543, Allow access to fields of composite types in select=, order= and filters through JSON operators -> and ->>. - @wolfgangwalther
  • #2075, Allow access to array items in ?select=, ?order= and filters through JSON operators -> and ->>. - @wolfgangwalther
  • #2156, #2211, Allow applying limit/offset to UPDATE/DELETE to only affect a subset of rows - @steve-chavez
    • It requires an explicit order on a unique column(s)
  • #1917, Add error codes with the "PGRST" prefix to the error response body to differentiate PostgREST errors from PostgreSQL errors - @laurenceisla
  • #1917, Normalize the error response body by always having the detail and hint error fields with a null value if they are empty - @laurenceisla
  • #2176, Errors raised with SQLSTATE now include the message and the code in the response body - @laurenceisla
  • #2236, Support POSIX regular expression operators for row filtering - @enote-kane
  • #2202, Allow returning XML from RPCs - @fjf2002
  • #2268, Allow returning XML from single-column queries - @fjf2002
  • #2300, RPC POST for function w/single unnamed XML param #2300 - @fjf2002
  • #1564, Allow geojson output by specifying the Accept: application/geo+json media type - @steve-chavez
    • Requires postgis >= 3.0
    • Works for GET, RPC, POST/PATCH/DELETE with Prefer: return=representation.
    • Resource embedding works and the embedded rows will go into the properties key
    • In case of multiple geometries in the same table, you can choose which one will go into the geometry key with the usual ?select query parameter.
  • #1082, Add security definitions to the OpenAPI output - @laurenceisla
  • #2378, Support http OPTIONS method on RPC and root path - @steve-chavez
  • #2354, Allow getting the EXPLAIN plan of a request by using the Accept: application/vnd.pgrst.plan header - @steve-chavez
    • Only allowed if the db-plan-enabled config is set to true
    • Can generate the plan for different media types using the for parameter: Accept: application/vnd.pgrst.plan; for="application/vnd.pgrst.object"
    • Different options for the plan can be used with the options parameter: Accept: application/vnd.pgrst.plan; options=analyze|verbose|settings|buffers|wal
    • The plan can be obtained in text or json by using different media type suffixes: Accept: application/vnd.pgrst.plan+text and Accept: application/vnd.pgrst.plan+json.
  • #2144, Support computed relationships which allow extending and overriding relationships for resource embedding - @steve-chavez, @wolfgangwalther
  • #1984, Detect one-to-one relationships for resource embedding - @steve-chavez
    • Detected when there's a foreign key with a unique constraint or when a foreign key is also a primary key

Fixed

  • #2058, Return 204 No Content without Content-Type for PUT - @wolfgangwalther
  • #2107, Clarify error for failed schema cache load. - @steve-chavez
    • From Database connection lost. Retrying the connection to Could not query the database for the schema cache. Retrying.
  • #1771, Fix silently ignoring filter on a non-existent embedded resource - @steve-chavez
  • #2152, Remove functions, which are uncallable because of unnamend arguments from schema cache and OpenAPI output. - @wolfgangwalther
  • #2145, Fix accessing json array fields with -> and ->> in ?select= and ?order=. - @wolfgangwalther
  • #2155, Ignore max-rows on POST, PATCH, PUT and DELETE - @steve-chavez
  • #2254, Fix inferring a foreign key column as a primary key column on views - @steve-chavez
  • #2070, Restrict generated many-to-many relationships - @steve-chavez
    • Only adds many-to-many relationships when: a table has FKs to two other tables and these FK columns are part of the table's PK columns.
  • #2278, Allow casting to types with underscores and numbers(e.g. select=oid_array::_int4) - @steve-chavez
  • #2277, #2238, #1643, Prevent views from breaking one-to-many/many-to-one embeds when using column or FK as target - @steve-chavez
    • When using a column or FK as target for embedding(/tbl?select=*,col-or-fk(*)), only tables are now detected and views are not.
    • You can still use a column or an inferred FK on a view to embed a table(/view?select=*,col-or-fk(*))
  • #2317, Increase the db-pool-timeout to 1 hour to prevent frequent high connection latency - @steve-chavez
  • #2341, The search path now correctly identifies schemas with uppercase and special characters in their names (regression) - @laurenceisla
  • #2364, "404 Not Found" on nested routes and "405 Method Not Allowed" errors no longer start an empty database transaction - @steve-chavez
  • #2342, Fix inaccurate result count when an inner embed was selected after a normal embed in the query string - @laurenceisla
  • #2376, OPTIONS requests no longer start an empty database transaction - @steve-chavez
  • #2395, Allow using columns with dollar sign($) without double quoting in filters and select - @steve-chavez
  • #2410, Fix loop crash error on startup in Postgres 15 beta 3. Log: "UNION types "char" and text cannot be matched". - @yevon
  • #2397, Fix race conditions managing database connection helper - @robx
  • #2269, Allow limit=0 in the request query to return an empty array - @gautam1168, @laurenceisla

Changed

  • #2001, Return 204 No Content without Content-Type for RPCs returning VOID - @wolfgangwalther
    • Previously, those RPCs would return "null" as a body with Content-Type: application/json.
  • #2156, limit/offset now limits the affected rows on UPDATE/DELETE - @steve-chavez
    • Previously, limit/offset only limited the returned rows but not the actual updated rows
  • #2155, max-rows is no longer applied on POST/PATCH/PUT/DELETE returned rows - @steve-chavez
    • This was misleading because the affected rows were not really affected by max-rows, only the returned rows were limited
  • #2070, Restrict generated many-to-many relationships - @steve-chavez
    • A primary key that contains the foreign key columns is now needed for generating many-to-many relationships.
  • #2277, Views now are not detected when embedding using the column or FK as target (/view?select=*,column(*)) - @steve-chavez
    • This embedding form was easily made ambiguous whenever a new view was added.
    • You can use computed relationships to keep this embedding form working
  • #2312, Using Prefer: return=representation no longer returns a Location header - @laurenceisla
  • #1984, For the cases where one to one relationships are detected, json objects will be returned instead of json arrays of length 1
    • If you wish to override this behavior, you can use computed relationships to return arrays again