HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMajor

What are the valid formats of a PostgreSQL schema name?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlthewhatarenamevalidformatsschema

Problem

I can't seem to find documentation that describes the valid formats of a PostgreSQL schema name. I know that a schema name cannot:

  • start with a number



  • have spaces



  • start with pg_



What else? Where should I look?

Solution

Per the fine documentation, I think this might be what you're looking for.


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...

Context

StackExchange Database Administrators Q#45589, answer score: 29

Revisions (0)

No revisions yet.