pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Jeff Janes <jeff.janes@gmail.com>
To: Setve <setve@protonmail.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: the difference between psql , createdb, dropuser
Date: Mon, 28 Oct 2019 14:04:38 +0100
Message-ID: <7b4ed28f-961d-94da-bf28-800011ce8e5d@2ndquadrant.com> (raw)
In-Reply-To: <CAMkU=1zhMd9P2urmj_UfdgvMGU2+MKvbWCdkbPfMWvbayhctUg@mail.gmail.com>
References: <REvXVFO-CndBi7DSjs8pIFGJXbS3oHuqroWUa4-AVBck7ltG60T2hKfzjMUzQODLePOuqB1GV6CPSYeI_YJtrg8mJDE7cJaNzcFTnvlDogw=@protonmail.com>
	<CAMkU=1zhMd9P2urmj_UfdgvMGU2+MKvbWCdkbPfMWvbayhctUg@mail.gmail.com>

On 2019-10-28 01:01, Jeff Janes wrote:
> On Sun, Oct 27, 2019 at 4:23 PM Setve <setve@protonmail.com 
> <mailto:setve@protonmail.com>> wrote:
> 
>     I can execute the create user or create db .etc... command at a
>     PostgreSQL interactive terminal so why are these commands
>     "createuser , createdb , dropdb etc.... separately and what is their
>     purpose?
>     <https://www.reddit.com/r/PostgreSQL/comments/dnyr0n/i_can_execute_the_create_user_or_create_db_etc/;
> 
> 
> When scripting the initial set up of a system, it is easier to pass the 
> name to one of these programs, then to embed them into the middle of an 
> SQL command properly escaped and quoted.  (The names of the programs 
> themselves are ancient history, if starting from scratch they probably 
> begin with "pg_")

Also, in the distant past, there was no CREATE USER command and the 
createuser program inserted directly into pg_shadow.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (6+ messages)  latest in thread

Message-ID: <7b4ed28f-961d-94da-bf28-800011ce8e5d@2ndquadrant.com>
Permalink:  ../7b4ed28f-961d-94da-bf28-800011ce8e5d@2ndquadrant.com/
Also on:    postgresql.org/message-id/7b4ed28f-961d-94da-bf28-800011ce8e5d@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, jeff.janes@gmail.com, setve@protonmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: the difference between psql , createdb, dropuser
  In-Reply-To: <7b4ed28f-961d-94da-bf28-800011ce8e5d@2ndquadrant.com>

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

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