creating a database

Started by PG Bug reporting formabout 1 year ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/tutorial-createdb.html
Description:

Dear,

I was reading intro to setup of postgresql, and looking at
https://www.postgresql.org/docs/current/tutorial-createdb.html#TUTORIAL-CREATEDB

Regarding the sentence "To create a new database, in this example named
mydb, you use the following command:"
I guess this is on the server side, in a Linux shell or similar?
But it is not explicitly stated, and this section comes right after
explanation of client-server.

I think this should be clarified in the text.
And what also could be clarified: can a database only be created on the
server side?
Or is there also a client (SQL) command to create a new database on the
server?

best regards,
Raf

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: creating a database

On Sunday, February 2, 2025, PG Doc comments form <noreply@postgresql.org>
wrote:

I guess this is on the server side, in a Linux shell or similar?

I think this should be clarified in the text.

We haven’t even mentioned psql yet, aside from the conventions page where
we cover $ means a shell prompt.

And what also could be clarified: can a database only be created on the
server side?
Or is there also a client (SQL) command to create a new database on the
server?

The description of createdb explains it is a wrapper for the “create
database” sql command.

If I am to add anything it would probably be on the “architecture
fundamentals” page. The points brought up are not specific to createdb and
probably should be explained up-front as to the fact we have wrapped a
number of SQL utility commands for the DBA as executable programs.

David J.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: David G. Johnston (#2)
Re: creating a database

"David G. Johnston" <david.g.johnston@gmail.com> writes:

On Sunday, February 2, 2025, PG Doc comments form <noreply@postgresql.org>
wrote:

And what also could be clarified: can a database only be created on the
server side?
Or is there also a client (SQL) command to create a new database on the
server?

The description of createdb explains it is a wrapper for the “create
database” sql command.

Yeah. What this page is really meant to do is help you get past
typical problems in accessing an installation you've just set up.
We mustn't load it down with answers to every question a novice
could have, especially not questions that are answered on
adjacent or linked pages.

If we were to extend it at all, I'd think about expanding its charter
to include "help you get past typical problems in accessing an
installation on another machine". This'd involve mentioning
the -h and -p switches, probably. But I'm not sure if that would
be a net benefit or just confuse some users more than it helps
others.

Another thought is that the first para on the next page, which
mentions alternatives such as pgAdmin, maybe should be moved
here with some suitable alterations (or added to the end of
Architectural Fundamentals, perhaps). Both of these pages are
oriented towards "access Postgres from a terminal command line",
which I concede is probably a minority thing anymore.

regards, tom lane