【问题标题】:how to create Postgresql Http query request如何创建 Postgresql Http 查询请求
【发布时间】:2021-01-20 12:38:29
【问题描述】:

我是 PostgreSQL 新手,想知道是否可以创建一个 http 链接来从表中选择特定数据。

我尝试使用 Postgres,但无法真正遵循文档。 docker 和 postgREST 容器正在运行,但仍然可以通过 HTTP 链接访问数据库。

有什么解决办法吗?

主要目标是使用http://......../select() From () where time... 类型的结构从数据库中获取数据。 image shows that the setup for postgrest is working

谢谢 问候。

【问题讨论】:

    标签: windows postgresql docker postgrest


    【解决方案1】:

    你能粘贴你阅读和使用命令的参考吗? 粘贴的日志显示权限问题(root 用户不存在。)。 关于你想要什么的文件可能是这样的。

    参考。 https://postgrest.org/en/latest/api.html

    为了确认,您可以使用 psql 访问 postgres 吗?如果你能做到,我认为是配置带来的麻烦。你用过这样的执行命令吗?请阅读 postgres-user.conf。

    $ ./postgrest postgres-user.conf
    

    在配置中,我们可以设置db-uri,指定postgrest的角色,db-anon-role,即HTTP API server在postgres中的非授权用户角色。

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

    读完本教程后,我尝试使用postgrest,并成功通过postgrest获取表数据

    参考

    【讨论】:

    • 感谢您的快速回复。我尝试了命令 nut 它说 >./postgrest postgres-user.conf '.'未被识别为内部或外部命令、可运行程序或批处理文件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多