Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:01
    monacoremo synchronize #1814
  • 19:58
    monacoremo edited #1814
  • 19:58
    monacoremo edited #1814
  • 19:55
    monacoremo commented #1822
  • 19:54
    wolfgangwalther commented #1822
  • 19:52
    wolfgangwalther commented #1822
  • 19:49
    monacoremo commented #1822
  • 19:48
    monacoremo commented #1822
  • 19:44
    wolfgangwalther synchronize #1822
  • 19:40
    monacoremo ready_for_review #1814
  • 19:40
    monacoremo commented #1814
  • 19:38
    monacoremo edited #1814
  • 19:37
    wolfgangwalther commented #1822
  • 19:36
    monacoremo synchronize #1814
  • 19:26
    wolfgangwalther synchronize #1822
  • 19:19
    wolfgangwalther synchronize #1822
  • 19:07
    wolfgangwalther synchronize #1822
  • 19:06
    monacoremo synchronize #1814
  • 19:01
    wolfgangwalther synchronize #1822
  • 18:59
    monacoremo synchronize #1814
Markus F
@mafen
interesting, will try this out
Markus F
@mafen

that and json_agg wrapped around it worked like this

SELECT json_agg(json_build_object('id', app.id, 'name', app.name)) AS records FROM app;

, so thanks for the help to get started @tourdownunder

Mark Saward
@saward
I'm looking in issues and documentation for postgrest, but I can't see anywhere about a size limit for payload. I tried sending an image, and received a 413 reply, and I think that reply was from postgrest before it even hits the database. Is there a limit documented somewhere, and is it adjustable?
Ruslan Talpa
@ruslantalpa
There is no limit, are you sure you dont have a proxy in front of postgrest that is returning the 413? Look at all reply headers? What does the server header say? Does it say postgrest or something like nginx?
But there is a case where postgrest returns 413, that is when pg replies with “too complex” error code (54 class) https://www.postgresql.org/docs/current/errcodes-appendix.html. Look at the generated query and figure out why postgresql is refusing to execute it
Mark Saward
@saward
@ruslantalpa thanks. I was running nginx locally, but I'm 90% sure that I was connecting direct to postgrest in this test -- will double check. I was sending base64 encoded images inside a json payload for this test, and reducing the size of the images seemed to change it from failure to success. Not sure if a base64 payload can be too big for postgres to decode, and therefore throw that error?
Ruslan Talpa
@ruslantalpa
turn on the query logging on your database and look there for what is going on
Mark Saward
@saward
Will do. Have been checking such output previously, but was lead astray by first search for 413 reporting size, so I went down the wrong path (assumed that postgrest had a payload size limit)
Mark Saward
@saward
@ruslantalpa I'm using a program called 'localtunnel' for testing, and it is running an nginx proxy, so that's the thing throwing the 413. Problem solved (presumably!).
Chris Savvopoulos
@savv
Hi all. I'm trying to write an insert method that uses json_populate_recordset. One thing I'm stuck with, is getting it to keep default values. I couldn't find a satisfactory solution by searching on the internet... so that got me wondering, how does PostgREST get around this issue? If a do a batch insert of an array of objects, some of which miss a NOT NULL column that has a default value, how does postgrest get around that?
I couldn't find where json_populate_record gets used...
1 reply
hzjux001
@hzjux001
How can i use it in django project and use it by django's JWT?
1 reply
rd27
@rd27:matrix.org
[m]
Hey! I'm evalutating Postgrest for an app I'm going to make. It seems so much simpler than other use cases, and the fact that it's all just REST makes it really easy for us to get started with.
However, I'd like to know if there's a way to integrate Postgrest with Firebase Auth. Thanks!
1 reply
Lungati's Projects
@lungati
Is it possible to add filters and pagination to postgrest?
3 replies
stergnator
@stergnator
Hi! Is there a way to change databases? I see a way to change schemas using the Accept-Profile header, but that's not what I am looking for. Thanks for postgrest in advance!
6 replies
Simon
@oushu1simajing1
dyld: lazy symbol binding failed: Symbol not found: _locale_charset
Referenced from: /Users/oushu/./postgrest
Expected in: /usr/local/hawq/lib/libiconv.2.dylib
1 reply
what should i do to solve it
:(
oushu@simon ~ % otool -L postgrest postgrest: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/local/opt/postgresql/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.10.0) /usr/local/hawq/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
Simon
@oushu1simajing1
why postgrest only support postgresql version 9.4
my version is 8.3
can i use it on a lower version postgresql?
1 reply
Kurt Stolle
@kurt-stolle
Hi everyone! I would like some advice on how to structure my application. Right now, I've integrated PostgREST with my project by creating a new schema for PostgREST and adding views to this schema. These views wrap tables from my original database structure (with some added WHERE-clauses for e.g. checking a user can access a row). Does this seem like clever design to you? One downside appears to be that I cannot use JOIN-clauses between views, but this may outweigh having to rewrite my entire database to fully live in PostGREST-exposed schema.
6 replies
Michael Jendryke
@MichaelJendryke
Postgrest.png
Michael Jendryke
@MichaelJendryke
Hello everyone! I have set up my PostgREST service and used NGINX as a reverse proxy with SSL. How do I modify the host to not show localhost and the port 3030, but simply the subdomain? And since it is secured with https (http will be redirected to https in nginx), how do I set the scheme to reflect that? The reason I am asking is that e.g. Redocly pulls the information from there and hence the documentation would always point to localhost with a http connection :-(
Ruslan Talpa
@ruslantalpa
openapi-server-proxy-uri
Michael Jendryke
@MichaelJendryke
which user:passwordis it referring to?
i get it, that is optional
rd27
@rd27:matrix.org
[m]
How can I get Postgrest to automatically join related tables for me without using request headers?
1 reply
rd27
@rd27:matrix.org
[m]
Ah, ok. Thanks.
rd27
@rd27:matrix.org
[m]
Yep, was referring to that. Seems a bit verbose to me, but of course it'll have its own requirements and constraints to satisfy.
Kurt Stolle
@kurt-stolle
Has anyone attempted to get PostgREST running as an AWS Lambda function? Is this feasible?
1 reply
Yash
@auditmn

HI Postgrest team,

Can anyone please help me to understand, how can I force authentication i.e. requests with proper credentials are only allowed.

James Sewell
@jamessewell
Yash
@auditmn

Hi James,

Thanks for the quick reply, I have read the article.

From my understanding, the user needs credentials to write the data, but they can read the data even without the credentials, using the credentials provided in the postgrest config file.

If this is true, then there is a risk of data leak

1 reply
James Sewell
@jamessewell
You can set the perms however you want
michaelghaben
@michaelghaben
Is there any way to accept text/plain mime types for the postgrest webserver? it doesn't seem like it's possible (and postman seems to indicate it's returning a
{
"message": "Content-Type not acceptable: text/plain"
}
and I can't seem to find any way to configure it to be permissible
2 replies
Jan-Willem Pannekoek
@Le-Juan

Hi there,

I was wondering how I could use Queries? I want to use PostgREST in Combination with PostGIS and you need to use a specific query to get a GeoJSON output. Is it possible to this using PostgREST? An example query would be:
SELECT ST_AsGeoJSON(subq.) AS geojson
FROM (
SELECT

FROM public."GBH_Rookeries"
) as subq

3 replies
Jan-Willem Pannekoek
@Le-Juan
Okay I've discovered that this works via a view, however after using that the GEOJSON is messed up... any way to just get the GEOJSON out of the api without the column name?
thaiphanvan0779
@thaiphanvan0779
Hi there,
I would like to build PostgreSQL in local then I want to install libpq/postgresql-devel in local also.
So I want to build PostgREST using package postgresql-libpq in local (user directory).
Could you tell me how to build PostgREST using libpq/postgresql-devel which is installed in user directory (not system)?
1 reply
Frederikf
@frederikf__twitter

im considering how to best do auth via Firebase and postgrest.. Either i

1: set the jwt-secret to contain the JWK key set from Firebase and update that daily as Google rotates keys, have a Cloud Function for Firebase that adds a "role" field as a custom claim as new users are being created

or

2: write a function in postgresql called get_bearer_token(firebase_token), that can validate firebase tokens, and return a signed jwt token with from a regular jwt secret, that the client can use as a bearer token.

4 replies
Valerio Zhang
@valerio.zhang_gitlab
Screen Shot 2021-04-12 at 12.18.17 AM.png
1 reply
hi has anyone had issues with a swagger baseurl when installing swagger ontop of postgrest ?
the request url is always using http://0.0.0.0:3000/address
how can i change it to use a different domain?
Michael Jendryke
@MichaelJendryke

QUESTION: From the decription on SQL user mangement in the PostgREST docs: What role attributes and memberships do I need to set in a multi developer environment? I have a todos table with RLS, which shold be exposed as a view in the api schema, however transfering ownership of that view with ALTER VIEW api.todos OWNER TO authenticator; fails with

must be member of role "authenticator".

I have collected the entire process of what I did here, it also includes all SQL commands and futher descriptions: https://boostnote.io/shared/6cd93975-c0b2-4342-8c43-c0f901b5f033

20 replies
Michael Jendryke
@MichaelJendryke
image.png
Valerio Zhang
@valerio.zhang_gitlab
hi guys im having an issue when i create my function and using swagger with postgrest. when sending a request from swagger it is posting the correct data types, but i keep getting an error from postgrest
1 reply
{,…}
code: "42883"
details: null
hint: "No function matches the given name and argument types. You might need to add explicit type casts."
message: "function public.test(param1 => text, param2 => text) does not exist"
when param1 is boolean and param2 is text in the function parameters
seems like postgrest isnt matching the types correctly
2 replies