pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
All numeric database names?
3+ messages / 3 participants
[nested] [flat]

* All numeric database names?
@ 2008-01-08 19:03  Chris Hoover <revoohc@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Chris Hoover @ 2008-01-08 19:03 UTC (permalink / raw)
  To: pgsql-admin

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?

Thanks,

Chris

PG 8.1

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: All numeric database names?
@ 2008-01-08 20:59  Steve Crawford <scrawford@pinpointresearch.com>
  parent: Chris Hoover <revoohc@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Steve Crawford @ 2008-01-08 20:59 UTC (permalink / raw)
  To: Chris Hoover <revoohc@gmail.com>; +Cc: 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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: All numeric database names?
@ 2008-01-08 21:58  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Steve Crawford <scrawford@pinpointresearch.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2008-01-08 21:58 UTC (permalink / raw)
  To: Steve Crawford <scrawford@pinpointresearch.com>; +Cc: Chris Hoover <revoohc@gmail.com>; pgsql-admin

Steve Crawford <scrawford@pinpointresearch.com> writes:
> 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.

I'd recommend that too.  Quite aside from the quoting problem, this
will save you tons of confusion if you ever have to deal with database
OIDs (during disaster recovery perhaps).

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2008-01-08 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-08 19:03 All numeric database names? Chris Hoover <revoohc@gmail.com>
2008-01-08 20:59 ` Steve Crawford <scrawford@pinpointresearch.com>
2008-01-08 21:58   ` Tom Lane <tgl@sss.pgh.pa.us>

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