Search Postgresql Archives

Re: Reset Postgresql users password

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 12, 2023 at 1:17 PM Gurjeet Singh <gurjeet@xxxxxxxx> wrote:
        for rec in select
                    'alter user '|| quote_ident(usename)
                    ||' with password '|| quote_literal('newpassword')


Which is more clearly written using the format function:
...
for rec in select
        format('alter user %I with password %L', usename, 'newpassword')
    from pg_user
loop
...

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux