jimmy
77ab8f83ac
feat: expose unique columns and many-to-many markers in OpenAPI
...
Add unique constraint and many-to-many relationship metadata to the
generated OpenAPI spec so clients can render them.
- Store unique constraints on Table as tableUniqueCols (mirroring
tablePKCols) instead of denormalizing them onto each Column.
- Compute unique constraints via a per-table tbl_unique_cols CTE in
tablesSqlQuery.
- Annotate unique columns and composite unique constraints in property
descriptions, and emit m2m markers in table descriptions.
2026-08-20 18:03:43 +02:00
jimmy
4a5d626112
restrict openapi spec based on sql grants
2026-08-15 21:41:45 +02:00
steve-chavez
ca4a6d9e99
Revert "add: configs as json GUC for db-root-spec"
...
This reverts commit f34ca15e84 .
2026-08-04 00:50:18 -05:00
steve-chavez
f34ca15e84
add: configs as json GUC for db-root-spec
...
These are needed for a complete OpenAPI spec
2026-08-03 23:41:03 -05:00
Taimoor Zaeem
c03ac09dbb
test: move prepared statements config related tests to spec tests
...
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
2026-07-07 23:32:40 +05:00
Taimoor Zaeem
44edf962d8
test: move db-pre-config with pg reserved word func to spec tests
...
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
2026-07-07 23:32:40 +05:00
Taimoor Zaeem and Steve Chavez
b6c12abf0e
test: move http header related tests from io tests to spec tests
...
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
2026-06-16 13:13:51 -05:00
Laurence Isla and Wolfgang Walther
5f6f7dca44
fix: unexpected results when embedding the same table twice
2026-04-29 09:10:48 +00:00
Laurence Isla
d10c779fc6
perf: optimize count=exact when there's no limits, offsets or db-max-rows
2026-01-28 18:43:44 -05:00
Joel Jakobsson and GitHub
fd6a3bdccf
fix: hasSingleUnnamedParam incorrectly matching named parameters
...
The hasSingleUnnamedParam function was only checking the parameter type
but not whether the parameter actually had no name. This caused functions
with a single NAMED parameter (e.g., `foo(data json)`) to incorrectly
match the single-param fallback mode.
The result was a confusing PostgreSQL error 42883 "function does not exist"
instead of a clean PGRST202 error explaining that no matching function
was found.
Added ppName == mempty check so functions with named parameters don't
incorrectly match the single-param fallback.
2025-12-15 15:34:48 -05:00
Steve Chavez and GitHub
9f056ac756
fix: not logging tx variables and pre-request ( #4341 )
...
Addresses the first item on https://github.com/PostgREST/postgrest/issues/3934
2025-09-19 12:16:10 -05:00
Laurence Isla
a2892ab1dd
fix: regression that makes fts not work on domain types based on tsvector
2025-06-16 16:53:29 +00:00
Taimoor Zaeem and GitHub
2eb9e4a8a4
test: upserts with case sensitive table and sequence name ( #4131 )
...
Closes #3712 .
2025-06-07 12:39:50 -05:00
Taimoor Zaeem and Steve Chavez
dc46aea15e
fix: max-affected preference not failing for rpc with strict handling
2025-06-03 14:31:17 -05:00
Taimoor Zaeem and Steve Chavez
5f9e0a2739
test: add missing tests for max-affected preference with rpc
2025-05-22 12:23:52 -05:00
Taimoor Zaeem and Steve Chavez
8b63ea82ec
test: add test for duplicate entries in pg_description with same OID
2025-05-14 09:31:48 -05:00
Laurence Isla and GitHub
0b618d0bef
feat: allow spreading one-to-many and many-to-many embedded resources
...
* Note: Aggregates are not implemented
2025-03-24 14:45:56 +00:00
Taimoor Zaeem and Steve Chavez
fc35d6d0f8
fix: Fix ordering with mutation queries
2025-03-17 14:13:34 +01:00
Steve Chavez and GitHub
307692c325
break: remove limited updated/delete feature ( #3907 )
...
BREAKING CHANGE
As agreed on https://github.com/PostgREST/postgrest/issues/3013#issuecomment-1770186262 ,
this removes the limited update/delete feature.
The feature was complicated, largely unused and caused other bugs in
mutations.
It was added in #2195 and #2211 .
2025-02-12 14:48:08 -05:00
Laurence Isla
b7d0a1f68c
feat: apply to_tsvector() explicitly to the full-text search filtered column, only if it's not of tsvector type
2025-01-28 19:14:54 -05:00
M. Taimoor Zaeem and Steve Chavez
56c14474da
fix: insert with missing=default uses column default before using domain default
2024-12-23 15:27:40 -05:00
Laurence Isla
9c863dbddc
test: add tests for bulk upserts with surrogate keys
2024-11-15 12:05:14 -05:00
Wolfgang Walther and Wolfgang Walther
48aabeb473
nix: add postgrest-with-postgresql-17
...
PostgreSQL 17 has been released:
https://www.postgresql.org/about/news/postgresql-17-released-2936/
Let's make sure CI runs with it, too.
2024-11-12 21:13:31 +01:00
Laurence Isla
e9244f1a4f
fix: a nested spread embedding now correctly groups by the fields of its top parent relationship
2024-08-21 16:56:32 -05:00
Wolfgang Walther and Wolfgang Walther
50bdb6a3de
fix: Embed One-to-One relationship with different column order properly
2024-07-13 22:26:36 +02:00
Wolfgang Walther and Wolfgang Walther
bb96c2dc74
feat: Drop support for pg 11
...
PostgreSQL 11 is EOL since November 2023.
2024-06-15 17:23:34 +02:00
Wolfgang Walther and Wolfgang Walther
126178642b
feat: Drop support for pg 10
2024-06-15 17:23:34 +02:00
Wolfgang Walther and Wolfgang Walther
daa77d17aa
feat: Drop support for pg 9.6
2024-06-15 17:23:34 +02:00
Taimoor Zaeem and Steve Chavez
5cc32c7f87
fix: fix incorrect 413 error on pg 54* errors
2024-05-20 18:59:33 -05:00
Taimoor Zaeem and Steve Chavez
21bc48ad9a
fix: fix wrong 503 Service Unavailable on pg error 53400
2024-05-06 07:54:11 -05:00
Taimoor Zaeem and Steve Chavez
88abf600c4
fix: fix wrong http status on pg error 42P17 infinite recursion
2024-04-22 13:40:07 -05:00
steve-chavez
fbc4d565ca
refactor: move debounce from AppState to Logger
...
Will allow to capture accurate timeout metrics.
2024-04-12 14:29:39 -05:00
Wolfgang Walther
8ff9f3292e
test: Hide "cast on domain" warnings in spec tests
...
Also removes a few other unused settings which originate from running pg_dump.
2024-02-19 17:49:16 +01:00
Wolfgang Walther
00fbe9ff3e
fix: Avoid casting to table type when select= and media type handler are used
...
Previously using a generic mimetype handler failed when any kind of select= was given, because
we tried to cast the select-result to the original table type. With this change, this cast is
only applied when select=* is given implicitly or explicitly. This is the only case where this
makes sense, because this guarantees that correct columns are selected in the correct order for
this cast to succeed.
Resolves #3160
2024-02-15 19:01:12 +01:00
Wolfgang Walther
2466f4e738
fix: Return 406 instead of 415 for non-acceptable media type
...
415 is for Content-Type and 406 for Accept headers.
2024-02-15 19:01:12 +01:00
steve-chavez
45cabacdcc
fix: wrong subquery error returning as 400 status
2024-02-02 22:08:56 -05:00
steve-chavez
3af63cb94c
fix: empty row on handler function
...
Closes https://github.com/PostgREST/postgrest/issues/3126
2023-12-20 16:18:09 -05:00
steve-chavez
1680a6eed3
fix: aggregates not working for all schemas
...
Closes https://github.com/PostgREST/postgrest/issues/3124
2023-12-20 15:20:18 -05:00
steve-chavez
6b9fde59cd
fix: any handler sets a default application/json
...
Now it sets application/octet-stream as the generic type.
2023-12-12 17:44:07 -05:00
steve-chavez
9fe11249f9
feat: custom SQL handler for the "*/*" media type
2023-11-28 23:14:38 -05:00
Tim Abdulla and GitHub
1c60b50e2e
Add aggregate functions ( #2925 )
...
The aggregate functions SUM(), MAX(), MIN(), AVG(), and COUNT() are now supported.
2023-11-23 14:03:03 -05:00
Taimoor Zaeem and GitHub
3c1a7f2641
feat: add timezone in Prefer header ( #3024 )
...
* increase reloading timeout in io-tests
* increase memory test by 1M
2023-11-13 14:16:27 -05:00
steve-chavez
ed90774f53
test: query the empty string
2023-11-03 12:58:54 -05:00
Laurence Isla
226400a5bc
break:remove the db-use-legacy-gucs config
...
BREAKING CHANGE
All PostgreSQL versions will use JSON GUCs for headers, cookies and JWT claims.
2023-11-02 15:50:22 -05:00
steve-chavez
82b38341bf
feat: sql handlers for custom media types
...
* test text/html and drop HtmlRawOutputSpec.hs
* all tests passing, removed all pendingWith
* make functions compatible with pg <= 12
* move custom media types tests to own spec
* anyelement aggregate
* apply aggregates without a final function
* overriding works
* overriding anyelement with particular agg
* cannot override vendored media types
* plan spec works with custom aggregate
* renamed media types to make clear which ones are overridable
* correct content negotiation with same weight
* text/tab-separated-values media type
* text/csv with BOM plus content-disposition header
2023-10-26 09:04:02 -05:00
Laurence Isla and GitHub
910950dbac
fix: RPCs not embedding correctly when using overloaded functions for computed relationships
2023-10-02 16:00:33 -05:00
steve-chavez
cf7ee67dfe
fix: arrow filter on RPC returning TABLE+composite
2023-09-28 20:26:38 -03:00
Laurence Isla and GitHub
fa182c216e
fix: bug when Null Filtering on embedded resources
...
When doing Null Filtering, the to-one embed resources were not included if they had a NULL value in any of the selected fields.
2023-09-14 21:30:48 -05:00
Taimoor Zaeem and GitHub
07fef25591
feat: allow full response control when raising exceptions
2023-09-01 14:02:03 -05:00
Laurence Isla and GitHub
aa53623aac
fix: error when a function returns RECORD or SETOF RECORD
2023-08-03 20:09:55 -05:00