postgresql/src/include/catalog
Tom Lane f8ace5477e Fix type-safety problem with parallel aggregate serial/deserialization.
The original specification for this called for the deserialization function
to have signature "deserialize(serialtype) returns transtype", which is a
security violation if transtype is INTERNAL (which it always would be in
practice) and serialtype is not (which ditto).  The patch blithely overrode
the opr_sanity check for that, which was sloppy-enough work in itself,
but the indisputable reason this cannot be allowed to stand is that CREATE
FUNCTION will reject such a signature and thus it'd be impossible for
extensions to create parallelizable aggregates.

The minimum fix to make the signature type-safe is to add a second, dummy
argument of type INTERNAL.  But to lock it down a bit more and make misuse
of INTERNAL-accepting functions less likely, let's get rid of the ability
to specify a "serialtype" for an aggregate and just say that the only
useful serialtype is BYTEA --- which, in practice, is the only interesting
value anyway, due to the usefulness of the send/recv infrastructure for
this purpose.  That means we only have to allow "serialize(internal)
returns bytea" and "deserialize(bytea, internal) returns internal" as
the signatures for these support functions.

In passing fix bogus signature of int4_avg_combine, which I found thanks
to adding an opr_sanity check on combinefunc signatures.

catversion bump due to removing pg_aggregate.aggserialtype and adjusting
signatures of assorted built-in functions.

David Rowley and Tom Lane

Discussion: <27247.1466185504@sss.pgh.pa.us>
2016-06-22 16:52:41 -04:00
..
.gitignore
binary_upgrade.h Fix pg_upgrade to not fail when new-cluster TOAST rules differ from old. 2016-05-06 22:05:56 -04:00
catalog.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
catversion.h Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
dependency.h Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
duplicate_oids pgindent run for 9.4 2014-05-06 12:12:18 -04:00
genbki.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
heap.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
index.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
indexing.h Add new catalog called pg_init_privs 2016-04-06 21:45:32 -04:00
namespace.h Improve the situation for parallel query versus temp relations. 2016-06-09 20:16:11 -04:00
objectaccess.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
objectaddress.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
opfam_internal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_aggregate.h Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
pg_am.h Support CREATE ACCESS METHOD 2016-03-23 23:01:35 -03:00
pg_amop.h Introduce SP-GiST operator class over box. 2016-03-30 18:42:36 +03:00
pg_amproc.h Introduce SP-GiST operator class over box. 2016-03-30 18:42:36 +03:00
pg_attrdef.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_attribute.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_auth_members.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_authid.h Create default roles 2016-04-08 16:56:27 -04:00
pg_cast.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_class.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_collation_fn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_collation.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_constraint_fn.h Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
pg_constraint.h Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
pg_control.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_conversion_fn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_conversion.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_database.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_db_role_setting.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_default_acl.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_depend.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_description.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_enum.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_event_trigger.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_extension.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_foreign_data_wrapper.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_foreign_server.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_foreign_table.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_index.h Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
pg_inherits_fn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_inherits.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_init_privs.h Add new catalog called pg_init_privs 2016-04-06 21:45:32 -04:00
pg_language.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_largeobject_metadata.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_largeobject.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_namespace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_opclass.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_operator_fn.h Fix DROP OPERATOR to reset oprcom/oprnegate links to the dropped operator. 2016-03-25 12:33:16 -04:00
pg_operator.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_opfamily.h Introduce SP-GiST operator class over box. 2016-03-30 18:42:36 +03:00
pg_pltemplate.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_policy.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_proc_fn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_proc.h Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
pg_range.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_replication_origin.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_rewrite.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_seclabel.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_shdepend.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_shdescription.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_shseclabel.h Make pg_shseclabel available in early backend startup 2016-01-05 14:50:53 -03:00
pg_statistic.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_tablespace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_transform.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_trigger.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_ts_config_map.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_ts_config.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_ts_dict.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_ts_parser.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_ts_template.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_type_fn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_type.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_user_mapping.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage_xlog.h pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
storage.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
toasting.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
unused_oids