postgresql/src/include/catalog
Tom Lane 83a5641945 Provide more-specific error details/hints for function lookup failures.
Up to now we've contented ourselves with a one-size-fits-all error
hint when we fail to find any match to a function or procedure call.
That was mostly okay in the beginning, but it was never great, and
since the introduction of named arguments it's really not adequate.
We at least ought to distinguish "function name doesn't exist" from
"function name exists, but not with those argument names".  And the
rules for named-argument matching are arcane enough that some more
detail seems warranted if we match the argument names but the call
still doesn't work.

This patch creates a framework for dealing with these problems:
FuncnameGetCandidates and related code will now pass back a bitmask of
flags showing how far the match succeeded.  This allows a considerable
amount of granularity in the reports.  The set-bits-in-a-bitmask
approach means that when there are multiple candidate functions, the
report will reflect the match(es) that got the furthest, which seems
correct.  Also, we can avoid mentioning "maybe add casts" unless
failure to match argument types is actually the issue.

Extend the same return-a-bitmask approach to OpernameGetCandidates.
The issues around argument names don't apply to operator syntax,
but it still seems worth distinguishing between "there is no
operator of that name" and "we couldn't match the argument types".

While at it, adjust these messages and related ones to more strictly
separate "detail" from "hint", following our message style guidelines'
distinction between those.

Reported-by: Dominique Devienne <ddevienne@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/1756041.1754616558@sss.pgh.pa.us
2025-09-16 12:17:02 -04:00
..
.gitignore Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
binary_upgrade.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
catalog.h Assert lack of hazardous buffer locks before possible catalog read. 2025-04-17 05:00:30 -07:00
catversion.h Add date and timestamp variants of random(min, max). 2025-09-09 10:39:30 +01:00
dependency.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
duplicate_oids Update copyright for 2025 2025-01-01 11:21:55 -05:00
genbki.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
heap.h Remove now-dead code in StoreAttrDefault(). 2025-03-03 13:09:20 -05:00
index.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
indexing.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
Makefile Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
namespace.h Provide more-specific error details/hints for function lookup failures. 2025-09-16 12:17:02 -04:00
objectaccess.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
objectaddress.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
partition.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_aggregate.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_aggregate.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_am.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_am.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_amop.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_amop.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_amproc.dat Rename gist stratnum support function 2025-06-02 08:41:27 +02:00
pg_amproc.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_attrdef.h Remove now-dead code in StoreAttrDefault(). 2025-03-03 13:09:20 -05:00
pg_attribute.h Allow NOT NULL constraints to be added as NOT VALID 2025-04-07 19:19:50 +02:00
pg_auth_members.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_authid.dat Do pre-release housekeeping on catalog data. 2025-06-29 21:43:39 -04:00
pg_authid.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_cast.dat Add new OID alias type regdatabase. 2025-06-30 15:38:54 -05:00
pg_cast.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_class.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_class.h Place "extern" declaration in the right part of pg_class.h. 2025-03-21 15:14:15 -04:00
pg_collation.dat Do pre-release housekeeping on catalog data. 2025-06-29 21:43:39 -04:00
pg_collation.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_constraint.h Allow NOT NULL constraints to be added as NOT VALID 2025-04-07 19:19:50 +02:00
pg_control.h Add default_char_signedness field to ControlFileData. 2025-02-21 10:12:08 -08:00
pg_conversion.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_conversion.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_database.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_database.h Avoid including commands/dbcommands.h in so many places 2025-08-28 12:39:04 +02:00
pg_db_role_setting.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_default_acl.h Extend ALTER DEFAULT PRIVILEGES to define default privileges for large objects. 2025-04-04 19:02:17 +09:00
pg_depend.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_description.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_enum.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_event_trigger.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_extension.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_foreign_data_wrapper.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_foreign_server.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_foreign_table.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_index.h Do pre-release housekeeping on catalog data. 2025-06-29 21:43:39 -04:00
pg_inherits.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_init_privs.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_language.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_language.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_largeobject.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_largeobject_metadata.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_namespace.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_namespace.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_opclass.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_opclass.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_operator.dat Fix NO ACTION temporal foreign keys when the referenced endpoints change 2025-01-21 14:39:24 +01:00
pg_operator.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_opfamily.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_opfamily.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_parameter_acl.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_partitioned_table.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_policy.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_proc.dat Add date and timestamp variants of random(min, max). 2025-09-09 10:39:30 +01:00
pg_proc.h Fix erroneous construction of functions' dependencies on transforms. 2025-04-07 13:31:37 -04:00
pg_publication.h Fix typo in pg_publication.h. 2025-07-01 15:17:03 +05:30
pg_publication_namespace.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_publication_rel.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_range.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_range.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_replication_origin.h Remove pg_replication_origin's TOAST table. 2025-05-07 14:47:36 -05:00
pg_rewrite.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_seclabel.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_sequence.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_shdepend.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_shdescription.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_shseclabel.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_statistic.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_statistic_ext.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_statistic_ext_data.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_subscription.h Add max_retention_duration option to subscriptions. 2025-09-02 03:20:18 +00:00
pg_subscription_rel.h Add max_retention_duration option to subscriptions. 2025-09-02 03:20:18 +00:00
pg_tablespace.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_tablespace.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_transform.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_trigger.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_ts_config.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_config.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_ts_config_map.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_config_map.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_dict.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_dict.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_ts_parser.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_parser.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_ts_template.dat Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_ts_template.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_type.dat Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true. 2025-08-13 17:18:22 -04:00
pg_type.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
pg_user_mapping.h IWYU pragmas for catalog headers 2025-01-15 18:57:53 +01:00
README Add src/include/catalog/README 2025-08-19 08:41:42 +02:00
reformat_dat_file.pl Fix an assortment of spelling mistakes and typos 2025-01-02 12:42:01 +13:00
renumber_oids.pl Update copyright for 2025 2025-01-01 11:21:55 -05:00
storage.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
storage_xlog.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
toasting.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
unused_oids Update copyright for 2025 2025-01-01 11:21:55 -05:00

See <https://www.postgresql.org/docs/devel/bki.html> about the
files in this directory.