Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:52
    madeleineostoja commented #1984
  • 09:15
    wolfgangwalther commented #2144
  • 09:11
    wolfgangwalther commented #2285
  • 09:07
    wolfgangwalther commented #2425
  • 05:21
    steve-chavez commented #2144
  • 03:42
    laurenceisla synchronize #2426
  • 03:40
    laurenceisla synchronize #2426
  • 00:37
    steve-chavez commented #2144
  • 00:23
    steve-chavez commented #2144
  • Aug 12 21:20
    laurenceisla synchronize #2426
  • Aug 12 19:36
    laurenceisla synchronize #2426
  • Aug 12 19:35
    laurenceisla opened #2426
  • Aug 12 18:25
    steve-chavez commented #2285
  • Aug 12 17:50
    steve-chavez opened #2425
  • Aug 12 17:50
    steve-chavez labeled #2425
  • Aug 12 17:23
    steve-chavez commented #2144
  • Aug 12 15:47
    steve-chavez commented #2144
  • Aug 12 15:16
    steve-chavez commented #2316
  • Aug 12 15:08
    laurenceisla reopened #1959
  • Aug 12 15:08
    laurenceisla commented #1959
Gabriel Jiro
@Gjiroh
image.png
Does anyone have an idea about how to solve this problem...?
Özgür Özdemir
@ozdeozgu
@Gjiroh I run without './' but I can run like 'postgrest tutorial.conf'
2 replies
Özgür Özdemir
@ozdeozgu
Hello, I got this error: code: 42809, details: null, hint: To call a procedure, use CALL. when I try to rpc postgresql SP from my Flutter project.
2 replies
I opened this issue for this
I need help
alexwhte
@alexwhte
Hi this is my first time. not sure if this is dumb but im trying to query on iTerm to this db https://postgrest.testnet.connext.ninja/transfers
1 reply
how do i connect to it
manelben9
@manelben9
Hello ! I'm at "tutorial 0" (https://postgrest.org/en/stable/tutorials/tut0.html) and I'm stuck at step 3. I have the libraries that I put in the same file as "postgrest.exe" (I'm on Windows) But when I try to run the file, nothing happens. I tried to run it on powershell, command prompt and by clicking...
4 replies
Lance Hasson
@JLHasson
Hey folks, does anyone know if it's possible to auth with a JWT you don't control the payload of? I have an external auth provider that produces a JWT + JWKS. I can successfully auth to postgrest by getting the key from the JWKS and providing it via jwt-secret, however I fail to complete the request due to not having {"role": "foo"} in the JWT payload. How do folks handle the scenario where you don't control the JWT creation process? I saw the section in the docs referring to Auth0, but it appears some identity providers don't offer the same ability to customize the payload. Is it just not possible to use postgrest in this scenario?
2 replies
Laurence Isla
@laurenceisla
Just FYI, @eshnil22:matrix.org will give a talk related to PostgREST in a couple of days (24th June) at Postgres London https://www.postgreslondon.org/. @eshnil22:matrix.org Sorry for acknowledging it so late, wish you the best of lucks! Let us know how it went!
juro
@roland-jungwirth
I am trying to expose my postgrest service via Nginx. I have added the Nginx snippet as per https://postgrest.org/en/stable/admin.html to the bottom of my default site’s configuration. However, Nginx returns an error - I’m pretty sure the http directive isn’t valid. Removing this, Nginx starts, but I cannot connect? Any ideas or - even better - a working nginx configuration file.
4 replies
juro
@roland-jungwirth
When exposing Postgrest using Nginx, do I have to add a route for every single table?
2 replies
eshnil
@eshnil22:matrix.org
[m]

Well, the talk went well. There's good amount of resistance among backend developers about having to write business logic in PL/pgsql. The point that with postgres features, you probably don't need as much custom business logic code as you think, needs to be communicated better.

Slides, code and discussions for my talk are available here: https://github.com/nileshtrivedi/sqljs

4 replies
Edmund Cape
@EdmundsEcho
Hello everyone - im working through broader use of postgrest within my team. Sometimes I get stringified json. I read the casting section. Not likely what I’m dealing with. All in all, what is the best, consistent way to return json? Given: rpc, view exposure in my api & how much we can “opt” to get from postgrest. So for instance, should I have postgresql render json? The goal is json, consistently as input and output, for users that only ever access postgresql by way of postgREST. Thank you any guidance!
3 replies
eshnil
@eshnil22:matrix.org
[m]
@pongraczi: I'm not familiar with Odoo. AFAIK, ERP systems typically involve users being able to create new schemas (not just new records in existing schema) on the go. That can be hard to map on PostgREST.
Has anybody ported PostgREST to WebAssembly? I am wondering if I can run postgREST on Deno.com's edge servers.
arrowd
@arrowd:kde.org
[m]
Hey everyone. Now that GHC 9.2 support have been merged in, is there an ETA for the new release containing this change?
1 reply
praveenrwork
@praveenrwork
Hi, I am exploring PostgREST, I am able to GET data from different table (linked with Foreign-Key) in single request. http://127.0.0.1:3000/table1?select=id,name,table2(col1,col2), table3(col1,col2) Table 1 is having primary key, table2 and table 3 are related to table 1 using foreign Key. My response is as below [ { "id":1, "name": "Test name", "table2":[{"col1":"val1", "col2":"val2"}],"table3":[]}]. How can i achieve the same for Post through PostgREST. Can I post above response body as a request and achieve inserting into different tables in one go.
2 replies
Steve Chavez
@steve-chavez

Hey @/all,

The company I work for is hiring Support Engineers. If you know PostgreSQL, PostgREST + Javascript then you might be an ideal fit and I'd encourage you to apply!

There are other job openings too in case you're interested. Thanks!

1 reply
arrowd
@arrowd:kde.org
[m]
Another question: why 9.0.1 isn't released on Hackage?
4 replies
arrowd
@arrowd:kde.org
[m]
steve-chavez (Steve Chavez) ^
rhysallister
@rhysallister
Greetings....is it possible to call a function that returns setof record? Normally the query would look like SELECT * FROM api.mt('pop',4) AS (num int, w text);
2 replies
Thibaut Baguette
@SpacewaIker
Hi, I was able to complete postgREST tutorial 0 successfully with an existing postgres docker DB I had. I'm now trying to use docker-compose as described here. However, this creates a new database. I now want to connect to it to create the roles as described in tutorial 0, as well as create a table and add some data, but when trying to connect to the database I get an error saying that role 'postgres' does not exist. How am I supposed to connect to the docker-compose DB? thanks
1 reply
Frank Cazabon
@fcazabon
Hi, is it possible to set the default return/response on all inserts/updates/deletes? Or how do I check for success/failure when these occur?
2 replies
NickEmpetvee
@NickEmpetvee
Can you use a JWT to protect GET requests like you do POSTs and PATCHes?
3 replies
NickEmpetvee
@NickEmpetvee
I'm making my first foray into setting up PostgREST in the cloud. I want to set it up on AWS EC2. The front end is React 17 and database version PG 11.15 or higher. Will probably add NGINX too, but will target a proof of concept without it initially. Does anyone have any suggestions, especially on how to get PostgREST running, connecting to PostgRESQL, and accessible to React? React will be over SSL. Eventually I'll want calls from React to PostgREST over SSL too.
7 replies
NickEmpetvee
@NickEmpetvee
The on-premise has this all running on Windows. For the PoC, I'll stick to Windows.
Axle Shoemaker
@axle_schoe_gitlab

Initial situation:
I am running a PostgREST server in version 9.0.1. The OS is OpenSuse Leap 15. The user authentication is done to the PostgreSQL API (q.e. psql) via the PAM module and the SSSD service against the LDAP server.

As database I use a PostgreSQL in version 14.
For PostgREST the extension pgjwt is set up. This successfully signs a JWT to an existing DB role in the table "basic_auth.users" as described at https://postgrest.org/en/stable/auth.html#storing-users-and-passwords. The role was created manually and does not come from the LDAP system.

My question:
Using a mobile app, I want users to be issued a JWT to their existing LDAP account.
How can I use the authenticator role from PostgREST to authenticate a user against the LDAP system and sign them a JWT?

merl1n0
@merl1n0
Hello, i'm new to postgrest. I have error on step4 of the tutorial1 (after creating a token on jwt.io)
~]$ curl http://localhost:3000/todos -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"task": "learn how to auth"}'
{"message":"JWSError JWSInvalidSignature"}
if i paste the token back on jwt.io it says "signature verified"
the "secret" is the same set into tutorial.conf
merl1n0
@merl1n0
~]$ echo $TOKEN | jwt.py
{
"alg": "HS256",
"typ": "JWT"
}
{
"role": "todo_user"
}
merl1n0
@merl1n0
Ok. I solved it by creating another one and reloading postgrest. Sorry for the burden.
christian
@christian:matrix.boseck.net
[m]
Hello guys, I started building a debian package for postgrest. Now it just installes the binary, but I will add some scripts to setup multiple instances for different databases.
Is someone interested on an postgrest debian package?
1 reply
scienced
@scienced
Hi, anyone else getting this error message: {"hint":null,"details":"Custom parameter names must be two or more simple identifiers separated by dots.","code":"42602","message":"invalid configuration parameter name \"request.header.cache-control\""} after Google Cloud maintenance on Postgres v 9.6 this weekend? I have been using this stable setup for years now, and using latest version of Postgrest.
2 replies
skt-rai
@skt-rai

I am using PostgRest 7.0.1 and PostgreSQL 12.11 . I have got this error this week . How can fix it?
"invalid configuration parameter name \"request.header.user-agent\""

I think the reason is after Google Cloud maintenance update PostgreSQL 12.10 to PostgreSQL 12.11 , really ?

1 reply
davinderkaur95
@davinderkaur95
I am new user of PostgREST and version i am installing is 9.0.1 and my PostgreSQL is 14.4 on ubuntu 20.04.
1.I used this $ nix-env -i haskellPackages.postgrest install but i got error called "error: selector 'haskellPackages.postgrest' matches no derivations".
  1. I tried $ nix-env -iA nixos.pkgs.haskellPackages.postgrest but again error is " attribute 'nixos' in selection path 'nixos.pkgs.haskellPackages.postgrest' not found".
  2. i tried this way as well $ nix-shell -p nixpkgs-review --run "nixpkgs-review wip" but doesnt help
2 replies
davinderkaur95
@davinderkaur95
I tried with & nix-channel --list "nixpkgs https://nixos.org/channels/nixpkgs-unstable" after that i tried with $ nix-env -iA nixpkgs.haskellPackages.postgrest but i got error called "marked as broken" then i use this comand $ NIXPKGS_ALLOW_BROKEN=1 nix-env -iA nixpkgs.haskellPackages.postgrest but again
error: builder for '/nix/store/a5f50rq7m5w7in2l14d0jabx43n6a4ss-postgrest-9.0.1.drv' failed with exit code 1
SkyLightEffect
@SkyLightEffect
Hello guys,
I am in trouble getting my PGRST_JWT_SECRET work. I've set it in my docker-compose file, but I can still expose my database content without any use of my secret (via curl or web browser).
server:
    image: postgrest/postgrest
    restart: unless-stopped
    container_name: postgrest_server
    ports:
      - "0.0.0.0:3000:3000"
    environment:
      PGRST_DB_URI: postgres://authenticator:xxxxxxxxxxxxxxxxx@db:5432/quotes
      PGRST_DB_SCHEMAS: quotes
      PGRST_DB_ANON_ROLE: quotes_user #In production this role should not be the same as the one used for the connection
      PGRST_OPENAPI_SERVER_PROXY_URI: "http://127.0.0.1:3000/"
      PGRST_JWT_SECRET: 'xxxxxxxxxxxxxxxxx'
    depends_on:
      - db
4 replies
ilsaggiatore
@ilsaggiatore
Hey! sorry for offtopic but i am very desperate by now.
I want to write unit tests for my postgrest app using pgtap. I am using supabase, the extension is installed on the server (i can create extension pg_tap) but i have no idea how to to actually install the test runner pg_prove and actually run the tests.
Have anyone managed to do it?
ilsaggiatore
@ilsaggiatore
Oh i think i got it cpanm TAP::Parser::SourceHandler::pgTAP
Jetro Olowole
@jetro4u
Just saw this
I have a running app that uses Sequelize with about 400 tables in the public schema. I want to rebuild the system and stumble on this project. Can this offer a more performant result than Sequelize?
FckDzr
@fckdzr_gitlab

Hi all, I have a strange bug with this simple "logout" RPC function

create or replace function logout() returns void as $$
begin
  perform set_config('response.headers', '[{"Set-Cookie": "jwt=0; Path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT; HttpOnly"}, ...blablabla...]', true);
end;
$$ language plpgsql IMMUTABLE; -- IMMUTABLE can be GET
GRANT EXECUTE ON FUNCTION logout TO "anon", "user", "admin";

But the set_config only occur "sometimes", as you can see with the same curl command I get different headers response.

$ curl -v 'http://0.0.0.0/api/rpc/logout'
*   Trying 0.0.0.0:80...
* Connected to 0.0.0.0 (127.0.0.1) port 80 (#0)
> GET /api/rpc/logout HTTP/1.1
> Host: 0.0.0.0
> User-Agent: curl/7.84.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.21.6
< Date: Tue, 02 Aug 2022 00:07:56 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Content-Range: 0-0/*
< Set-Cookie: jwt=0; Path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT; HttpOnly
< Set-Cookie: id=0; Path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;
< Set-Cookie: role=0; Path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;
< 
* Connection #0 to host 0.0.0.0 left intact
""

and just 2 second later, no more Set-Cookie ...

$ curl -v 'http://0.0.0.0/api/rpc/logout'
*   Trying 0.0.0.0:80...
* Connected to 0.0.0.0 (127.0.0.1) port 80 (#0)
> GET /api/rpc/logout HTTP/1.1
> Host: 0.0.0.0
> User-Agent: curl/7.84.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.21.6
< Date: Tue, 02 Aug 2022 00:07:58 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Content-Range: 0-0/*
< 
* Connection #0 to host 0.0.0.0 left intact

It feels like some kind of "caching" issue but I don't see how/why/what I did wrong

Bhupendra Yadav
@bhupixb
Hi everyone, we are using postgrest-9.0.0. Just wanted to know if there's a way to log the SQL query generated by postgrest HTTP request? The only way i can think of is to log all postgres queries on db side and use the logs to see. But is there any easy way which postgrest provides?
10D24D
@10D24D
Hello. Access request headers, cookies and JWT declarations are all OK, but how do i access the body? I want to give a default data '{} ' when calling the interface to avoid being unable to find the interface.
1 reply
hzjux001
@hzjux001
How can I get the record id when I create with map[string]interface{} .