X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C791ED1B4E4 for ; Mon, 10 Nov 2003 16:10:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 31704-07 for ; Mon, 10 Nov 2003 12:10:19 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 94A6DD1B556 for ; Mon, 10 Nov 2003 12:10:17 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hAAGAG19029167; Mon, 10 Nov 2003 11:10:16 -0500 (EST) To: jose Cc: pgsql-admin@postgresql.org Subject: Re: CREATE DATABASE In-reply-to: <3FAF6930.2040508@sferacarta.com> References: <3FAF6930.2040508@sferacarta.com> Comments: In-reply-to jose message dated "Mon, 10 Nov 2003 11:32:16 +0100" Date: Mon, 10 Nov 2003 11:10:16 -0500 Message-ID: <29166.1068480616@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/163 X-Sequence-Number: 11150 jose 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