theory / pgtap

PostgreSQL Unit Testing Suite
https://pgtap.org
984 stars 92 forks source link

Improve data type parsing and formatting #317

Closed theory closed 1 year ago

theory commented 1 year ago

Add a C module to delegate the parsing of data types by col_type_is() to the Postgres core parseTypeString() function, which is the canonical type parser. This ensure that no matter the aliasing or typemod specified for a data type, we end up with exactly the same spelling as the core uses, ensuring more accurate comparisons. This was necessitated by the change in 1e1d745 that added support for type aliases but broke complicated typmods such as second(0) in interval second(0). Resolves #315.

Document the two new functions, parse_type() and format_type_string() and remove the documentation for pg_typeof(), which hasn't shipped with pgTAP in several years, since it has been in the Postgres core since 8.3.

Also, fix the name of the v1.3.9 upgrade file.

mathemancer commented 1 year ago

Just noticed this fix showing up in the debian package. Thanks for this, @theory !

theory commented 1 year ago

Oh, nice that was quick, of them!