agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: psql - prompt for password
Date: Thu, 30 May 2024 10:11:47 +0200
Message-ID: <b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com> (raw)
In-Reply-To: <CA+wokJ-d3c5UgGPuniwf_LLbgUMTfBJcBDQOnP0HGvzvD8CL1g@mail.gmail.com>
References: <CA+wokJ-d3c5UgGPuniwf_LLbgUMTfBJcBDQOnP0HGvzvD8CL1g@mail.gmail.com>

Am 30.05.24 um 10:07 schrieb Edwin UY:
> Hi,
>
> Is createuser the only one I can use to create a user where it prompts 
> for a password? There is no alteruser though.
> I want to use psql and \prompt but am lost on how to use it.
> Basically just want to use it for running a psql script like for 
> example - ALTER USER spongebob WITH ENCRYPTED PASSWORD ':newpassword';
>
> Regards,
> Ed
>
>
You can feed a command into psql for that.

Example:

echo "alter user spongebob password 'secret2'" | psql

Add arguments for psql, like -U -d -h -p as needed.

Regards,

Holger

-- 

Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  [application/pgp-signature] OpenPGP_signature (202B, ../b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com/2-OpenPGP_signature)
  download

view thread (4+ messages)  latest in thread

Message-ID: <b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com>
Permalink:  ../b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com/
Also on:    postgresql.org/message-id/b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: psql - prompt for password
  In-Reply-To: <b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox