↑↓ 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

to_regtypemod

Read the PG 18 manual

Parses a string of text, extracts a potential type name from it, and translates its type modifier, if any.

Reading PG 18current·documented in 4 of 27 versions, 17 to 20

Signatures & examples

to_regtypemod ( text ) → integer
Parses a string of text, extracts a potential type name from it, and translates its type modifier, if any. 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. The result is -1 if no type modifier is present.
format_type(to_regtype('varchar(32)'), to_regtypemod('varchar(32)')) → character varying(32)
Version history 1
  1. 16 → 17 added

Definition snapshot: b7bd9cda · English manual source