select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / STRING FUNCTIONS AND OPERATORS

Returns the given string suitably quoted to be used as an identifier in an SQL statement string.

Signatures & examples

quote_ident ( text ) → text
Returns the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the string contains non-identifier characters or would be case-folded). Embedded quotes are properly doubled. See also Example 41.1.
quote_ident('Foo bar') → "Foo bar"
Version history 8
  1. PG 16 → 17changed
  2. PG 13 → 14changed
  3. PG 12 → 13changed
  4. PG 11 → 12changed
  5. PG 10 → 11changed
  6. PG 9.6 → 10changed
  7. PG 9.5 → 9.6changed
  8. PG 9.2 → 9.3changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source