fivee
V2EX  ›  问与答

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

  •  
  •   fivee · Aug 31, 2022 · 821 views
    This topic created in 1350 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   ·   5820 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 06:36 · PVG 14:36 · LAX 23:36 · JFK 02:36
    ♥ Do have faith in what you're doing.