V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
itx10237

怎样使用 C 语言访问 PostgreSQL 集群?

  •  
  •   itx10237 · Jul 6, 2024 · 2834 views
    This topic created in 663 days ago, the information mentioned may be changed or developed.

    官网 https://www.postgresql.org/docs/14/libpq-connect.html 的文档似乎没有提供访问 PostgreSQL 集群的 api 。大家能帮忙提供一下资料吗?

    5 replies    2024-07-07 00:05:53 +08:00
    Ackvincent
        1
    Ackvincent  
       Jul 6, 2024
    直接访问就可以了,你不需要在乎他是不是集群。
    vitovan
        2
    vitovan  
       Jul 6, 2024
    define "访问 PostgreSQL 集群"
    itx10237
        3
    itx10237  
    OP
       Jul 6, 2024
    @Ackvincent 问题是将集群的所有 IP 都传入到哪个 api ?我在官网文档上找不到这个 api
    forsuperper
        4
    forsuperper  
       Jul 6, 2024
    @itx10237 看着官方只 lippq 支持 1 个 IP 。 官方有时候文档中的集群就是一个数据库实例的概念,

    所以可能不是你想要的东西。而且支持集群势必要支持各种相关功能
    iseki
        5
    iseki  
       Jul 7, 2024
    一般来说,PostgreSQL 本身对「集群」的支持,只有「复制」这一个功能。其他的,读写分离、负载均衡、故障转移,全都依靠其他中间件实现。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2706 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 14:56 · PVG 22:56 · LAX 07:56 · JFK 10:56
    ♥ Do have faith in what you're doing.