Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve data type parsing and formatting #317

Merged
merged 1 commit into from
Sep 23, 2023
Merged

Improve data type parsing and formatting #317

merged 1 commit into from
Sep 23, 2023

Conversation

theory
Copy link
Owner

@theory theory commented Sep 18, 2023

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.

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.
@theory theory merged commit 4ec32e7 into master Sep 23, 2023
30 checks passed
@theory theory deleted the parse-type branch September 23, 2023 21:17
@mathemancer
Copy link

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

@theory
Copy link
Owner Author

theory commented Oct 6, 2023

Oh, nice that was quick, of them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

col_type_is cannot handle expected type interval second(0)
2 participants