Comments (10)
If SET LOCAL "request.header.user-agent" TO "curl/7.78.0";
is not supported by your PostgreSQL version / fork, then I think you're out of luck. This seems to be very specific to that fork.
from postgrest.
You can try if SELECT set_config('request.header.user-agent', 'curl/7.78.0', true);
works better, though.
from postgrest.
SELECT set_config('request.header.user-agent', 'curl/7.78.0', true);
This one works indeed
SET LOCAL "request.header.user-agent" TO "curl/7.78.0" works as well
But not : SET LOCAL request.header.user-agent TO "curl/7.78.0" i.e without the surrounding double quotes which is the actual query generated. (I did a typo in my initial issue - will edit)
from postgrest.
SET LOCAL "request.header.user-agent" TO "curl/7.78.0" works as well
If that works, then this is not a problem, I think. It would fail without the quotes on all postgresql versions anyway.
So the problem seems to be somewhere else. Which error are you actually getting and where?
from postgrest.
Thanks for your quick reply:
Here is my error in the logs postgres logs:
STATEMENT: SET LOCAL transaction_isolation TO "read committed";SET LOCAL transaction_read_only TO "1";SET LOCAL search_path TO "dr4_ops_cs48", "public";SET LOCAL role TO jevardat_local;SET LOCAL request.jwt.claim.role TO username ;SET LOCAL request.method TO "GET";SET LOCAL request.path TO "/catalog";SET LOCAL request.header.host TO "localhost:3000";SET LOCAL request.header.user-agent TO "curl/7.78.0";SET LOCAL request.header.accept TO "/";SET LOCAL coordinator_lxid TO "390377";
ERROR: XX000: pgxc_node_set_query: nodename:dn1,backend_pid:351919,message:syntax error at or near "user",detail:,hint:
(no hint unfortunately)
I tried executing the statement and All SET LOCAL are working except the user-agent one !!
More precisely SET LOCAL request.header.user-agent does not work but SET LOCAL request.header.useragent does as well as when surrounded with ""
from postgrest.
Which PostgREST version is that exactly?
from postgrest.
Which PostgREST version is that exactly?
11.2.2 11.0.0 10.1.1 10.0.0 were all failing with similar error
from postgrest.
Hm. We have not used SET LOCAL
for quite a while. We changed to set_config
in 2020 for v8.0.0 in 7069bb3.
So either you are in fact unknowingly running a much older version of PostgREST or your PostgreSQL fork is doing something really, really odd.
from postgrest.
Hm. We have not used
SET LOCAL
for quite a while. We changed toset_config
in 2020 for v8.0.0 in 7069bb3.So either you are in fact unknowingly running a much older version of PostgREST or your PostgreSQL fork is doing something really, really odd.
So there is something weird look at my logs:
query=PostgREST 11.2.2,STATEMENT: SET LOCAL transaction_isolation TO "read committed";SET LOCAL transaction_read_only TO "1";SET LOCAL search_path TO "dr4_ops_cs48"
PostgREST 11.2.2 is being executed and generates SET LOCAL statements not set_config
I took the binary version here : https://github.com/PostgREST/postgrest/releases/download/v11.2.2/postgrest-v11.2.2-linux-static-x64.tar.xz
from postgrest.
Ok I just found that version 12.0.0 is working actually ! So issue can be closed.
Thanks for super fast feedback
from postgrest.
Related Issues (20)
- SwaggerUI - Refresh OpenAPI-Request with JWT-Token, after "Authorize"
- Progress OpenAPI 3.0? HOT 1
- Request to support order-by with COLLATE HOT 4
- new feature - control tables/views currentuser insert, delete. update rights HOT 3
- Return null from rpc instead of null-filled json
- Insert into non-existing table raises empty APIErrror HOT 5
- `target_session_attrs=read-only` is only supported on libpq >= 14 HOT 1
- Schema Cache queries as boostrap prepared statements HOT 5
- Slow schema cache loading and double caching schema HOT 8
- support reading secrets from files and not only from the environment HOT 1
- Doing a bulk insert with `missing=default` uses the default value of the domain instead of the column
- Invalid query generated when selecting after updating using or operator HOT 1
- Question on querying by comparing column values
- Bulk upserts fail due to missing double quotes on case sensitive table names with nextval() HOT 3
- OpenTelemetry + Debezium
- Support EXISTS queries HOT 7
- Bulk insertions & upserts with different fields per object do not work without column filtering HOT 2
- Deeply nested top-filter fails when wrapped in a "or"
- [Resource Embedding] Top-Level Ordering - Multiple Levels feature request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgrest.