0

I am new to PostgreSQL and wanted to know if it's possible to create a http link for selecting a particular data from the table.

I tried working with Postgres but can't really follow the documentation. The docker and postgREST container is running but still can access the database with HTTP link.

Is there any solution?

The main objective is to get the data from the database out using http://......../select() From () where time... kind of structure. image shows that the setup for postgrest is working

Thank you Regards.

Andrzej Sydor
  • 1,373
  • 4
  • 13
  • 28
shruti
  • 1
  • 2

1 Answers1

0

Could you paste the reference you read and used command? Pasted log shows permission trouble (root user don't exist.). The document about what you want may be this.

ref. https://postgrest.org/en/latest/api.html

For confirmadation, can you access postgres with psql? If you can do it, I think the trouble made by configuration. did you use execute command like this? please read postgres-user.conf.

$ ./postgrest postgres-user.conf

In the configuration, we can set db-uri, which specify postgrest's role, and db-anon-role which is HTTP API server's non authorized user's role in postgres.

db-uri = "postgres://authenticator:mysecretpassword@localhost:5433/postgres
db-anon-role = "web_anon"

After reading this tutorial, I try to use postgrest and succeed to fetch table data via postgrest

ref.

masumi
  • 1
  • 3
  • Thank you for your quick response. I tried the command nut it says >./postgrest postgres-user.conf '.' is not recognized as an internal or external command, operable program or batch file. – shruti Jan 20 '21 at 13:29