Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 19EC79FB99C for ; Mon, 26 Feb 2007 13:34:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 86881-08 for ; Mon, 26 Feb 2007 13:34:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 26FC39FB959 for ; Mon, 26 Feb 2007 13:34:21 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id l1QHYHT00940; Mon, 26 Feb 2007 12:34:17 -0500 (EST) From: Bruce Momjian Message-Id: <200702261734.l1QHYHT00940@momjian.us> Subject: Re: PostgreSQL 8.2.3 Documentation - createuser - echoed command In-Reply-To: <389229.32208.qm@web51814.mail.yahoo.com> To: Halley Pacheco de Oliveira Date: Mon, 26 Feb 2007 12:34:17 -0500 (EST) CC: pgsql-docs X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.08 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/40 X-Sequence-Number: 4171 The -E/-N options control how the password is stored in the server, and that is what you are seeing in different ENCRYPTED PASSWORD entries. Generally, you should never use -N. --------------------------------------------------------------------------- Halley Pacheco de Oliveira wrote: > In the createuser command page is written: > > To create the user joe as a superuser, and assign a password immediately: > > $ createuser -P -s -e joe > Enter password for new role: xyzzy > Enter it again: xyzzy > CREATE ROLE joe PASSWORD 'xyzzy' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; > CREATE ROLE > > In the above example, the new password isn't actually echoed when typed, but we show what was typed for clarity. However the password will appear in the echoed command, as illustrated ? so you don't want to use -e when assigning a password, if anyone else can see your screen. > > But it is not always the truth. > > When I use > > $ createuser -P -s -N -e joe > > I get: > > Enter password for new role: xyzzy > Enter it again: xyzzy > CREATE ROLE joe PASSWORD 'xyzzy' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; > CREATE ROLE > > (same as in the documentation) > > But when I use > > $ createuser -P -s -E -e joe > > (or don't use -N or -E) I get: > > > CREATE ROLE joe ENCRYPTED PASSWORD 'md5b5f5ba1a423792b526f799ae4eb3d59e' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; > > (the password is shown encrypted) > > The last two examples were executed using a "createuser (PostgreSQL) 8.2.0" local. > > But when I execute the createuser command from a remote machine using: > > # createuser --version > createuser (PostgreSQL) 8.1.4 > > # createuser -h Kubuntu -U sistemas -P -s -E -e joe > > I get: > > CREATE ROLE joe ENCRYPTED PASSWORD 'xyzzy' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; > > (same as in the documentation, but different from the createuser 8.2.0 local) > > I would like to know the reason of the difference. Is it being caused by the different versions of createuser? > > The text is the same in the PostgreSQL 8.1.8 Documentation and in the PostgreSQL 8.2.3 Documentation, but it seems to me that the createuser behaviour is different in these versions. > > Thanks, > Halley > > > > > > __________________________________________________ > Fale com seus amigos de gra?a com o novo Yahoo! Messenger > http://br.messenger.yahoo.com/ > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend -- Bruce Momjian http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +