fivee
V2EX  ›  问与答

postgresql 如何在函数中使用系统环境变量?

  •  
  •   fivee · Aug 31, 2022 · 947 views
    This topic created in 1421 days ago, the information mentioned may be changed or developed.
    使用 hashids 的 psql 插件
    https://github.com/iCyberon/pg_hashids

    如下语句
    SELECT id_encode(1234567, 'salt', 10);

    有办法让'salt'通过环境变量读取吗?

    因为 salt 在业务代码里也需要用,想通过环境变量一次定义就可以了。
    nine
        1
    nine  
       Sep 1, 2022
    随便定义啊,业务代码读取环境变量不就行了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5909 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 03:28 · PVG 11:28 · LAX 20:28 · JFK 23:28
    ♥ Do have faith in what you're doing.