Re: [PoC] XMLCast (SQL/XML X025) - Mailing list pgsql-hackers

From Jim Jones
Subject Re: [PoC] XMLCast (SQL/XML X025)
Date
Msg-id 8266dac8-5b21-423d-ad67-64537f602b6c@uni-muenster.de
Whole thread Raw
In response to Re: [PoC] XMLCast (SQL/XML X025)  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: [PoC] XMLCast (SQL/XML X025)
List pgsql-hackers

On 28/11/2025 19:27, Marcos Pegoraro wrote:
> You wrote character only on the SGML part, all others are text. When
> you write numeric, the user understands that it can be bigint, integer,
> numeric, etc, so users can get confused about TEXT and CHAR(N), because
> the only place you wrote character is on SGML.


Character data type in this sentence means the character types[1] as a
category, not the type character or character varying.

"It supports casting between xml and character, numeric, date/time,
binary, and boolean data types."

Sorry if I'm misunderstanding your point.

> And interval is still not on that list.


Interval is already part of the date/time types[1]


> 
> And about domains
> + switch (xexpr->targetType)
> + {
> + case XMLOID:
> ...
> + case INT4OID:
> 
> Does this shape capture this type ?
> CREATE DOMAIN i32 AS integer;

Not really. XMLCast implements the type-specific lexical and semantic
rules defined by SQL/XML, which apply only to base (non-domain) data
types. Although the grammar permits a domain name as a target, the
standard does not define any XML-specific semantics for domains.
Supporting them would go beyond the scope of this patch, and users
who need a domain can IMHO cast the XMLCast result afterward.

Thanks!

Best, Jim

[1] https://www.postgresql.org/docs/current/datatype-character.html
[2] https://www.postgresql.org/docs/current/datatype-datetime.html



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: IPC/MultixactCreation on the Standby server
Next
From: Mihail Nikalayeu
Date:
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY