Skip to content
This repository was archived by the owner on Feb 24, 2024. It is now read-only.

Commit c46c3b7

Browse files
authored
Bump to PostgREST v9 (#468)
* Add highlights and modify changelog structure * Rename upcoming page to v9.0.0 * Classify features, edit breaking changes and fixes * Highlight top-level filtering * Clarify PostgreSQL 14 breaking change * Add devops to doc improvements * Add curl snippets to doc improvements
1 parent 9eac683 commit c46c3b7

File tree

6 files changed

+159
-69
lines changed

6 files changed

+159
-69
lines changed

admin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Automatic Connection Recovery
207207

208208
When PostgREST loses the connection to the database, it retries the connection using capped exponential backoff, with 32 seconds being the maximum backoff time.
209209

210-
This retry behavior is triggered immediately after the connection is lost if :ref:`db-channel-enabled` is set to true (this is the default behavior), otherwise it will be activated once a request is made.
210+
This retry behavior is triggered immediately after the connection is lost if :ref:`db-channel-enabled` is set to true(the default), otherwise it will be activated once a request is made.
211211

212212
To notify the client when the next reconnection attempt will be, PostgREST responds with ``503 Service Unavailable`` and the ``Retry-After: x`` header, where ``x`` is the number of seconds programmed for the next retry.
213213

api.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,8 @@ If you want to embed through join tables but need more control on the intermedia
910910

911911
curl "http://localhost:3000/actors?select=roles(character,films(title,year))"
912912

913+
.. _embed_filters:
914+
913915
Embedded Filters
914916
----------------
915917

@@ -991,10 +993,10 @@ The result will show the nested actors named Tom and order them by last name. Al
991993

992994
.. _embedding_top_level_filter:
993995

994-
Top Level Filtering
995-
~~~~~~~~~~~~~~~~~~~
996+
Embedding with Top-level Filtering
997+
----------------------------------
996998

997-
By default, embedded filters don't change the top level resource rows at all:
999+
By default, :ref:`embed_filters` don't change the top-level resource(``films``) rows at all:
9981000

9991001
.. tabs::
10001002

@@ -1095,8 +1097,9 @@ Since it contains the ``films_id`` foreign key, it is possible to embed ``box_of
10951097
curl "http://localhost:3000/box_office?select=bo_date,gross_revenue,films(title)&gross_revenue=gte.1000000"
10961098

10971099
.. note::
1100+
* Embedding on partitions is not allowed because it leads to ambiguity errors (see :ref:`embed_disamb`) between them and their parent partitioned table(more details at `#1783(comment) <https://github.com/PostgREST/postgrest/issues/1783#issuecomment-959823827>`_). :ref:`custom_queries` can be used if this is needed.
1101+
10981102
* Partitioned tables can reference other tables since PostgreSQL 11 but can only be referenced from any other table since PostgreSQL 12.
1099-
* Embedding on partitions is not allowed because it leads to ambiguity errors (see :ref:`embed_disamb`) between them and their parent partitioned table. :ref:`custom_queries` can be used if this is needed.
11001103

11011104
.. _embedding_views:
11021105

@@ -1255,6 +1258,8 @@ For doing resource embedding, PostgREST infers the relationship between two tabl
12551258
However, in cases where there's more than one foreign key between two tables, it's not possible to infer the relationship unambiguously
12561259
by just specifying the tables names.
12571260

1261+
.. _target_disamb:
1262+
12581263
Target Disambiguation
12591264
~~~~~~~~~~~~~~~~~~~~~
12601265

@@ -1281,6 +1286,8 @@ the request is ambiguous and PostgREST will respond with an error:
12811286
12821287
HTTP/1.1 300 Multiple Choices
12831288
1289+
{..}
1290+
12841291
If this happens, you need to disambiguate the request by adding precision to the **target**.
12851292
Instead of the **table name**, you can specify the **foreign key constraint name** or the **column name** that is part of the foreign key.
12861293

@@ -1344,6 +1351,8 @@ the result more clear.
13441351
}
13451352
]
13461353
1354+
.. _hint_disamb:
1355+
13471356
Hint Disambiguation
13481357
~~~~~~~~~~~~~~~~~~~
13491358

@@ -2430,8 +2439,10 @@ You can also select the schema for :ref:`s_procs` and :ref:`open-api`.
24302439

24312440
These headers are based on the nascent "Content Negotiation by Profile" spec: https://www.w3.org/TR/dx-prof-conneg
24322441

2433-
HTTP Logic
2434-
==========
2442+
.. _http_context:
2443+
2444+
HTTP Context
2445+
============
24352446

24362447
.. _guc_req_headers_cookies_claims:
24372448

ecosystem.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Example Apps
2828
------------
2929

3030
* `chronicle <https://github.com/srid/chronicle>`_ - tracking a tree of personal memories
31-
* `cloudgov-demo-postgrest <https://github.com/GSA/cloudgov-demo-postgrest>`_ - demo for a federally-compliant REST API on cloud.gov
3231
* `code-du-travail-backoffice <https://github.com/SocialGouv/code-du-travail-backoffice>`_ - data administration portal for the official French Labor Code and Agreements
3332
* `delibrium-postgrest <https://gitlab.com/delibrium/delibrium-postgrest/>`_ - example school API and front-end in Vue.js
3433
* `elm-workshop <https://github.com/diogob/elm-workshop>`_ - building a simple database query UI
@@ -53,13 +52,14 @@ Example Apps
5352
* `PostGUI <https://github.com/priyank-purohit/PostGUI>`_ - React Material UI admin panel
5453
* `prospector <https://github.com/sfcta/prospector>`_ - data warehouse and visualization platform
5554

56-
.. _dev_ops:
55+
.. _devops:
5756

5857
DevOps
5958
------
6059

61-
* `jbkarle/postgrest <https://github.com/jbkarle/postgrest>`_ - helm chart with a demo database for development and test purposes
60+
* `cloudgov-demo-postgrest <https://github.com/GSA/cloudgov-demo-postgrest>`_ - demo for a federally-compliant REST API on cloud.gov
6261
* `cloudstark/helm-charts <https://github.com/cloudstark/helm-charts/tree/master/postgrest>`_ - helm chart to deploy PostgREST to a Kubernetes cluster via a Deployment and Service
62+
* `jbkarle/postgrest <https://github.com/jbkarle/postgrest>`_ - helm chart with a demo database for development and test purposes
6363

6464
.. _eco_external_notification:
6565

index.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ The project has a friendly and growing community. Join our `chat room <https://g
9494

9595
.. toctree::
9696
:glob:
97-
:reversed:
9897
:caption: Release Notes
9998
:titlesonly:
10099
:hidden:
101100

102-
releases/*
101+
v9.0.0 <releases/v9.0.0>
102+
releases/v8.0.0
103+
releases/v7.0.1
104+
releases/v7.0.0
105+
releases/v6.0.2
106+
releases/v5.2.0
103107

104108
Tutorials
105109
---------
@@ -212,7 +216,7 @@ PostgREST has a growing ecosystem of examples, libraries, and experiments. Here
212216
* :ref:`community_tutorials`
213217
* :ref:`templates`
214218
* :ref:`eco_example_apps`
215-
* :ref:`dev_ops`
219+
* :ref:`devops`
216220
* :ref:`eco_external_notification`
217221
* :ref:`eco_extensions`
218222
* :ref:`clientside_libraries`
@@ -224,6 +228,7 @@ Release Notes
224228
Here we'll include the most relevant changes so you can migrate to newer versions easily.
225229
You can see the full changelog of each release in the `PostgREST repository <https://github.com/PostgREST/postgrest/releases>`_.
226230

231+
- :doc:`releases/v9.0.0`
227232
- :doc:`releases/v8.0.0`
228233
- :doc:`releases/v7.0.0`
229234
- :doc:`releases/v6.0.2`

releases/upcoming.rst

Lines changed: 0 additions & 56 deletions
This file was deleted.

releases/v9.0.0.rst

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
2+
PostgREST 9.0.0
3+
===============
4+
5+
This major version is released with PostgreSQL 14 compatibility and is accompanied with new features and bug fixes. You can look at the detailed changelog and download the pre-compiled binaries on the `GitHub release page <https://github.com/PostgREST/postgrest/releases/tag/v9.0.0>`_.
6+
7+
Features
8+
--------
9+
10+
PostgreSQL 14 compatibility
11+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
12+
13+
PostgreSQL 14 Beta 1 tightened its GUC naming scheme making it impossible to use multiple dots (``.``) and dashes (``-``) on custom GUC parameters, this caused our `old HTTP Context <https://postgrest.org/en/v8.0/api.html#accessing-request-headers-cookies-and-jwt-claims>`_ to fail across all requests. Thankfully, `@robertsosinski <https://github.com/robertsosinski>`_ got the PostgreSQL team to reconsider allowing multiple dots in the GUC name, allowing us to avoid a major breaking change. You can see the full discussion `here <https://www.postgresql.org/message-id/17045-6a4a9f0d1513f72b%40postgresql.org>`_.
14+
15+
Still, dashes cannot be used on PostgreSQL 14 custom GUC parameters, so we changed our HTTP Context :ref:`to namespace using a mix of dots and JSON <guc_req_headers_cookies_claims>`. On older PostgreSQL versions we still use the :ref:`guc_legacy_names`. If you wish to use the new JSON GUCs on these versions, set the :ref:`db-use-legacy-gucs` config option to false.
16+
17+
Resource Embedding with Top-level Filtering
18+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19+
20+
Historically, Resource Embedding was always done with a query that included the equivalent of a ``LEFT JOIN``, which meant you could not
21+
exclude any of the top-level resource rows. You can now use :ref:`embedding_top_level_filter` to do the equivalent of an ``INNER JOIN``, thus you can filter the top-level resource rows with any of the available operators.
22+
23+
Partitioned Tables
24+
~~~~~~~~~~~~~~~~~~
25+
26+
Partitioned tables now integrate with all the feature set. You can :ref:`embed partitioned tables <embedding_partitioned_tables>`, UPSERT, INSERT(with a correctly generated Location header) and make OPTIONS requests on them. They're also included in the generated OpenAPI.
27+
28+
Functions(RPC)
29+
~~~~~~~~~~~~~~
30+
31+
* Functions with a :ref:`single unnamed parameter <s_proc_single_unnamed>` can now be used to POST raw ``bytea``, ``text`` or ``json/jsonb``.
32+
33+
Horizontal Filtering
34+
~~~~~~~~~~~~~~~~~~~~
35+
36+
* The ``unknown`` value for three-valued logic can now be used on the ``is`` :ref:`operator <operators>`.
37+
38+
* Escaping double quotes(``"``) in double-quoted surrounded strings is now possible by using backslashes, e.g. ``?col=in.("Double\"Quote")``. Backslashes can be escaped with a preceding backslash, e.g. ``?col=in.("Back\\slash")``. See :ref:`reserved-chars`.
39+
40+
Administration
41+
~~~~~~~~~~~~~~
42+
43+
* A ``Retry-After`` header is now added when PostgREST is doing :ref:`automatic_recovery`.
44+
45+
Error messages
46+
~~~~~~~~~~~~~~
47+
48+
* :ref:`embed_disamb` now shows an improved error message that includes relevant hints for clearing out the ambiguous embedding.
49+
50+
Documentation improvements
51+
~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
* Added ``curl`` snippets to the :doc:`API <../api>` page.
54+
55+
* Added the :ref:`automatic_recovery` section.
56+
57+
* Added the :ref:`nested_embedding` section.
58+
59+
* Added the :ref:`logical_operators` section.
60+
61+
* Added the :ref:`templates` and :ref:`devops` sections to the :doc:`Ecosystem </ecosystem>`.
62+
63+
Bug fixes
64+
---------
65+
66+
* Correct RPC return type handling for RETURNS TABLE with a single column (`#1930 <https://github.com/PostgREST/postgrest/pull/1930>`_).
67+
68+
* Schema Cache query failing with ``standard_conforming_strings = off`` (`#1992 <https://github.com/PostgREST/postgrest/issues/1992>`_).
69+
70+
* OpenAPI missing default values for String types (`#1871 <https://github.com/PostgREST/postgrest/issues/1871>`_).
71+
72+
Breaking changes
73+
----------------
74+
75+
* Dropped support for PostgreSQL 9.5 as it already reached its end-of-life according to `PostgreSQL versioning policy <https://www.postgresql.org/support/versioning/>`_.
76+
77+
* Partitions of a `partitioned table <https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE>`_ are no longer included in the :ref:`schema_cache`. This is so errors are not generated when doing resource embedding on partitioned tables.
78+
79+
* Dropped support for doing :ref:`hint_disamb` using dots instead of exclamation marks, e.g. doing ``select=*,projects.client_id(*)`` instead of ``select=*,projects!client_id(*)``). Using dots was undocumented and deprecated back in `v6.0.2 <https://github.com/PostgREST/postgrest/releases/tag/v6.0.2>`_.
80+
81+
Thanks
82+
------
83+
84+
Big thanks from the `PostgREST team <https://github.com/orgs/PostgREST/people>`_ to our sponsors!
85+
86+
.. container:: image-container
87+
88+
.. image:: ../_static/cybertec-new.png
89+
:target: https://www.cybertec-postgresql.com/en/?utm_source=postgrest.org&utm_medium=referral&utm_campaign=postgrest
90+
:width: 13em
91+
92+
.. image:: ../_static/2ndquadrant.png
93+
:target: https://www.2ndquadrant.com/en/?utm_campaign=External%20Websites&utm_source=PostgREST&utm_medium=Logo
94+
:width: 13em
95+
96+
.. image:: ../_static/retool.png
97+
:target: https://retool.com/?utm_source=sponsor&utm_campaign=postgrest
98+
:width: 13em
99+
100+
.. image:: ../_static/gnuhost.png
101+
:target: https://gnuhost.eu/?utm_source=sponsor&utm_campaign=postgrest
102+
:width: 13em
103+
104+
.. image:: ../_static/supabase.png
105+
:target: https://supabase.io/?utm_source=postgrest%20backers&utm_medium=open%20source%20partner&utm_campaign=postgrest%20backers%20github&utm_term=homepage
106+
:width: 13em
107+
108+
.. image:: ../_static/oblivious.jpg
109+
:target: https://oblivious.ai/?utm_source=sponsor&utm_campaign=postgrest
110+
:width: 13em
111+
112+
* Evans Fernandes
113+
* `Jan Sommer <https://github.com/nerfpops>`_
114+
* `Franz Gusenbauer <https://www.igutech.at/>`_
115+
* `Daniel Babiak <https://github.com/dbabiak>`_
116+
* Tsingson Qin
117+
* Michel Pelletier
118+
* Jay Hannah
119+
* Robert Stolarz
120+
* Nicholas DiBiase
121+
* Christopher Reid
122+
* Nathan Bouscal
123+
* Daniel Rafaj
124+
* David Fenko
125+
* Remo Rechkemmer
126+
* Severin Ibarluzea
127+
* Tom Saleeba
128+
* Pawel Tyll
129+
130+
If you like to join them please consider `supporting PostgREST development <https://github.com/PostgREST/postgrest#user-content-supporting-development>`_.

0 commit comments

Comments
 (0)