initdb createuser commands

Started by Samuel Williamsover 9 years ago33 messagesgeneral
Jump to latest
#1Samuel Williams
space.ship.traveller@gmail.com

Hello,

Perhaps I'm missing something.

However, it seems to me that there are several "generically" named
commands, e.g. initdb, createuesr which come as part of postgresql. In
my mind, these commands are sufficiently generic that they might clash
with other commands. It's also not obvious they are part of
postgresql.

Wouldn't it make more sense to make them subcommand, of, say, a top
level pga (postgres admin) command, a bit like how `mysqladmin` works?

Just wondering as the naming of these commands seems overly generic
and for a new user it's hard to know what commands are available since
there is no common prefix (e.g. pg_<tab>) for these commands.

Thanks
Samuel

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2John R Pierce
pierce@hogranch.com
In reply to: Samuel Williams (#1)
Re: initdb createuser commands

On 10/28/2016 4:31 PM, Samuel Williams wrote:

Just wondering as the naming of these commands seems overly generic
and for a new user it's hard to know what commands are available since
there is no common prefix (e.g. pg_<tab>) for these commands.

as these commands have been around for like 20 years, its kinda late to
change them

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#1)
Re: initdb createuser commands

On 10/28/2016 04:31 PM, Samuel Williams wrote:

Hello,

Perhaps I'm missing something.

However, it seems to me that there are several "generically" named
commands, e.g. initdb, createuesr which come as part of postgresql. In
my mind, these commands are sufficiently generic that they might clash
with other commands. It's also not obvious they are part of
postgresql.

See here:
https://www.postgresql.org/docs/9.5/static/reference-client.html
https://www.postgresql.org/docs/9.5/static/reference-server.html

Wouldn't it make more sense to make them subcommand, of, say, a top
level pga (postgres admin) command, a bit like how `mysqladmin` works?

Just wondering as the naming of these commands seems overly generic
and for a new user it's hard to know what commands are available since
there is no common prefix (e.g. pg_<tab>) for these commands.

Other then initdb the commands(AFAIK) that do not have pg or postgres in
the name are just wrappers around the SQL commands of the same
name(roughly) eg dropdb = DROP DATABASE.

initdb is now accessible from pg_ctl:

https://www.postgresql.org/docs/9.5/static/app-pg-ctl.html

Thanks
Samuel

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Samuel Williams
space.ship.traveller@gmail.com
In reply to: John R Pierce (#2)
Re: initdb createuser commands

as these commands have been around for like 20 years, its kinda late to change them

I understand your position.

For new documentation, it should be better to say `pg_ctl init` rather
than `initdb`. I think that would guide users in the right direction
from the start. Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

initdb is now accessible from pg_ctl:

Thanks Adrian, that's really helpful and exactly what I was looking for.

Should we update the Arch Linux documentation to prefer these
commands? What is the recommendation here?

On 29 October 2016 at 12:39, John R Pierce <pierce@hogranch.com> wrote:

On 10/28/2016 4:31 PM, Samuel Williams wrote:

Just wondering as the naming of these commands seems overly generic
and for a new user it's hard to know what commands are available since
there is no common prefix (e.g. pg_<tab>) for these commands.

as these commands have been around for like 20 years, its kinda late to
change them

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#4)
Re: initdb createuser commands

On 10/28/2016 04:55 PM, Samuel Williams wrote:

as these commands have been around for like 20 years, its kinda late to change them

I understand your position.

For new documentation, it should be better to say `pg_ctl init` rather
than `initdb`. I think that would guide users in the right direction
from the start. Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

It does:

https://www.postgresql.org/docs/9.5/static/creating-cluster.html

initdb is now accessible from pg_ctl:

Thanks Adrian, that's really helpful and exactly what I was looking for.

Should we update the Arch Linux documentation to prefer these
commands? What is the recommendation here?

Given that pg_ctl initdb is in all current community supported versions
I would say that is alright. Probably better to just point folks at the
Postgres docs, a great deal of effort is done to keep them current. Also
you have the version selection at the top of each page that allows you
to walk back and forth through time.

On 29 October 2016 at 12:39, John R Pierce <pierce@hogranch.com> wrote:

On 10/28/2016 4:31 PM, Samuel Williams wrote:

Just wondering as the naming of these commands seems overly generic
and for a new user it's hard to know what commands are available since
there is no common prefix (e.g. pg_<tab>) for these commands.

as these commands have been around for like 20 years, its kinda late to
change them

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6John R Pierce
pierce@hogranch.com
In reply to: Samuel Williams (#4)
Re: initdb createuser commands

On 10/28/2016 4:55 PM, Samuel Williams wrote:

Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

except its the other way around. pg_ctl initdb invokes initdb, not the
other way around.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Samuel Williams
space.ship.traveller@gmail.com
In reply to: John R Pierce (#6)
Re: initdb createuser commands

I think there is an opportunity here to make the experience for new
users better.

Firstly, I think having one or two top level commands, perhaps pga
[postgres admin], and pg [postgres client], with well documented
sub-commands. Ideally `man pg` would tell you all the client commands
and `man pga` would tell you all the server commands. It could even be
implemented in the same way git is implemented with sub-commands (e.g.
git foo maps to git-foo internally).

When I see a bare command like `initdb` I wonder where that comes
from, how it relates to postgres and it also concerns me that it
doesn't seem to be obviously part of postgres. The same, when I saw
`createuser` I wondered if that was a postgres command, or an OS level
user creation command, or something else. It's one more thing that I
have to look up.

This is a cognitive load during the time when a new user is already
struggling to come to grips with all the other facets of the system. 7
+/- 2.

It's hard for a new user to know what commands are available because
the naming of commands doesn't follow any consistent structure. I
can't type pg<tab> and see something. In contrast `mysqladmin` has a
really good summary (similar to pg_ctl). Additionally, I'd gently
suggest that underscore in commonly used commands can be a pain for
certain keyboard layouts, even for me I have to use the shift key to
get type the command. `pgctl` would be easier to type.

While this may seem really trivial, to a new user it's not a great
experience out of the box.

I think these things could be really easy to improve (low hanging
fruit) and make the experience a lot better. Given how awesome
postgres is in other areas, it's disappointing that the command line
tools don't reflect the same level of engineering and thoughtfulness.

On 29 October 2016 at 13:46, John R Pierce <pierce@hogranch.com> wrote:

On 10/28/2016 4:55 PM, Samuel Williams wrote:

Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

except its the other way around. pg_ctl initdb invokes initdb, not the
other way around.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#8Samuel Williams
space.ship.traveller@gmail.com
In reply to: Samuel Williams (#7)
Re: initdb createuser commands

(For some reason the first time I sent this message it was blocked due
to the keyword "sub-". So, I've changed that and am re-sending.)

I think there is an opportunity here to make the experience for new
users better.

Firstly, I think having one or two top level commands, perhaps pga
[postgres admin], and pg [postgres client], with well documented
subcommands. Ideally `man pg` would tell you all the client commands
and `man pga` would tell you all the server commands. It could even be
implemented in the same way git is implemented with subcommands (e.g.
git foo maps to git-foo internally).

When I see a bare command like `initdb` I wonder where that comes
from, how it relates to postgres and it also concerns me that it
doesn't seem to be obviously part of postgres. The same, when I saw
`createuser` I wondered if that was a postgres command, or an OS level
user creation command, or something else. It's one more thing that I
have to look up.

This is a cognitive load during the time when a new user is already
struggling to come to grips with all the other facets of the system. 7
+/- 2.

It's hard for a new user to know what commands are available because
the naming of commands doesn't follow any consistent structure. I
can't type pg<tab> and see something. In contrast `mysqladmin` has a
really good summary (similar to pg_ctl). Additionally, I'd gently
suggest that underscore in commonly used commands can be a pain for
certain keyboard layouts, even for me I have to use the shift key to
get type the command. `pgctl` would be easier to type.

While this may seem really trivial, to a new user it's not a great
experience out of the box.

I think these things could be really easy to improve (low hanging
fruit) and make the experience a lot better. Given how awesome
postgres is in other areas, it's disappointing that the command line
tools don't reflect the same level of engineering and thoughtfulness.

On 29 October 2016 at 16:36, Samuel Williams
<space.ship.traveller@gmail.com> wrote:

I think there is an opportunity here to make the experience for new
users better.

Firstly, I think having one or two top level commands, perhaps pga
[postgres admin], and pg [postgres client], with well documented
sub-commands. Ideally `man pg` would tell you all the client commands
and `man pga` would tell you all the server commands. It could even be
implemented in the same way git is implemented with sub-commands (e.g.
git foo maps to git-foo internally).

When I see a bare command like `initdb` I wonder where that comes
from, how it relates to postgres and it also concerns me that it
doesn't seem to be obviously part of postgres. The same, when I saw
`createuser` I wondered if that was a postgres command, or an OS level
user creation command, or something else. It's one more thing that I
have to look up.

This is a cognitive load during the time when a new user is already
struggling to come to grips with all the other facets of the system. 7
+/- 2.

It's hard for a new user to know what commands are available because
the naming of commands doesn't follow any consistent structure. I
can't type pg<tab> and see something. In contrast `mysqladmin` has a
really good summary (similar to pg_ctl). Additionally, I'd gently
suggest that underscore in commonly used commands can be a pain for
certain keyboard layouts, even for me I have to use the shift key to
get type the command. `pgctl` would be easier to type.

While this may seem really trivial, to a new user it's not a great
experience out of the box.

I think these things could be really easy to improve (low hanging
fruit) and make the experience a lot better. Given how awesome
postgres is in other areas, it's disappointing that the command line
tools don't reflect the same level of engineering and thoughtfulness.

On 29 October 2016 at 13:46, John R Pierce <pierce@hogranch.com> wrote:

On 10/28/2016 4:55 PM, Samuel Williams wrote:

Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

except its the other way around. pg_ctl initdb invokes initdb, not the
other way around.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#9Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#8)
Re: initdb createuser commands

On 10/29/2016 03:31 AM, Samuel Williams wrote:

(For some reason the first time I sent this message it was blocked due
to the keyword "sub-". So, I've changed that and am re-sending.)

I think there is an opportunity here to make the experience for new
users better.

Firstly, I think having one or two top level commands, perhaps pga
[postgres admin], and pg [postgres client], with well documented
subcommands. Ideally `man pg` would tell you all the client commands
and `man pga` would tell you all the server commands. It could even be
implemented in the same way git is implemented with subcommands (e.g.
git foo maps to git-foo internally).

When I see a bare command like `initdb` I wonder where that comes
from, how it relates to postgres and it also concerns me that it
doesn't seem to be obviously part of postgres. The same, when I saw
`createuser` I wondered if that was a postgres command, or an OS level
user creation command, or something else. It's one more thing that I
have to look up.

This is a cognitive load during the time when a new user is already
struggling to come to grips with all the other facets of the system. 7
+/- 2.

It's hard for a new user to know what commands are available because
the naming of commands doesn't follow any consistent structure. I
can't type pg<tab> and see something. In contrast `mysqladmin` has a
really good summary (similar to pg_ctl). Additionally, I'd gently
suggest that underscore in commonly used commands can be a pain for
certain keyboard layouts, even for me I have to use the shift key to
get type the command. `pgctl` would be easier to type.

While this may seem really trivial, to a new user it's not a great
experience out of the box.

I think these things could be really easy to improve (low hanging
fruit) and make the experience a lot better. Given how awesome
postgres is in other areas, it's disappointing that the command line
tools don't reflect the same level of engineering and thoughtfulness.

On 29 October 2016 at 16:36, Samuel Williams
<space.ship.traveller@gmail.com> wrote:

I think there is an opportunity here to make the experience for new
users better.

Firstly, I think having one or two top level commands, perhaps pga
[postgres admin], and pg [postgres client], with well documented
sub-commands. Ideally `man pg` would tell you all the client commands
and `man pga` would tell you all the server commands. It could even be
implemented in the same way git is implemented with sub-commands (e.g.
git foo maps to git-foo internally).

When I see a bare command like `initdb` I wonder where that comes
from, how it relates to postgres and it also concerns me that it
doesn't seem to be obviously part of postgres. The same, when I saw
`createuser` I wondered if that was a postgres command, or an OS level
user creation command, or something else. It's one more thing that I
have to look up.

This is a cognitive load during the time when a new user is already
struggling to come to grips with all the other facets of the system. 7
+/- 2.

These are the commands a new user will need:

pg_ctl
psql
pg_dump
pg_dumpall
pg_restore

It's hard for a new user to know what commands are available because
the naming of commands doesn't follow any consistent structure. I
can't type pg<tab> and see something. In contrast `mysqladmin` has a
really good summary (similar to pg_ctl). Additionally, I'd gently
suggest that underscore in commonly used commands can be a pain for
certain keyboard layouts, even for me I have to use the shift key to
get type the command. `pgctl` would be easier to type.

While this may seem really trivial, to a new user it's not a great
experience out of the box.

I think these things could be really easy to improve (low hanging
fruit) and make the experience a lot better. Given how awesome
postgres is in other areas, it's disappointing that the command line
tools don't reflect the same level of engineering and thoughtfulness.

On 29 October 2016 at 13:46, John R Pierce <pierce@hogranch.com> wrote:

On 10/28/2016 4:55 PM, Samuel Williams wrote:

Even if maintaining the old commands, they could print
out to stderr "This command is deprecated and now wraps `pg_ctl init`.
Please use that command in the future".

except its the other way around. pg_ctl initdb invokes initdb, not the
other way around.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#10Samuel Williams
space.ship.traveller@gmail.com
In reply to: Adrian Klaver (#9)
Re: initdb createuser commands

FYI, https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users :)

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#11Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#10)
Re: initdb createuser commands

On 10/29/2016 03:02 PM, Samuel Williams wrote:

FYI, https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users :)

Seems to me the solution would be to change the above docs to reflect a
simpler procedure. In other words:

[postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'

becomes

[postgres]$ pg_ctl initdb -D '/var/lib/postgres/data' -o '--locale $LANG
-E UTF8 '

Remove 'Create your first database/user' and incorporate that into
'Access the database shell' where the database you connect to is
postgres instead of myDatabaseName and you create the user and database
using SQL commands.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#12John R Pierce
pierce@hogranch.com
In reply to: Samuel Williams (#10)
Re: initdb createuser commands

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20 years
of experience with it, as well as breaking virtually all existing
documentation, books, howto articles, etc, including the one you linked.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#13Melvin Davidson
melvin6925@gmail.com
In reply to: John R Pierce (#12)
Re: initdb createuser commands

On Sat, Oct 29, 2016 at 6:25 PM, John R Pierce <pierce@hogranch.com> wrote:

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20 years
of experience with it, as well as breaking virtually all existing
documentation, books, howto articles, etc, including the one you linked.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

I

*'d like to put my two cents in at this point. IMHO, the whole concept of
renaming commands "to make it easier for beginners to learn" is
ludicrous.If we rename a saw to woodcutter, or drill to holemaker, it would
do nothing to make someone learn carpentry easier. Likewise, renaming
commands would not make it easier to learn PostgreSQL. If someone truly
wants to learn to be a PostgreSQL DBA, there are many fine books already
in existence that guide them step by step how to do so. In addition, as
others have already pointed out, the PostgreSQL documentation clearly
describes how to use all commands in question and renaming (or prefixing
)them would do little to add to that. In fact, I'm pretty sure, existing
DBA's like myself would be quite upset if commands were arbitrarily
renamed.* *So as a wise man once said, If it ain't broke, don't fix it!*

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

#14Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: John R Pierce (#12)
Re: initdb createuser commands

On 30/10/16 11:25, John R Pierce wrote:

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20
years of experience with it, as well as breaking virtually all
existing documentation, books, howto articles, etc, including the one
you linked.

I think it would be good to have all the postgresql utilities prefixed
by pg_ to keep them together, but have aliases so existing scripts &
documentation (especially 3rd party) were still relevant.

However, I wouldn't consider it the highest priority.

Cheers,
Gavin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#15Samuel Williams
space.ship.traveller@gmail.com
In reply to: Gavin Flower (#14)
Re: initdb createuser commands

Adrian, I like the idea of teaching the appropriate SQL to achieve the
same thing. It makes a lot of sense, it's a pity the majority of
documentation doesn't do this.

John, if you read my earlier email you'd see that I proposed including
deprecation notices and aliasing the commands. I appreciate the need
for existing documentation to continue being relevant.

Melvin, I think you are blowing things out of proportion. I didn't
propose to rename the commands entirely such as "createuser" to
"prepareaccount". But, I think having "pg_createuser" or, preferrably,
"pg createuser". It's tidier, respectful of a limited global namespace
of command names, and potentially easier for everyone.

Gavin, I appreciate this is a low priority. But I think it's also
really easy to do by someone who is experienced. Perhaps a day or two
of work? So, it's low priority but also not that difficult and it's an
opportunity to improve the command line experience in a very
fundamental way for new users and experienced users alike.

In my mind, making Postgresql approachable by new users should be a
high priority.

This is really just my 2c, I'd be happy to submit a PR but can you
confirm intention to work on it to acceptance? Otherwise I'm just
wasting everyone's time including my own :)

On 30 October 2016 at 13:31, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:

On 30/10/16 11:25, John R Pierce wrote:

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20 years
of experience with it, as well as breaking virtually all existing
documentation, books, howto articles, etc, including the one you linked.

I think it would be good to have all the postgresql utilities prefixed by
pg_ to keep them together, but have aliases so existing scripts &
documentation (especially 3rd party) were still relevant.

However, I wouldn't consider it the highest priority.

Cheers,
Gavin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#16John R Pierce
pierce@hogranch.com
In reply to: Samuel Williams (#15)
Re: initdb createuser commands

On 10/30/2016 12:15 AM, Samuel Williams wrote:

But, I think having "pg_createuser" or, preferrably, "pg createuser".

psql -c "create user ...."

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#17Samuel Williams
space.ship.traveller@gmail.com
In reply to: John R Pierce (#16)
Re: initdb createuser commands

John - that's an interesting example. If it's that easy, why isn't
that the approach given in tutorials and other documentation? What was
the motivation for the createuser command?

On 30 October 2016 at 20:20, John R Pierce <pierce@hogranch.com> wrote:

On 10/30/2016 12:15 AM, Samuel Williams wrote:

But, I think having "pg_createuser" or, preferrably, "pg createuser".

psql -c "create user ...."

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#18Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#17)
Re: initdb createuser commands

On 10/30/2016 02:19 AM, Samuel Williams wrote:

John - that's an interesting example. If it's that easy, why isn't
that the approach given in tutorials and other documentation? What was
the motivation for the createuser command?

psql was less user friendly in the past?

Compare:

https://www.postgresql.org/docs/7.1/static/app-psql.html

to

https://www.postgresql.org/docs/9.5/static/app-psql.html

On 30 October 2016 at 20:20, John R Pierce <pierce@hogranch.com> wrote:

On 10/30/2016 12:15 AM, Samuel Williams wrote:

But, I think having "pg_createuser" or, preferrably, "pg createuser".

psql -c "create user ...."

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#19Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#15)
Re: initdb createuser commands

On 10/30/2016 12:15 AM, Samuel Williams wrote:

Adrian, I like the idea of teaching the appropriate SQL to achieve the
same thing. It makes a lot of sense, it's a pity the majority of
documentation doesn't do this.

John, if you read my earlier email you'd see that I proposed including
deprecation notices and aliasing the commands. I appreciate the need
for existing documentation to continue being relevant.

Melvin, I think you are blowing things out of proportion. I didn't
propose to rename the commands entirely such as "createuser" to
"prepareaccount". But, I think having "pg_createuser" or, preferrably,
"pg createuser". It's tidier, respectful of a limited global namespace
of command names, and potentially easier for everyone.

Gavin, I appreciate this is a low priority. But I think it's also
really easy to do by someone who is experienced. Perhaps a day or two
of work? So, it's low priority but also not that difficult and it's an
opportunity to improve the command line experience in a very
fundamental way for new users and experienced users alike.

In my mind, making Postgresql approachable by new users should be a
high priority.

A given the number of new users I see showing up and the number of those
using a GUI like pgAdmin I am not seeing the priority.

What it comes down to is adapting to your environment. In my day job I
work in a variety of different disciplines(plumbing, electrical,
equipment control, landscaping and so on) and I run into this context
shift all the time. In a perfect world everyone would agree on a common
way of doing things. This is not a perfect world so I have to adapt when
I move from one field to another and even within a field when dealing
with different people. I used to fight this, and still do when provoked,
but at some time point I realized I generally expended less energy just
learning 'the way' and getting on with my job. Not to say you do not
have some valid points, but you are pushing against something that has
significant inertia.

This is really just my 2c, I'd be happy to submit a PR but can you
confirm intention to work on it to acceptance? Otherwise I'm just
wasting everyone's time including my own :)

I do not see anyone pre-approving a PR that they have not seen.

On 30 October 2016 at 13:31, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:

On 30/10/16 11:25, John R Pierce wrote:

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20 years
of experience with it, as well as breaking virtually all existing
documentation, books, howto articles, etc, including the one you linked.

I think it would be good to have all the postgresql utilities prefixed by
pg_ to keep them together, but have aliases so existing scripts &
documentation (especially 3rd party) were still relevant.

However, I wouldn't consider it the highest priority.

Cheers,
Gavin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#20Samuel Williams
space.ship.traveller@gmail.com
In reply to: Adrian Klaver (#19)
Re: initdb createuser commands

A given the number of new users I see showing up and the number of those using a GUI like pgAdmin I am not seeing the priority.

Well, maybe the reason for this is that the command line tools are not
well thought out and people reach for alternatives.

but you are pushing against something that has significant inertia.

I understand where you are coming from. However, I don't think I'm
pushing against it. I'm just providing feedback and ideas. The ideas I
did provide don't really push, but are incremental improvements which
preserve backwards compatibility.

As a community I'd think that having feedback from a new user would be
valuable since as you say, sometimes when you get ingrained into the
"way of doing things" that you don't see how they could be improved or
different.

I do not see anyone pre-approving a PR that they have not seen.

I'm not suggesting anyone to pre-approve anything. I'm suggesting that
there is no point investing the effort if there is no desire to fix
the problem. If the problem would be acknowledged by a core dev and a
"Let's improve this" attitude were espoused, I'd feel more confident
to invest the time and effort required to improve things.

But so far, I'm getting the opposite.

Kind regards,
Samuel

On 31 October 2016 at 04:30, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

On 10/30/2016 12:15 AM, Samuel Williams wrote:

Adrian, I like the idea of teaching the appropriate SQL to achieve the
same thing. It makes a lot of sense, it's a pity the majority of
documentation doesn't do this.

John, if you read my earlier email you'd see that I proposed including
deprecation notices and aliasing the commands. I appreciate the need
for existing documentation to continue being relevant.

Melvin, I think you are blowing things out of proportion. I didn't
propose to rename the commands entirely such as "createuser" to
"prepareaccount". But, I think having "pg_createuser" or, preferrably,
"pg createuser". It's tidier, respectful of a limited global namespace
of command names, and potentially easier for everyone.

Gavin, I appreciate this is a low priority. But I think it's also
really easy to do by someone who is experienced. Perhaps a day or two
of work? So, it's low priority but also not that difficult and it's an
opportunity to improve the command line experience in a very
fundamental way for new users and experienced users alike.

In my mind, making Postgresql approachable by new users should be a
high priority.

A given the number of new users I see showing up and the number of those
using a GUI like pgAdmin I am not seeing the priority.

What it comes down to is adapting to your environment. In my day job I work
in a variety of different disciplines(plumbing, electrical, equipment
control, landscaping and so on) and I run into this context shift all the
time. In a perfect world everyone would agree on a common way of doing
things. This is not a perfect world so I have to adapt when I move from one
field to another and even within a field when dealing with different people.
I used to fight this, and still do when provoked, but at some time point I
realized I generally expended less energy just learning 'the way' and
getting on with my job. Not to say you do not have some valid points, but
you are pushing against something that has significant inertia.

This is really just my 2c, I'd be happy to submit a PR but can you
confirm intention to work on it to acceptance? Otherwise I'm just
wasting everyone's time including my own :)

I do not see anyone pre-approving a PR that they have not seen.

On 30 October 2016 at 13:31, Gavin Flower <GavinFlower@archidevsys.co.nz>
wrote:

On 30/10/16 11:25, John R Pierce wrote:

On 10/29/2016 3:02 PM, Samuel Williams wrote:

FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb,
createuser, createdb and several others. I think my suggestion is
still relevant and something that would improve the system for new
users

and it would break it for the existing community that has up to 20 years
of experience with it, as well as breaking virtually all existing
documentation, books, howto articles, etc, including the one you linked.

I think it would be good to have all the postgresql utilities prefixed by
pg_ to keep them together, but have aliases so existing scripts &
documentation (especially 3rd party) were still relevant.

However, I wouldn't consider it the highest priority.

Cheers,
Gavin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#21Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#20)
#22Mike Sofen
msofen@runbox.com
In reply to: Samuel Williams (#20)
#23Samuel Williams
space.ship.traveller@gmail.com
In reply to: Mike Sofen (#22)
#24Samuel Williams
space.ship.traveller@gmail.com
In reply to: Samuel Williams (#23)
#25Melvin Davidson
melvin6925@gmail.com
In reply to: Samuel Williams (#24)
#26Christofer C. Bell
christofer.c.bell@gmail.com
In reply to: Melvin Davidson (#25)
#27Melvin Davidson
melvin6925@gmail.com
In reply to: Christofer C. Bell (#26)
#28Alban Hertroys
haramrae@gmail.com
In reply to: Christofer C. Bell (#26)
#29Daniel Verite
daniel@manitou-mail.org
In reply to: Samuel Williams (#17)
#30Samuel Williams
space.ship.traveller@gmail.com
In reply to: Daniel Verite (#29)
#31Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Samuel Williams (#30)
#32Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Christofer C. Bell (#26)
#33Samuel Williams
space.ship.traveller@gmail.com
In reply to: Jim Nasby (#32)