[PoC] XMLCast (SQL/XML X025)
От | Jim Jones |
---|---|
Тема | [PoC] XMLCast (SQL/XML X025) |
Дата | |
Msg-id | 7b99d466-985f-4d27-8c93-9b98c6945ebb@uni-muenster.de обсуждение исходный текст |
Ответы |
Re: [PoC] XMLCast (SQL/XML X025)
|
Список | pgsql-hackers |
Hi, This is a PoC that implements XMLCast (SQL/XML X025), which enables conversions between SQL and XML data type. It basically does the following: * When casting an XML value to a SQL data type, XML values containing XSD literals will be converted to their equivalent SQL data type. * When casting from a SQL data type to XML, the cast operand will be translated to its corresponding XSD data type. SELECT xmlcast(now() AS xml); xmlcast ---------------------------------- 2024-07-02T17:03:11.189073+02:00 (1 row) SELECT xmlcast('2024-07-02T17:03:11.189073+02:00'::xml AS timestamp with time zone); xmlcast ------------------------------- 2024-07-02 17:03:11.189073+02 (1 row) SELECT xmlcast('P1Y2M3DT4H5M6S'::xml AS interval); xmlcast ------------------------------- 1 year 2 mons 3 days 04:05:06 (1 row) SELECT xmlcast('<foo&bar>'::xml AS text); xmlcast ----------- <foo&bar> (1 row) SELECT xmlcast('1 year 2 months 3 days 4 hours 5 minutes 6 seconds'::interval AS xml) ; xmlcast ---------------- P1Y2M3DT4H5M6S (1 row) SELECT xmlcast('42.73'::xml AS numeric); xmlcast --------- 42.73 (1 row) SELECT xmlcast(42730102030405 AS xml); xmlcast ---------------- 42730102030405 (1 row) Is it starting in the right direction? Any feedback would be much appreciated. Best, Jim
Вложения
В списке pgsql-hackers по дате отправления: