pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jose <jose@sferacarta.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: CREATE DATABASE
Date: Mon, 10 Nov 2003 11:10:16 -0500
Message-ID: <29166.1068480616@sss.pgh.pa.us> (raw)
In-Reply-To: <3FAF6930.2040508@sferacarta.com>
References: <3FAF6930.2040508@sferacarta.com>

jose <jose@sferacarta.com> writes:
> PostgreSQL is not consistent in the way it uses upper/lower case to 
> create databases and access it.

Folding case in unquoted names in SQL commands is required by the spec.
On the other hand, we decided some time ago that names appearing in
command-line arguments should be taken literally.  Before that we tried
to make the command tools work like SQL, but that didn't work well
because the shell is going to process the arguments before we get them.

For example, suppose in SQL you do
	create database "MyDb";

Now when you want to connect to it, you try
	psql "MyDb"
Unfortunately the shell is going to strip those double quotes, so what
psql gets is going to look like just MyDb.  If it thinks to itself
"unquoted, so fold to lower case", then you lose.  People ended up
having to do things like
	psql '"MyDb"'
to get to their mixed-case databases.

In short, it's inconsistent because it works better this way.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <29166.1068480616@sss.pgh.pa.us>
Permalink:  ../29166.1068480616@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29166.1068480616@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jose@sferacarta.com
  Subject: Re: CREATE DATABASE
  In-Reply-To: <29166.1068480616@sss.pgh.pa.us>
  References: <3FAF6930.2040508@sferacarta.com> <29166.1068480616@sss.pgh.pa.us>

* 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