From 1b5a87c35fc20d1f2ce820166f4c28811030bf9a Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Sun, 21 Sep 2025 21:00:08 +0800 Subject: [PATCH 1/2] fix: array type conversion in format_type --- datafusion-postgres/src/pg_catalog/format_type.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/datafusion-postgres/src/pg_catalog/format_type.rs b/datafusion-postgres/src/pg_catalog/format_type.rs index cfcda4d..b7b5a6f 100644 --- a/datafusion-postgres/src/pg_catalog/format_type.rs +++ b/datafusion-postgres/src/pg_catalog/format_type.rs @@ -5,7 +5,10 @@ use datafusion::{ array::{Array, StringBuilder}, datatypes::DataType, }, - common::{cast::as_int32_array, DataFusionError}, + common::{ + cast::{as_int32_array, as_int64_array}, + DataFusionError, + }, logical_expr::{ ColumnarValue, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl, Signature, TypeSignature, Volatility, @@ -14,7 +17,7 @@ use datafusion::{ pub(crate) fn format_type_impl(args: &[ColumnarValue]) -> Result { let args = ColumnarValue::values_to_arrays(args)?; - let type_oids = as_int32_array(&args[0])?; + let type_oids = as_int64_array(&args[0])?; let typemods = if args.len() > 1 { Some(as_int32_array(&args[1])?) @@ -35,7 +38,7 @@ pub(crate) fn format_type_impl(args: &[ColumnarValue]) -> Result Date: Sun, 21 Sep 2025 22:19:09 +0800 Subject: [PATCH 2/2] feat: update oid to int32 in arrow --- .../export_pg_catalog_arrow.sh | 2 +- .../pg_aggregate.feather | Bin 16882 -> 16898 bytes .../pg_catalog_arrow_exports/pg_am.feather | Bin 1338 -> 1354 bytes .../pg_catalog_arrow_exports/pg_amop.feather | Bin 14474 -> 14506 bytes .../pg_amproc.feather | Bin 12514 -> 12530 bytes .../pg_catalog_arrow_exports/pg_cast.feather | Bin 5882 -> 5914 bytes .../pg_collation.feather | Bin 29802 -> 29818 bytes .../pg_conversion.feather | Bin 5946 -> 5946 bytes .../pg_language.feather | Bin 2130 -> 2178 bytes .../pg_opclass.feather | Bin 5682 -> 5746 bytes .../pg_operator.feather | Bin 36594 -> 36658 bytes .../pg_opfamily.feather | Bin 3402 -> 3434 bytes .../pg_catalog_arrow_exports/pg_proc.feather | Bin 194770 -> 194802 bytes .../pg_catalog_arrow_exports/pg_range.feather | Bin 1930 -> 1978 bytes .../pg_ts_config.feather | Bin 1730 -> 1762 bytes .../pg_ts_dict.feather | Bin 2530 -> 2562 bytes .../pg_ts_parser.feather | Bin 2058 -> 2074 bytes .../pg_ts_template.feather | Bin 1586 -> 1602 bytes .../pg_catalog_arrow_exports/pg_type.feather | Bin 55978 -> 56026 bytes .../src/pg_catalog/format_type.rs | 48 +++++++++++++----- .../src/pg_catalog/pg_attribute.rs | 32 ++++++------ 21 files changed, 53 insertions(+), 29 deletions(-) diff --git a/datafusion-postgres/export_pg_catalog_arrow.sh b/datafusion-postgres/export_pg_catalog_arrow.sh index 10ac861..8ea42b6 100755 --- a/datafusion-postgres/export_pg_catalog_arrow.sh +++ b/datafusion-postgres/export_pg_catalog_arrow.sh @@ -173,7 +173,7 @@ def pg_type_to_arrow_type(pg_type, is_nullable=True): 'character varying': pa.string(), 'character': pa.string(), 'name': pa.string(), - 'oid': pa.uint32(), # OIDs are unsigned + 'oid': pa.int32(), # OIDs are unsigned 'regproc': pa.string(), 'regtype': pa.string(), 'regclass': pa.string(), diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_aggregate.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_aggregate.feather index 7e69410f19bbd6e066ec6b92bd7e6aeb1828057b..68de2ee4fa7099544dccecfeb2f86491f28f609f 100644 GIT binary patch delta 479 zcmey=%-Gbz$m?@dYLZ zhB-i-1H=|U%mTz07=dCyoC3reK>TKMr>!;PorwpnStb7b{~t1$kx`p>50C{kf>8lT z^h_?albalE$IJT#N%RO%RGU}lFGAfPpic402kb;_QjkPVAZ#W9ph+@740J6Ra01E1 t^z`EVqLTaqAbSQ>&t@L`yG)y(vS?c{ewZw1J6!#Ehlz`Wm4N{gqX5Yhdk6pk delta 405 zcmZo_Vf@t0$mZ9ap)2sI3UC-d2fO+LUV!gUF%$OIzvgOQJmje&!K fg@FyIbF%;whc)Ai$&$81)A4tiI9VAOAn^bISx#$X diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_am.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_am.feather index 372445a7116f2523ece692cc81391ada675c5bea..1eb34068944196d9d349a3320086b99243721aca 100644 GIT binary patch delta 106 zcmdnRb&8AEF(}AC+>n9cKM-(Cn9cKM*iXH7!>3mZpgs!9|#;K@*1n%VPs&K0>lwOECa+37#JAV0C5EnI{+~Y5J&u* ze9v5L@&Pju-jIL){{uxB6@bKq$#>1vc{`9qj!fn?SLWS;B=TjlrMW(%%H+G|@{>Ev zd3Y6o_5!ss3IK^1ps4ud1Lh*U5l~T(sZ)TW+Po8xM9xeWv{2_b0u`BTV__o5!N9}7 z!N3m0V8E!b*_MgfM9>7tQvqU-qk(>52$&pbCOx^pOk`+!Qx3zMKtE+LF)%=45dcSg BdS3tl delta 465 zcmZ2g*j32u7!>3mZpgs!9|#O4@*1n2VPs(F0O9~3mH^@_3=9klfVcpNZGe~sh%+Xp zYI7$2`~P17$eA;7t~%!=DCf+?i^`n)pqw9*85#9?HGn1ql`#nb3606NjPjx!3_J`R z4D3J*28J@+@b0#lj)aIH7n9cKM>5A$ZITVz{tSxgn@x!1rX-|u?Y~f0P&BBk=iUOKvk0q z7)2(|5#W^pvVr1^0ze{S;z4cR5U79xP+-DjLj!Hz9wd3YI06-%9KmQJ pz`?-7z`?){#9+Xn9cKM+iq$ZIUA!^pt!gn@x!4G@`(HGs;1 z93}xEp)zrzv?vDy4+94SI}n2bBS<1;;z#j`7eqMYfQl7>{23EJYI9D4a?SuHCp$2T wup9#lOkQAM!o$G82Gq_1BpDbsFJRoD%eY{2p#A{3L<-p@AcyY&h6N;m0RN&-_y7O^ diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_cast.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_cast.feather index 60d6285671339d5b3f84a3909979938969e5d0bc..9edd1049634a78c2f4c4f38474bb5782f5adfdc0 100644 GIT binary patch delta 260 zcmeyRJ4=t(F(}AC+>n9cKM-_Gn9cKM+(*A1FGLV af$@hhW5?u9QQBB0g=`tvfj}QYya@mXmp<(P diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_collation.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_collation.feather index c42fcee236437f4347cf7b55a3a833e87e8f57a3..bfd5b372956b56c1d924c6ce4bf9486dbe5885a4 100644 GIT binary patch delta 315 zcmaF$g7Mc2MqbCDApdYf28RDYaA6{^HSY^X28InlTm!@|o9`BiGfqBH%rp57Bgfra(m|zbQ@;XSgwWVWITo1BEhla+4H_n}81Z Kz{J1+2_FE}iBr)4 diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_conversion.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_conversion.feather index 308f77728d9a2db00c3b81143de3e9723d61ed45..7118783f6971cd938debb9ecc22f805a13541064 100644 GIT binary patch delta 236 zcmdm`w@Yt=2de-h1H+BUjiQrzzx@0EpMimaQ2|I8Or9tvKG{M{gjeT3LNsG?qL?~w z0+PrapgL`i8BmeQ2gDKtIT&~tI2hQ07z`K{HveTb7G^a8@>C|9imFde5S5|2t#TN) R0_7|# zj0!-i0H|p41xAs{HjDzCX+RE0aKXg4;*$#)MObEmWP2DB1Q{6EfZAAqBm)CT1;ggQ ljK;#O7C@H9WK&UfMuv%+@-%mb6uL7cm>3uwgM$3S4FMckM1lYS diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_language.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_language.feather index aad59be97997a88830326df799f45f203bdc8f15..b1a124b9871c941e681fa0f7d66c7bf31e357bce 100644 GIT binary patch delta 373 zcmca4&?Ly~7!>3mZpgs!9|#O4@)}E?U}RwE0O9~3RsrG<3=9lgfVgI2q&@43fB*k4 znK)OQcL9(A6l7EY5_cwEROh{dBp@)Ekx`qM2WTQtmQevncuY2B)Ml*#id0NaWmINe z0%R?i+{>uWF$1b<@(#uXQ4R(k1`Y;xAO-_Q1rW7amFYLLpaqbn0mLjo40IKP!(>A? hX`s6qfQmuNS)e2X11FF-fS!=U=7|U<1_nq-0{{hrV3mZpgs!9|$BS@)}F-U}RvZ0Ad#)mH^@>3=9lwfVg5}q&@47fB*k) znK)OQa~+VO02F;OS&&_w>mHOR@qgkxvB?UIBAh}%<3RF0lN}kgSsQ@7n#qNX%B(AZ ztR<6YGODx80n9cKM)v91IH0w$9c8P$1pfNFsn z85Mv;#^gXoZQc|lkp+``MYS2vOy0<-&T#}PKKTx#i6{pH4+94SI}n2bqXLN9EX(v- nP|yO%(g0$R8-Y$|aF{G9B0bqaL}JkUN)DT^BA6H$An^kL)E;d- delta 391 zcmeyQvq^{7F(}AC+>n9cKM)8^B0&8QCVvD9UxNw@O#Ub;CzO_$o0(GyRK*5V08;G$6c(Rc zAS%FV1{EoooXDunnFZx7nLLwGoAClrl{(8Ypx9&uF%w>(b_Nch)oefm6gJy3y%rQS n0Wwv97~~$HGZ_>nTZ%|ejt~(Uls=F`@d41e7EBBbkgx{;i4t-c diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_operator.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_operator.feather index 245fc95d3d7b248c95e132dd7fd9461cdea19d35..b41a920eba6a91a40e5c141b15688ec680e29882 100644 GIT binary patch delta 616 zcmew~mub^HCSJ#&ApdYf28RDY;4qQb*!Bh!1H%j;jsap7ApXI~z;FVHX8>^u5bFT( z7X}7~13=sX#4$i@0K_anTrxSaM~*8iKQoVE!QcP?=K#6NtS5l1BOnRx09inL85MxU zoXNdR+8i^WB9r$pB?xdZ@Gx*Numdp|FmBdhUeLi9F!^NnXfQzn4irps=)nXE%?xG+ I21wEZ05BBBDgXcg delta 574 zcmdlqkLlA~CSJ#&ApdYf28RDYpfHiw*me&S149iEy8y8O5I&%giw zIVSfqicctwmIGxJgyN`Tyg$%RbnoM|Ax0*zlV zxv@{1WfqV(`36%04+8@m0|(F_Y(S~a9?T0m7!4-B>>j}(B840xpaAn=W?+CM7yx3C B$36f6 diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_opfamily.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_opfamily.feather index 05c88060ef2e7c87334f367c519392602eb85cb0..1e384542b78b35fcdcb1d3aa579dada7b27b3b37 100644 GIT binary patch delta 240 zcmX>l^-7A@F(}AC+>n9cKM+Jr9lx zGA0-DX!E8Zi7c47Q=9S3n9cKM;6KK)q~0^_vqIS8y>#Oy=aFlIc>& Nrh{F?$iM*c2mpzlIfMWJ diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_proc.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_proc.feather index d6bbfdf361faefec82e498cf53849c5e6a9a3fce..11fed4ba686f0b0f73d614c63b2ac5c132b0a356 100644 GIT binary patch delta 931 zcmeH`ze`(D6vxlG@7C=#`Et| ze40P;bm-3af920wWnTrv;|A`NUUqdF_M}X4RDXaPmS)w_n46u>EzV@-Xis)I&gXK* z9y?+ykDp4v8qiBc-(QerW%})DOC$sbwJ`q zW2jWCt;`I{h~Zi}I5Q<#QSIURx7n%On{0-*;1%Sz(JDU;M;{_PK;~MvP&Xwh8{N9A z?E9Va#B}u-)GL`Vqk0KyLDt~yKyAx6)3pmw*oz|w$8utNY)XSp;3A&sXgG#z#{@?Z zUirkU|us0H_XLPg?Jj7XL_EDto~%K7GAb@yA9!{6=>C O-^j`{NLxg;U-=Id%|gro delta 963 zcmeH`ze`(D6vxlK@7))ln))1!R-&Y&@T6~0(TW|4Exba9f6>X3)^dA9?-e$IySF&;y^#_j~Srk8|F6w|w35 z>$)ZQa$;h9dXUIR^yPv>uf8jyEQojIgkD-Pg3N>c{*@ z3wKZ}HBkW6qIPKVo|k1$TPm@T@Vul)89cO7%RTt`-bO>z26-8$m4> zT+kh1v8jgejh?HhIf6c_J1L%1wmH*qTfD8D<}VF*;-mBsUn#eh$Us**R-#qc_~aVm gt7}NFBt}0Ulx6?_!Ty_r?f!eP)&C)e3D3mZpgs!9|$f?Bnqyb?f7Kw(A&AQ3ZJkx_i|9ySr)03^{VKv8Yp4kVE?lX=ZFg}=kl2w1eoTY&2ET9m>4`2vEf(`(1m{1u2 delta 282 zcmdnR-^I`C7!>3mZpgs!9|(3#3YoCFoP093BdatO$qJb_Vx tQDO2%MoBI<1`eRHY(UMM?=Z5kFrJwFkX4_K4v;`N0OW%QKwm?G0|3K*Q(*uA diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_config.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_config.feather index bb99403794645534a210d3a371e286ce463d150a..5fb8ea69154b68bfacff581d4e8664cfc2035deb 100644 GIT binary patch delta 230 zcmX@a`-qpn9cKM+Jr-w0}lfS13M6d0psQXMgn9cKM;6KKz(dLb(<3y6<8P}CO5KD!DK09lfkZF JWMF`J003&)IoSXJ diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_dict.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_dict.feather index 2cd8bbfa7690a97b30f6dfadfd5cc758e23f137f..839c290ef80b087391a782b710a11e3365d7fb56 100644 GIT binary patch delta 238 zcmaDP+$6&57!>3mZpgs!9|#sq0{xff+z0;*)(iML4EFMJMYprU-B_@Gx*Numdp|Fm9g1xQ2~!!(>km TeJWcehi(3mZpgs!9|$H)1&A9a`nt2)0A(yDKjhHnGy<{| zfWkQwFRF7UK{<1PQsR?k7)4m70YxS^aHjAuFt9OjFt7kg28PXR7}u~dE|?t2p-%;) QrI3vVIb{dXwGb}=0LA!1aR2}S diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_parser.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_parser.feather index 1253c924c0707c484990e843288edc8588b86226..46fc55d558956d73a4b7cfac8ce591c6fa43172d 100644 GIT binary patch delta 246 zcmeAYm?gmL7!>3mZpgs!9|$f?Z~O|M#02~a+9?gIawC~Iddi_vTJk90J0bu7#Jr{U{4U> pVBlfkU|pG0?^hUKwm+;3IKm^TW|mX delta 270 zcmbOw&?Ug@7!>3mZpgs!9|%rN0OAh}3=9W=cmfco0I>-WvjFjliHYj0 zKmPsy|7BvL_{1dwtSUgA3KMrKv-$uT9ups`vsM5ZB@-XYP1a`QWL*N}ESPM`sLe79 v$eNtPn83rpz{bDi>s+~zxsDJ+aPCOfj})4^&fWUCc`)_(x{6cPjg+rwSB diff --git a/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_template.feather b/datafusion-postgres/pg_catalog_arrow_exports/pg_ts_template.feather index 65269714138586e45945f7e7cd9095464dbea93c..8b93d2cbe728013c4117d9ce3a11b5c086470fc3 100644 GIT binary patch delta 196 zcmdnQbBKr6F(}AC+>n9cKM;6Ka25sj2RQxYI95hGJpygC*DaB;9%fk;9y_}VlZIb?87*RnK5GWOBQ|dO_f78RRL&t K0V4wg#Nhx?i#UA% delta 180 zcmX@avx$e-F(}AC+>n9cKM*)fZ}WZj5!n6YO_oOGA2Gq;bCB4W8eU)Wdo|-9Ktw3l{$ceeijF?~_Xic}I@2W+iK?@o02%W`M{= z9dE0_jfjWH2A7g(2gE=aSfF4LWxygB0T#G6iS|Go3;_!i45CA@0wTZ%9t2SiY=SA^ z12rN#07(!Ac-;0`P^9>-5E2<~7o)QF;<{CyE{0SY344Set%ILLCufACystktQn%Md zM~yYvHCU}uP3D+;4J~UhRh~fdzPYZ=d83oJ3`Y)QHN^WjTE>xL@LFymrRzJKk|R&C z%5k3=koQP6o;I~~-d)$r>!$XMAPv9shtb`(u#{X*;dLni7w3FQt63xn;YZtLQ4Xkd zleyplDMmpI9I5?A7!TMPg5{{!>y`91%yV^YS6`u-Vw0{8t!>Hq)$ delta 950 zcmeH`%_~Gv7{=c-_nzUFnXVd*G<0R^(%6Wy63W6tDH|5EpnR5(@$m;>rOX2FW|GC& z$wGv(urOs|!9vYPCJT0w#iiL`IG#cAFDR#e=RD8Tdrr5WZuU^yKGZzzJw4sM4MYkn zw(4n|XmS(fB+)Tg0$m^g9G&O{L_r^@1vw2FSOH;B5ArUea}Wm+&<0F!BZzjvJm>;G zaLtKivsmKiWJnxvsc4nC7o{8?ONESkD2s@KyqU5+&Z|-|!ot?a31NGJ`JW_;#LrgR zG!`*em^tQ_wC#R?yL;swSEYA$Zfa&=WQeF7_k6tIvSkNU8z<7Xj6jVe^RweJI~;>#<4SuvGRF%^N&B}^ObvO=Z`%8%27}l{9?H{>EFT@sCC;!|0lWkV~ZnIGK32OcNQ9l6LcTsKt diff --git a/datafusion-postgres/src/pg_catalog/format_type.rs b/datafusion-postgres/src/pg_catalog/format_type.rs index b7b5a6f..6bf8e84 100644 --- a/datafusion-postgres/src/pg_catalog/format_type.rs +++ b/datafusion-postgres/src/pg_catalog/format_type.rs @@ -2,8 +2,8 @@ use std::sync::Arc; use datafusion::{ arrow::{ - array::{Array, StringBuilder}, - datatypes::DataType, + array::{Array, PrimitiveArray, StringBuilder}, + datatypes::{DataType, Int32Type}, }, common::{ cast::{as_int32_array, as_int64_array}, @@ -17,12 +17,32 @@ use datafusion::{ pub(crate) fn format_type_impl(args: &[ColumnarValue]) -> Result { let args = ColumnarValue::values_to_arrays(args)?; - let type_oids = as_int64_array(&args[0])?; + let type_oids = match &args[0].data_type() { + DataType::Int32 => as_int32_array(&args[0])?, + DataType::Int64 => { + let oid_i64 = as_int64_array(&args[0])?; + &PrimitiveArray::::from_iter(oid_i64.iter().map(|v| v.map(|x| x as i32))) + } + _ => { + return Err(DataFusionError::Internal(format!( + "Unexpected oid type in format_type: {}", + args[0].data_type() + ))) + } + }; - let typemods = if args.len() > 1 { - Some(as_int32_array(&args[1])?) - } else { - None + let typemods = match &args[1].data_type() { + DataType::Int32 => as_int32_array(&args[1])?, + DataType::Int64 => { + let oid_i64 = as_int64_array(&args[1])?; + &PrimitiveArray::::from_iter(oid_i64.iter().map(|v| v.map(|x| x as i32))) + } + _ => { + return Err(DataFusionError::Internal(format!( + "Unexpected oid type in format_type: {}", + args[1].data_type() + ))) + } }; let mut result = StringBuilder::new(); @@ -34,11 +54,13 @@ pub(crate) fn format_type_impl(args: &[ColumnarValue]) -> Result PgAttributeTable { /// Map DataFusion data types to PostgreSQL type information fn datafusion_to_pg_type(data_type: &DataType) -> (i32, i16, bool, &'static str, &'static str) { match data_type { - DataType::Boolean => (16, 1, true, "c", "p"), // bool - DataType::Int8 => (18, 1, true, "c", "p"), // char - DataType::Int16 => (21, 2, true, "s", "p"), // int2 - DataType::Int32 => (23, 4, true, "i", "p"), // int4 - DataType::Int64 => (20, 8, true, "d", "p"), // int8 - DataType::UInt8 => (21, 2, true, "s", "p"), // Treat as int2 - DataType::UInt16 => (23, 4, true, "i", "p"), // Treat as int4 - DataType::UInt32 => (20, 8, true, "d", "p"), // Treat as int8 - DataType::UInt64 => (1700, -1, false, "i", "m"), // Treat as numeric - DataType::Float32 => (700, 4, true, "i", "p"), // float4 - DataType::Float64 => (701, 8, true, "d", "p"), // float8 - DataType::Utf8 => (25, -1, false, "i", "x"), // text + DataType::Boolean => (16, 1, true, "c", "p"), // bool + DataType::Int8 => (18, 1, true, "c", "p"), // char + DataType::Int16 => (21, 2, true, "s", "p"), // int2 + DataType::Int32 => (23, 4, true, "i", "p"), // int4 + DataType::Int64 => (20, 8, true, "d", "p"), // int8 + DataType::UInt8 => (18, 2, true, "s", "p"), // char + DataType::UInt16 => (21, 4, true, "i", "p"), // int2 + DataType::UInt32 => (23, 8, true, "d", "p"), // int4 + DataType::UInt64 => (20, -1, false, "i", "m"), // int8 + DataType::Float32 => (700, 4, true, "i", "p"), // float4 + DataType::Float64 => (701, 8, true, "d", "p"), // float8 + DataType::Utf8 => (25, -1, false, "i", "x"), // text DataType::LargeUtf8 => (25, -1, false, "i", "x"), // text - DataType::Binary => (17, -1, false, "i", "x"), // bytea + DataType::Binary => (17, -1, false, "i", "x"), // bytea DataType::LargeBinary => (17, -1, false, "i", "x"), // bytea - DataType::Date32 => (1082, 4, true, "i", "p"), // date - DataType::Date64 => (1082, 4, true, "i", "p"), // date + DataType::Date32 => (1082, 4, true, "i", "p"), // date + DataType::Date64 => (1082, 4, true, "i", "p"), // date DataType::Time32(_) => (1083, 8, true, "d", "p"), // time DataType::Time64(_) => (1083, 8, true, "d", "p"), // time DataType::Timestamp(_, _) => (1114, 8, true, "d", "p"), // timestamp DataType::Decimal128(_, _) => (1700, -1, false, "i", "m"), // numeric DataType::Decimal256(_, _) => (1700, -1, false, "i", "m"), // numeric - _ => (25, -1, false, "i", "x"), // Default to text for unknown types + _ => (25, -1, false, "i", "x"), // Default to text for unknown types } } }