Valid characters for user/role/group names?

From: "Roderick A(dot) Anderson" <raanders(at)cyber-office(dot)net>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Valid characters for user/role/group names?
Date: 2009-02-25 16:50:15
Message-ID: 49A576C7.3090909@cyber-office.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In my continuing quest for multi-tenant ways I'm trying to come up with
a method to name roles, users, and groups that will not clash across the
cluster. The plans are to have one database per tenant and place
applications in different schema in those databases. This is working
fine so far but I'm now trying to come up with a naming scheme that will
allow a dba account for tenant_1, tenant_2, etc.
I found, several months ago, a posting about using the at "@" symbol
in a role name so there could be a dba(at)tenant_1, dba(at)tenant_2, etc. I
can't find the article again but I remember there was a reference to
possible issues with using the '@' and username entries in pg_hba.conf
If the '@' isn't a problem (other than possibly not being valid
according to the SQL standard I was going to use an '@tenant_1.txt'
entry in pg_hba.conf and place dba(at)tenant_1, bob(at)tenant_1,
sally(at)tenant_1 in it.

But according to

http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html

"SQL identifiers and key words must begin with a letter (a-z, but also
letters with diacritical marks and non-Latin letters) or an underscore
(_). Subsequent characters in an identifier or key word can be letters,
underscores, digits (0-9), or dollar signs ($). Note that dollar signs
are not allowed in identifiers according to the letter of the SQL
standard, so their use might render applications less portable. ... "

I'm wondering what the reference to "non-Latin" letters means.

Anyone have a solution to this?

Thanks,
Rod
--

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-02-25 16:58:48 Re: Valid characters for user/role/group names?
Previous Message Dave Page 2009-02-25 16:47:58 Re: [GENERAL] speaking of 8.4...