↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / System Information Functions And Operators

Parses a string of text, extracts a potential type name from it, and translates that name into a type OID.

Reading PG 18current·documented in 14 of 27 versions, 9.4 to 20

Signatures & examples

to_regtype ( text ) → regtype
Parses a string of text, extracts a potential type name from it, and translates that name into a type OID. A syntax error in the string will result in an error; but if the string is a syntactically valid type name that happens not to be found in the catalogs, the result is NULL. A similar result is obtained by casting the string to type regtype (see Section 8.19), except that that will throw error for name not found.
Version history 4
  1. 16 → 17 changed
  2. 15 → 16 changed
  3. 12 → 13 changed
  4. 9.3 → 9.4 added

Definition snapshot: b7bd9cda · English manual source