-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/5941~1
head repository: postgresql-cfbot/postgresql
compare: cf/5941
- 20 commits
- 62 files changed
- 2 contributors
Commits on Nov 4, 2025
-
error safe for casting bytea to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype ='bytea'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------+----------+-------------+------------+------------+--------- bytea | smallint | 6370 | e | f | bytea_int2 | int2 bytea | integer | 6371 | e | f | bytea_int4 | int4 bytea | bigint | 6372 | e | f | bytea_int8 | int8 (3 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 0ea64a6 - Browse repository at this point
Copy the full SHA 0ea64a6View commit details -
error safe for casting bit/varbit to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc where pc.castfunc > 0 and (castsource::regtype ='bit'::regtype or castsource::regtype ='varbit'::regtype) order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname -------------+-------------+----------+-------------+------------+-----------+--------- bit | bigint | 2076 | e | f | bittoint8 | int8 bit | integer | 1684 | e | f | bittoint4 | int4 bit | bit | 1685 | i | f | bit | bit bit varying | bit varying | 1687 | i | f | varbit | varbit (4 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for 3f9c882 - Browse repository at this point
Copy the full SHA 3f9c882View commit details -
error safe for casting character to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype ='character'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+-------------------+----------+-------------+------------+-------------+--------- character | text | 401 | i | f | rtrim1 | text character | character varying | 401 | i | f | rtrim1 | text character | "char" | 944 | a | f | text_char | char character | name | 409 | i | f | bpchar_name | name character | xml | 2896 | e | f | texttoxml | xml character | character | 668 | i | f | bpchar | bpchar (6 rows) only texttoxml, bpchar(PG_FUNCTION_ARGS) need take care of error handling. other functions already error safe. discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 1b3f571 - Browse repository at this point
Copy the full SHA 1b3f571View commit details -
error safe for casting text to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'text'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------+----------+-------------+------------+---------------+---------- text | regclass | 1079 | i | f | text_regclass | regclass text | "char" | 944 | a | f | text_char | char text | name | 407 | i | f | text_name | name text | xml | 2896 | e | f | texttoxml | xml (4 rows) already error safe: text_name, text_char. texttoxml is refactored in character type error safe patch. discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 3b874ec - Browse repository at this point
Copy the full SHA 3b874ecView commit details -
error safe for casting character varying to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and (castsource::regtype = 'character varying'::regtype) order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname -------------------+-------------------+----------+-------------+------------+---------------+---------- character varying | regclass | 1079 | i | f | text_regclass | regclass character varying | "char" | 944 | a | f | text_char | char character varying | name | 1400 | i | f | text_name | name character varying | xml | 2896 | e | f | texttoxml | xml character varying | character varying | 669 | i | f | varchar | varchar (5 rows) texttoxml, text_regclass was refactored as error safe in prior patch. text_char, text_name is already error safe. so here we only need handle function "varchar". discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for 45b3848 - Browse repository at this point
Copy the full SHA 45b3848View commit details -
error safe for casting inet to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'inet'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+-------------------+----------+-------------+------------+--------------+--------- inet | cidr | 1715 | a | f | inet_to_cidr | cidr inet | text | 730 | a | f | network_show | text inet | character varying | 730 | a | f | network_show | text inet | character | 730 | a | f | network_show | text (4 rows) inet_to_cidr is already error safe. discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 7f48253 - Browse repository at this point
Copy the full SHA 7f48253View commit details -
error safe for casting macaddr8 to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype ='macaddr8'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------+----------+-------------+------------+-------------------+--------- macaddr8 | macaddr | 4124 | i | f | macaddr8tomacaddr | macaddr (1 row) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for e74312f - Browse repository at this point
Copy the full SHA e74312fView commit details -
error safe for casting integer to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'integer'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------+----------+-------------+------------+--------------+--------- integer | bigint | 481 | i | f | int48 | int8 integer | smallint | 314 | a | f | i4toi2 | int2 integer | real | 318 | i | f | i4tof | float4 integer | double precision | 316 | i | f | i4tod | float8 integer | numeric | 1740 | i | f | int4_numeric | numeric integer | money | 3811 | a | f | int4_cash | money integer | boolean | 2557 | e | f | int4_bool | bool integer | bytea | 6368 | e | f | int4_bytea | bytea integer | "char" | 78 | e | f | i4tochar | char integer | bit | 1683 | e | f | bitfromint4 | bit (10 rows) only int4_cash, i4toi2, i4tochar need take care of error handling. but support for cash data type is not easy, so only i4toi2, i4tochar function refactoring. discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for d843b0f - Browse repository at this point
Copy the full SHA d843b0fView commit details -
error safe for casting bigint to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'bigint'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------+----------+-------------+------------+--------------+--------- bigint | smallint | 714 | a | f | int82 | int2 bigint | integer | 480 | a | f | int84 | int4 bigint | real | 652 | i | f | i8tof | float4 bigint | double precision | 482 | i | f | i8tod | float8 bigint | numeric | 1781 | i | f | int8_numeric | numeric bigint | money | 3812 | a | f | int8_cash | money bigint | oid | 1287 | i | f | i8tooid | oid bigint | regproc | 1287 | i | f | i8tooid | oid bigint | regprocedure | 1287 | i | f | i8tooid | oid bigint | regoper | 1287 | i | f | i8tooid | oid bigint | regoperator | 1287 | i | f | i8tooid | oid bigint | regclass | 1287 | i | f | i8tooid | oid bigint | regcollation | 1287 | i | f | i8tooid | oid bigint | regtype | 1287 | i | f | i8tooid | oid bigint | regconfig | 1287 | i | f | i8tooid | oid bigint | regdictionary | 1287 | i | f | i8tooid | oid bigint | regrole | 1287 | i | f | i8tooid | oid bigint | regnamespace | 1287 | i | f | i8tooid | oid bigint | regdatabase | 1287 | i | f | i8tooid | oid bigint | bytea | 6369 | e | f | int8_bytea | bytea bigint | bit | 2075 | e | f | bitfromint8 | bit (21 rows) already error safe: i8tof, i8tod, int8_numeric, int8_bytea, bitfromint8 discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for fcb6db8 - Browse repository at this point
Copy the full SHA fcb6db8View commit details -
error safe for casting numeric to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'numeric'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------+----------+-------------+------------+----------------+--------- numeric | bigint | 1779 | a | f | numeric_int8 | int8 numeric | smallint | 1783 | a | f | numeric_int2 | int2 numeric | integer | 1744 | a | f | numeric_int4 | int4 numeric | real | 1745 | i | f | numeric_float4 | float4 numeric | double precision | 1746 | i | f | numeric_float8 | float8 numeric | money | 3824 | a | f | numeric_cash | money numeric | numeric | 1703 | i | f | numeric | numeric (7 rows) discussion: https://postgr.es/m/CACJufxHCMzrHOW=wRe8L30rMhB3sjwAv1LE928Fa7sxMu1Tx-g@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for b18df55 - Browse repository at this point
Copy the full SHA b18df55View commit details -
error safe for casting float4 to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'float4'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------+----------+-------------+------------+----------------+--------- real | bigint | 653 | a | f | ftoi8 | int8 real | smallint | 238 | a | f | ftoi2 | int2 real | integer | 319 | a | f | ftoi4 | int4 real | double precision | 311 | i | f | ftod | float8 real | numeric | 1742 | a | f | float4_numeric | numeric (5 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for b9bed07 - Browse repository at this point
Copy the full SHA b9bed07View commit details -
error safe for casting float8 to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'float8'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------------+------------+----------+-------------+------------+----------------+--------- double precision | bigint | 483 | a | f | dtoi8 | int8 double precision | smallint | 237 | a | f | dtoi2 | int2 double precision | integer | 317 | a | f | dtoi4 | int4 double precision | real | 312 | a | f | dtof | float4 double precision | numeric | 1743 | a | f | float8_numeric | numeric (5 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for 26c4f25 - Browse repository at this point
Copy the full SHA 26c4f25View commit details -
error safe for casting date to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'date'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+-----------------------------+----------+-------------+------------+------------------+------------- date | timestamp without time zone | 2024 | i | f | date_timestamp | timestamp date | timestamp with time zone | 1174 | i | f | date_timestamptz | timestamptz (2 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 4ee6e78 - Browse repository at this point
Copy the full SHA 4ee6e78View commit details -
error safe for casting interval to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'interval'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------------+----------+-------------+------------+----------------+---------- interval | time without time zone | 1419 | a | f | interval_time | time interval | interval | 1200 | i | f | interval_scale | interval (2 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 1a9d380 - Browse repository at this point
Copy the full SHA 1a9d380View commit details -
error safe for casting timestamptz to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and (castsource::regtype ='timestamptz'::regtype) order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname --------------------------+-----------------------------+----------+-------------+------------+-----------------------+------------- timestamp with time zone | date | 1178 | a | f | timestamptz_date | date timestamp with time zone | time without time zone | 2019 | a | f | timestamptz_time | time timestamp with time zone | timestamp without time zone | 2027 | a | f | timestamptz_timestamp | timestamp timestamp with time zone | time with time zone | 1388 | a | f | timestamptz_timetz | timetz timestamp with time zone | timestamp with time zone | 1967 | i | f | timestamptz_scale | timestamptz (5 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for 7469370 - Browse repository at this point
Copy the full SHA 7469370View commit details -
error safe for casting timestamp to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and (castsource::regtype ='timestamp'::regtype) order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname -----------------------------+-----------------------------+----------+-------------+------------+-----------------------+------------- timestamp without time zone | date | 2029 | a | f | timestamp_date | date timestamp without time zone | time without time zone | 1316 | a | f | timestamp_time | time timestamp without time zone | timestamp with time zone | 2028 | i | f | timestamp_timestamptz | timestamptz timestamp without time zone | timestamp without time zone | 1961 | i | f | timestamp_scale | timestamp (4 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for e08d082 - Browse repository at this point
Copy the full SHA e08d082View commit details -
error safe for casting jsonb to other types per pg_cast
select castsource::regtype, casttarget::regtype, castfunc, castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc and pc.castfunc > 0 and castsource::regtype = 'jsonb'::regtype order by castsource::regtype; castsource | casttarget | castfunc | castcontext | castmethod | prosrc | proname ------------+------------------+----------+-------------+------------+---------------+--------- jsonb | boolean | 3556 | e | f | jsonb_bool | bool jsonb | numeric | 3449 | e | f | jsonb_numeric | numeric jsonb | smallint | 3450 | e | f | jsonb_int2 | int2 jsonb | integer | 3451 | e | f | jsonb_int4 | int4 jsonb | bigint | 3452 | e | f | jsonb_int8 | int8 jsonb | real | 3453 | e | f | jsonb_float4 | float4 jsonb | double precision | 2580 | e | f | jsonb_float8 | float8 (7 rows) discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for fcc1050 - Browse repository at this point
Copy the full SHA fcc1050View commit details -
error safe for casting geometry data type
select castsource::regtype, casttarget::regtype, pp.prosrc from pg_cast pc join pg_proc pp on pp.oid = pc.castfunc join pg_type pt on pt.oid = castsource join pg_type pt1 on pt1.oid = casttarget and pc.castfunc > 0 and pt.typarray <> 0 and pt.typnamespace = 'pg_catalog'::regnamespace and pt1.typnamespace = 'pg_catalog'::regnamespace and (pt.typcategory = 'G' or pt1.typcategory = 'G') order by castsource::regtype, casttarget::regtype; castsource | casttarget | prosrc ------------+------------+--------------- point | box | point_box lseg | point | lseg_center path | polygon | path_poly box | point | box_center box | lseg | box_diagonal box | polygon | box_poly box | circle | box_circle polygon | point | poly_center polygon | path | poly_path polygon | box | poly_box polygon | circle | poly_circle circle | point | circle_center circle | box | circle_box circle | polygon | (14 rows) already error safe: point_box, box_diagonal, box_poly, poly_path, poly_box, circle_center almost error safe: path_poly can not error safe: cast circle to polygon, because it's a SQL function discussion: https://postgr.es/m/CACJufxHCMzrHOW=wRe8L30rMhB3sjwAv1LE928Fa7sxMu1Tx-g@mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 02d0507 - Browse repository at this point
Copy the full SHA 02d0507View commit details -
CAST(expr AS newtype DEFAULT ON ERROR)
Now that the type coercion node is error-safe, we also need to ensure that when a coercion fails, it falls back to evaluating the default node. draft doc also added. We cannot simply prohibit user-defined functions in pg_cast for safe cast evaluation because CREATE CAST can also utilize built-in functions. So, to completely disallow custom casts created via CREATE CAST used in safe cast evaluation, a new field in pg_cast would unfortunately be necessary. demo: SELECT CAST('1' AS date DEFAULT '2011-01-01' ON ERROR), CAST('{234,def,567}'::text[] AS integer[] DEFAULT '{-1011}' ON ERROR); date | int4 ------------+--------- 2011-01-01 | {-1011} [0]: https://git.postgresql.org/cgit/postgresql.git/commit/?id=aaaf9449ec6be62cb0d30ed3588dc384f56274b discussion: https://postgr.es/m/CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.comConfiguration menu - View commit details
-
Copy full SHA for 609935a - Browse repository at this point
Copy the full SHA 609935aView commit details -
[CF 5941] v9 - CAST(... ON DEFAULT) - WIP build on top of Error-Safe …
…User Functions This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5941 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CACJufxHM2e3DQmbRdDZvWyG3ZCLyOg6XFifvOz_TGy1tGw7NHw@mail.gmail.com Author(s): Jian He
Commitfest Bot committedNov 4, 2025 Configuration menu - View commit details
-
Copy full SHA for 1f97d38 - Browse repository at this point
Copy the full SHA 1f97d38View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/5941~1...cf/5941