Re: All numeric database names?

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Chris Hoover <revoohc(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: All numeric database names?
Date: 2008-01-08 20:59:11
Message-ID: 4783E41F.6040608@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Chris Hoover wrote:
> Just wanted to check, are there any problems/gotcha's to having a
> cluster of all numeric database names? We are thinking of switching
> our database naming system to use our customer number (a 6 digit
> integer) for the database name. Is a negative/bad thing?
Technically speaking, it will be of data type "name". You can use all
digits for the database name as you can with tables and columns (create
table "1" ("2" text);) but you may run into places where you have to
quote the name. For instance, in psql you might need to switch databases
with:

\c "123456"

instead of

\c 123456

Alternately, you could prepend 1+ alpha characters to the customer
numbers to create names like c123456 or cust123456 which don't need to
be quote-enclosed. Personally, I try to avoid reserved words and
anything else that requires special handling.

Cheers,
Steve

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2008-01-08 21:58:46 Re: All numeric database names?
Previous Message Mija Lee 2008-01-08 20:32:23 -d option in pg_dump