diff --git a/api.rst b/api.rst index 9afb86a87..3422e194d 100644 --- a/api.rst +++ b/api.rst @@ -145,6 +145,7 @@ You can rename the columns by prefixing them with an alias followed by the colon .. code-block:: http GET /people?select=fullName:full_name,birthDate:birth_date HTTP/1.1 + [ {"fullName": "John Doe", "birthDate": "04/25/1988"}, {"fullName": "Jane Doe", "birthDate": "01/12/1998"} @@ -155,6 +156,7 @@ Casting the columns is possible by suffixing them with the double colon ``::`` p .. code-block:: http GET /people?select=full_name,salary::text HTTP/1.1 + [ {"fullName": "John Doe", "salary": "90000.00"}, {"fullName": "Jane Doe", "salary": "120000.00"} diff --git a/install.rst b/install.rst index 5355d3b8c..d50e7286a 100644 --- a/install.rst +++ b/install.rst @@ -90,6 +90,8 @@ role-claim-key String .role db-uri The standard connection PostgreSQL `URI format `_. Symbols and unusual characters in the password or other fields should be percent encoded to avoid a parse error. If enforcing an SSL connection to the database is required you can use `sslmode `_ in the URI, for example ``postgres://user:pass@host:5432/dbname?sslmode=require``. + When running PostgREST on the same machine as PostgreSQL, it is also possible to connect to the database using a `Unix socket `_ and the `Peer Authentication method `_ as an alternative to TCP/IP communication and authentication with a password, this also grants higher performance. According to the documentation on the `libpq connection string `_ the empty host resolves to the Unix socket and the password can be omitted in this case, so the ``db-uri`` would be reduced to ``postgres://user@/dbname``. + On older systems like Centos 6, with older versions of libpq, a different db-uri syntax has to be used. In this case the URI is a string of space separated key-value pairs (key=value), so the example above would be :code:`"host=host user=user port=5432 dbname=dbname password=pass"`. db-schema The database schema to expose to REST clients. Tables, views and stored procedures in this schema will get API endpoints.