You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add: config to emit warning for legacy target names
Adds the `url_use_legacy_target_names` config.
Enabled (default):
* It allows using the resource name in filters,
orders or limits when it has an alias, e.g.
`table?select=alias:target(*)&target.id=eq.1`
* Logs a WARNING with a hint to use the alias
* Returns a Warning header in the response
Disabled:
* It returns an error, only the alias is allowed
* No warnings returned
This feature is deprecated
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,14 @@ All notable changes to this project will be documented in this file. From versio
15
15
- Log schema cache queries timings on `log-level=debug` by @steve-chavez in #4805
16
16
- Add GHC runtime metrics to the metrics endpoint by @mkleczek in #4862
17
17
- Support running the admin server on a unix socket by @wolfgangwalther in #5003
18
+
- Add config `url-use-legacy-target-names` to allow using the embedded table name in filters, orders or limits when it has an alias by @laurenceisla in #4075
18
19
19
20
### Fixed
20
21
21
22
- Shutdown should wait for in flight requests by @mkleczek in #4702
22
23
- Remove automatic transaction retries on `40001 (serialization_failure)` errors to prevent replication lag by @laurenceisla in #3673
23
24
- Fix unexpected results when embedding and filtering the same table more than once by @laurenceisla in #4075
25
+
+ You need to set `url-use-legacy-target-names = false`.
24
26
- If the schema cache fails to reload, PostgREST will no longer stop serving requests and will continue doing so in a "best effort" basis by @mkleczek in #4873#4869
25
27
- Stop reporting 503s errors unnecessarily while the schema cache is loading at startup by @mkleczek in #4880
26
28
- Fix admin server dying silently by @Vlix, @mkleczek, @steve-chavez in #5012
@@ -33,8 +35,6 @@ All notable changes to this project will be documented in this file. From versio
33
35
+ Now fails at startup. Prior to this, it failed with `PGRST205` on requests related to these schemas.
34
36
- Build a static executable for aarch64-linux by @wolfgangwalther in #4193
35
37
- Build the minimal docker image for aarch64-linux by @wolfgangwalther in #4193
36
-
- The name of an embedded table can no longer be used in filters if it has an alias by @laurenceisla in #4075
37
-
+ e.g. `?select=alias:table(*)&table.id=eq.1` is not possible anymore, use `?select=alias:table(*)&alias.id=eq.1` instead.
38
38
- Config `jwt-role-claim-key` now uses RFC 9535 syntax for JSON Path by @taimoorzaeem in #4984
39
39
40
40
#### Changed Syntax for JWT Role Extraction
@@ -49,6 +49,12 @@ The `jwt-role-claim-key` config should be updated according to the following:
Warning: 299 PostgRESTv16 "Embedded resource was referenced by relation name even though it has an alias. This is deprecated and will stop working in a future release. Update `target` to `alias` in query string filters, orders or limits."
1039
+
[...]
1040
+
1041
+
Note that the response includes a deprecation message in the ``Warning`` header.
1042
+
This will also show in the PostgREST logs:
1043
+
1044
+
.. code::
1045
+
1046
+
28/May/2026:20:33:22 -0500: WARNING: Embedded resource was referenced by relation name even though it has an alias. This is deprecated and will stop working in a future release.
1047
+
28/May/2026:20:33:22 -0500: Update filters, orders or limits that use `target` to `alias` in `GET /table?select=alias:target(*)&target.order=id`
1048
+
1049
+
This feature will be removed in a future release, so you should start using the ``alias`` in these cases.
legacyWarnMsg ="Embedded resource was referenced by relation name even though it has an alias. This is deprecated and will stop working in a future release."
215
+
legacyWarnHint =let replacement (relName, alias) ="`"<> relName <>"` to `"<> alias <>"`"inT.intercalate ", " (replacement <$> warnings)
observer $LegacyTargetNameWarningObs (legacyWarnMsg, legacyWarnHint) iMethod (iPath <>Wai.rawQueryString req) -- TODO maybe store rawQueryString in ApiRequest for consistency
220
+
213
221
let mainQ =Query.mainQuery plan conf apiReq authResult configDbPreRequest
214
222
tx =MainTx.mainTx mainQ conf authResult apiReq plan sCache
215
223
obsQuery s = when configLogQuery $ observer $QueryObs mainQ s
0 commit comments