diff --git a/pkg/cmd/roachtest/testdata/regression.diffs b/pkg/cmd/roachtest/testdata/regression.diffs index c707497e75b2..31eb972dcefe 100644 --- a/pkg/cmd/roachtest/testdata/regression.diffs +++ b/pkg/cmd/roachtest/testdata/regression.diffs @@ -2506,7 +2506,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/int8.out --label= - 1259 + oid +------------ -+ 4294967087 ++ 4294967084 (1 row) -- bit operations @@ -39148,23 +39148,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/horology.out --la SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08"; 23:29:00-08 ------------- -@@ -1034,14 +661,14 @@ - + interval '02:01' AS time with time zone) AS time) AS "07:31:00"; - 07:31:00 - ---------- -- 07:31:00 -+ 08:31:00 - (1 row) - - SELECT CAST(cast(date 'today' + time with time zone '03:30' - + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00"; - 07:31:00 - ---------- -- 07:31:00 -+ 08:31:00 - (1 row) - - SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract" @@ -1049,347 +676,67 @@ WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01' AND i.f1 BETWEEN '00:00' AND '23:00' @@ -40890,13 +40873,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/horology.out --la - 1997-02-10 17:32:00 - 1997-02-10 17:32:01 - 1997-02-10 17:32:01 +- 1997-02-10 17:32:01 - 1997-02-10 17:32:01 1997-02-10 17:32:01 1997-02-10 17:32:01 1997-02-10 17:32:01 1997-02-10 17:32:01 - 1997-02-10 17:32:01 -- 1997-02-10 17:32:01 - 1997-06-10 18:32:01 - 1997-02-10 17:32:01 - 1997-02-11 17:32:01 @@ -42018,7 +42001,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Look for "toastable" types that aren't varlena. SELECT t1.oid, t1.typname -@@ -67,15 +81,366 @@ +@@ -67,15 +81,369 @@ WHERE t2.typname = ('_' || t1.typname)::name AND t2.typelem = t1.oid and t1.typarray = t2.oid) ORDER BY t1.oid; @@ -42064,229 +42047,232 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - + 100200 | interval_tbl + 100215 | timestamp_tbl + 100216 | timestamptz_tbl -+ 4294966966 | spatial_ref_sys -+ 4294966967 | geometry_columns -+ 4294966968 | geography_columns -+ 4294966970 | pg_views -+ 4294966971 | pg_user -+ 4294966972 | pg_user_mappings -+ 4294966973 | pg_user_mapping -+ 4294966974 | pg_type -+ 4294966975 | pg_ts_template -+ 4294966976 | pg_ts_parser -+ 4294966977 | pg_ts_dict -+ 4294966978 | pg_ts_config -+ 4294966979 | pg_ts_config_map -+ 4294966980 | pg_trigger -+ 4294966981 | pg_transform -+ 4294966982 | pg_timezone_names -+ 4294966983 | pg_timezone_abbrevs -+ 4294966984 | pg_tablespace -+ 4294966985 | pg_tables -+ 4294966986 | pg_subscription -+ 4294966987 | pg_subscription_rel -+ 4294966988 | pg_stats -+ 4294966989 | pg_stats_ext -+ 4294966990 | pg_statistic -+ 4294966991 | pg_statistic_ext -+ 4294966992 | pg_statistic_ext_data -+ 4294966993 | pg_statio_user_tables -+ 4294966994 | pg_statio_user_sequences -+ 4294966995 | pg_statio_user_indexes -+ 4294966996 | pg_statio_sys_tables -+ 4294966997 | pg_statio_sys_sequences -+ 4294966998 | pg_statio_sys_indexes -+ 4294966999 | pg_statio_all_tables -+ 4294967000 | pg_statio_all_sequences -+ 4294967001 | pg_statio_all_indexes -+ 4294967002 | pg_stat_xact_user_tables -+ 4294967003 | pg_stat_xact_user_functions -+ 4294967004 | pg_stat_xact_sys_tables -+ 4294967005 | pg_stat_xact_all_tables -+ 4294967006 | pg_stat_wal_receiver -+ 4294967007 | pg_stat_user_tables -+ 4294967008 | pg_stat_user_indexes -+ 4294967009 | pg_stat_user_functions -+ 4294967010 | pg_stat_sys_tables -+ 4294967011 | pg_stat_sys_indexes -+ 4294967012 | pg_stat_subscription -+ 4294967013 | pg_stat_ssl -+ 4294967014 | pg_stat_slru -+ 4294967015 | pg_stat_replication -+ 4294967016 | pg_stat_progress_vacuum -+ 4294967017 | pg_stat_progress_create_index -+ 4294967018 | pg_stat_progress_cluster -+ 4294967019 | pg_stat_progress_basebackup -+ 4294967020 | pg_stat_progress_analyze -+ 4294967021 | pg_stat_gssapi -+ 4294967022 | pg_stat_database -+ 4294967023 | pg_stat_database_conflicts -+ 4294967024 | pg_stat_bgwriter -+ 4294967025 | pg_stat_archiver -+ 4294967026 | pg_stat_all_tables -+ 4294967027 | pg_stat_all_indexes -+ 4294967028 | pg_stat_activity -+ 4294967029 | pg_shmem_allocations -+ 4294967030 | pg_shdepend -+ 4294967031 | pg_shseclabel -+ 4294967032 | pg_shdescription -+ 4294967033 | pg_shadow -+ 4294967034 | pg_settings -+ 4294967035 | pg_sequences -+ 4294967036 | pg_sequence -+ 4294967037 | pg_seclabel -+ 4294967038 | pg_seclabels -+ 4294967039 | pg_rules -+ 4294967040 | pg_roles -+ 4294967041 | pg_rewrite -+ 4294967042 | pg_replication_slots -+ 4294967043 | pg_replication_origin -+ 4294967044 | pg_replication_origin_status -+ 4294967045 | pg_range -+ 4294967046 | pg_publication_tables -+ 4294967047 | pg_publication -+ 4294967048 | pg_publication_rel -+ 4294967049 | pg_proc -+ 4294967050 | pg_prepared_xacts -+ 4294967051 | pg_prepared_statements -+ 4294967052 | pg_policy -+ 4294967053 | pg_policies -+ 4294967054 | pg_partitioned_table -+ 4294967055 | pg_opfamily -+ 4294967056 | pg_operator -+ 4294967057 | pg_opclass -+ 4294967058 | pg_namespace -+ 4294967059 | pg_matviews -+ 4294967060 | pg_locks -+ 4294967061 | pg_largeobject -+ 4294967062 | pg_largeobject_metadata -+ 4294967063 | pg_language -+ 4294967064 | pg_init_privs -+ 4294967065 | pg_inherits -+ 4294967066 | pg_indexes -+ 4294967067 | pg_index -+ 4294967068 | pg_hba_file_rules -+ 4294967069 | pg_group -+ 4294967070 | pg_foreign_table -+ 4294967071 | pg_foreign_server -+ 4294967072 | pg_foreign_data_wrapper -+ 4294967073 | pg_file_settings -+ 4294967074 | pg_extension -+ 4294967075 | pg_event_trigger -+ 4294967076 | pg_enum -+ 4294967077 | pg_description -+ 4294967078 | pg_depend -+ 4294967079 | pg_default_acl -+ 4294967080 | pg_db_role_setting -+ 4294967081 | pg_database -+ 4294967082 | pg_cursors -+ 4294967083 | pg_conversion -+ 4294967084 | pg_constraint -+ 4294967085 | pg_config -+ 4294967086 | pg_collation -+ 4294967087 | pg_class -+ 4294967088 | pg_cast -+ 4294967089 | pg_available_extensions -+ 4294967090 | pg_available_extension_versions -+ 4294967091 | pg_auth_members -+ 4294967092 | pg_authid -+ 4294967093 | pg_attribute -+ 4294967094 | pg_attrdef -+ 4294967095 | pg_amproc -+ 4294967096 | pg_amop -+ 4294967097 | pg_am -+ 4294967098 | pg_aggregate -+ 4294967100 | views -+ 4294967101 | view_table_usage -+ 4294967102 | view_routine_usage -+ 4294967103 | view_column_usage -+ 4294967104 | user_privileges -+ 4294967105 | user_mappings -+ 4294967106 | user_mapping_options -+ 4294967107 | user_defined_types -+ 4294967108 | user_attributes -+ 4294967109 | usage_privileges -+ 4294967110 | udt_privileges -+ 4294967111 | type_privileges -+ 4294967112 | triggers -+ 4294967113 | triggered_update_columns -+ 4294967114 | transforms -+ 4294967115 | tablespaces -+ 4294967116 | tablespaces_extensions -+ 4294967117 | tables -+ 4294967118 | tables_extensions -+ 4294967119 | table_privileges -+ 4294967120 | table_constraints_extensions -+ 4294967121 | table_constraints -+ 4294967122 | statistics -+ 4294967123 | st_units_of_measure -+ 4294967124 | st_spatial_reference_systems -+ 4294967125 | st_geometry_columns -+ 4294967126 | session_variables -+ 4294967127 | sequences -+ 4294967128 | schema_privileges -+ 4294967129 | schemata -+ 4294967130 | schemata_extensions -+ 4294967131 | sql_sizing -+ 4294967132 | sql_parts -+ 4294967133 | sql_implementation_info -+ 4294967134 | sql_features -+ 4294967135 | routines -+ 4294967136 | routine_privileges -+ 4294967137 | role_usage_grants -+ 4294967138 | role_udt_grants -+ 4294967139 | role_table_grants -+ 4294967140 | role_routine_grants -+ 4294967141 | role_column_grants -+ 4294967142 | resource_groups -+ 4294967143 | referential_constraints -+ 4294967144 | profiling -+ 4294967145 | processlist -+ 4294967146 | plugins -+ 4294967147 | partitions -+ 4294967148 | parameters -+ 4294967149 | optimizer_trace -+ 4294967150 | keywords -+ 4294967151 | key_column_usage -+ 4294967152 | information_schema_catalog_name -+ 4294967153 | foreign_tables -+ 4294967154 | foreign_table_options -+ 4294967155 | foreign_servers -+ 4294967156 | foreign_server_options -+ 4294967157 | foreign_data_wrappers -+ 4294967158 | foreign_data_wrapper_options -+ 4294967159 | files -+ 4294967160 | events -+ 4294967161 | engines -+ 4294967162 | enabled_roles -+ 4294967163 | element_types -+ 4294967164 | domains -+ 4294967165 | domain_udt_usage -+ 4294967166 | domain_constraints -+ 4294967167 | data_type_privileges -+ 4294967168 | constraint_table_usage -+ 4294967169 | constraint_column_usage -+ 4294967170 | columns -+ 4294967171 | columns_extensions -+ 4294967172 | column_udt_usage -+ 4294967173 | column_statistics -+ 4294967174 | column_privileges -+ 4294967175 | column_options -+ 4294967176 | column_domain_usage -+ 4294967177 | column_column_usage -+ 4294967178 | collations -+ 4294967179 | collation_character_set_applicability -+ 4294967180 | check_constraints -+ 4294967181 | check_constraint_routine_usage -+ 4294967182 | character_sets -+ 4294967183 | attributes -+ 4294967184 | applicable_roles -+ 4294967185 | administrable_role_authorizations -+ 4294967187 | fully_qualified_names -+ 4294967188 | logical_replication_node_processors -+ 4294967189 | cluster_replication_node_stream_checkpoints -+ 4294967190 | cluster_replication_node_stream_spans -+ 4294967191 | cluster_replication_node_streams ++ 4294966963 | spatial_ref_sys ++ 4294966964 | geometry_columns ++ 4294966965 | geography_columns ++ 4294966967 | pg_views ++ 4294966968 | pg_user ++ 4294966969 | pg_user_mappings ++ 4294966970 | pg_user_mapping ++ 4294966971 | pg_type ++ 4294966972 | pg_ts_template ++ 4294966973 | pg_ts_parser ++ 4294966974 | pg_ts_dict ++ 4294966975 | pg_ts_config ++ 4294966976 | pg_ts_config_map ++ 4294966977 | pg_trigger ++ 4294966978 | pg_transform ++ 4294966979 | pg_timezone_names ++ 4294966980 | pg_timezone_abbrevs ++ 4294966981 | pg_tablespace ++ 4294966982 | pg_tables ++ 4294966983 | pg_subscription ++ 4294966984 | pg_subscription_rel ++ 4294966985 | pg_stats ++ 4294966986 | pg_stats_ext ++ 4294966987 | pg_statistic ++ 4294966988 | pg_statistic_ext ++ 4294966989 | pg_statistic_ext_data ++ 4294966990 | pg_statio_user_tables ++ 4294966991 | pg_statio_user_sequences ++ 4294966992 | pg_statio_user_indexes ++ 4294966993 | pg_statio_sys_tables ++ 4294966994 | pg_statio_sys_sequences ++ 4294966995 | pg_statio_sys_indexes ++ 4294966996 | pg_statio_all_tables ++ 4294966997 | pg_statio_all_sequences ++ 4294966998 | pg_statio_all_indexes ++ 4294966999 | pg_stat_xact_user_tables ++ 4294967000 | pg_stat_xact_user_functions ++ 4294967001 | pg_stat_xact_sys_tables ++ 4294967002 | pg_stat_xact_all_tables ++ 4294967003 | pg_stat_wal_receiver ++ 4294967004 | pg_stat_user_tables ++ 4294967005 | pg_stat_user_indexes ++ 4294967006 | pg_stat_user_functions ++ 4294967007 | pg_stat_sys_tables ++ 4294967008 | pg_stat_sys_indexes ++ 4294967009 | pg_stat_subscription ++ 4294967010 | pg_stat_ssl ++ 4294967011 | pg_stat_slru ++ 4294967012 | pg_stat_replication ++ 4294967013 | pg_stat_progress_vacuum ++ 4294967014 | pg_stat_progress_create_index ++ 4294967015 | pg_stat_progress_cluster ++ 4294967016 | pg_stat_progress_basebackup ++ 4294967017 | pg_stat_progress_analyze ++ 4294967018 | pg_stat_gssapi ++ 4294967019 | pg_stat_database ++ 4294967020 | pg_stat_database_conflicts ++ 4294967021 | pg_stat_bgwriter ++ 4294967022 | pg_stat_archiver ++ 4294967023 | pg_stat_all_tables ++ 4294967024 | pg_stat_all_indexes ++ 4294967025 | pg_stat_activity ++ 4294967026 | pg_shmem_allocations ++ 4294967027 | pg_shdepend ++ 4294967028 | pg_shseclabel ++ 4294967029 | pg_shdescription ++ 4294967030 | pg_shadow ++ 4294967031 | pg_settings ++ 4294967032 | pg_sequences ++ 4294967033 | pg_sequence ++ 4294967034 | pg_seclabel ++ 4294967035 | pg_seclabels ++ 4294967036 | pg_rules ++ 4294967037 | pg_roles ++ 4294967038 | pg_rewrite ++ 4294967039 | pg_replication_slots ++ 4294967040 | pg_replication_origin ++ 4294967041 | pg_replication_origin_status ++ 4294967042 | pg_range ++ 4294967043 | pg_publication_tables ++ 4294967044 | pg_publication ++ 4294967045 | pg_publication_rel ++ 4294967046 | pg_proc ++ 4294967047 | pg_prepared_xacts ++ 4294967048 | pg_prepared_statements ++ 4294967049 | pg_policy ++ 4294967050 | pg_policies ++ 4294967051 | pg_partitioned_table ++ 4294967052 | pg_opfamily ++ 4294967053 | pg_operator ++ 4294967054 | pg_opclass ++ 4294967055 | pg_namespace ++ 4294967056 | pg_matviews ++ 4294967057 | pg_locks ++ 4294967058 | pg_largeobject ++ 4294967059 | pg_largeobject_metadata ++ 4294967060 | pg_language ++ 4294967061 | pg_init_privs ++ 4294967062 | pg_inherits ++ 4294967063 | pg_indexes ++ 4294967064 | pg_index ++ 4294967065 | pg_hba_file_rules ++ 4294967066 | pg_group ++ 4294967067 | pg_foreign_table ++ 4294967068 | pg_foreign_server ++ 4294967069 | pg_foreign_data_wrapper ++ 4294967070 | pg_file_settings ++ 4294967071 | pg_extension ++ 4294967072 | pg_event_trigger ++ 4294967073 | pg_enum ++ 4294967074 | pg_description ++ 4294967075 | pg_depend ++ 4294967076 | pg_default_acl ++ 4294967077 | pg_db_role_setting ++ 4294967078 | pg_database ++ 4294967079 | pg_cursors ++ 4294967080 | pg_conversion ++ 4294967081 | pg_constraint ++ 4294967082 | pg_config ++ 4294967083 | pg_collation ++ 4294967084 | pg_class ++ 4294967085 | pg_cast ++ 4294967086 | pg_available_extensions ++ 4294967087 | pg_available_extension_versions ++ 4294967088 | pg_auth_members ++ 4294967089 | pg_authid ++ 4294967090 | pg_attribute ++ 4294967091 | pg_attrdef ++ 4294967092 | pg_amproc ++ 4294967093 | pg_amop ++ 4294967094 | pg_am ++ 4294967095 | pg_aggregate ++ 4294967097 | views ++ 4294967098 | view_table_usage ++ 4294967099 | view_routine_usage ++ 4294967100 | view_column_usage ++ 4294967101 | user_privileges ++ 4294967102 | user_mappings ++ 4294967103 | user_mapping_options ++ 4294967104 | user_defined_types ++ 4294967105 | user_attributes ++ 4294967106 | usage_privileges ++ 4294967107 | udt_privileges ++ 4294967108 | type_privileges ++ 4294967109 | triggers ++ 4294967110 | triggered_update_columns ++ 4294967111 | transforms ++ 4294967112 | tablespaces ++ 4294967113 | tablespaces_extensions ++ 4294967114 | tables ++ 4294967115 | tables_extensions ++ 4294967116 | table_privileges ++ 4294967117 | table_constraints_extensions ++ 4294967118 | table_constraints ++ 4294967119 | statistics ++ 4294967120 | st_units_of_measure ++ 4294967121 | st_spatial_reference_systems ++ 4294967122 | st_geometry_columns ++ 4294967123 | session_variables ++ 4294967124 | sequences ++ 4294967125 | schema_privileges ++ 4294967126 | schemata ++ 4294967127 | schemata_extensions ++ 4294967128 | sql_sizing ++ 4294967129 | sql_parts ++ 4294967130 | sql_implementation_info ++ 4294967131 | sql_features ++ 4294967132 | routines ++ 4294967133 | routine_privileges ++ 4294967134 | role_usage_grants ++ 4294967135 | role_udt_grants ++ 4294967136 | role_table_grants ++ 4294967137 | role_routine_grants ++ 4294967138 | role_column_grants ++ 4294967139 | resource_groups ++ 4294967140 | referential_constraints ++ 4294967141 | profiling ++ 4294967142 | processlist ++ 4294967143 | plugins ++ 4294967144 | partitions ++ 4294967145 | parameters ++ 4294967146 | optimizer_trace ++ 4294967147 | keywords ++ 4294967148 | key_column_usage ++ 4294967149 | information_schema_catalog_name ++ 4294967150 | foreign_tables ++ 4294967151 | foreign_table_options ++ 4294967152 | foreign_servers ++ 4294967153 | foreign_server_options ++ 4294967154 | foreign_data_wrappers ++ 4294967155 | foreign_data_wrapper_options ++ 4294967156 | files ++ 4294967157 | events ++ 4294967158 | engines ++ 4294967159 | enabled_roles ++ 4294967160 | element_types ++ 4294967161 | domains ++ 4294967162 | domain_udt_usage ++ 4294967163 | domain_constraints ++ 4294967164 | data_type_privileges ++ 4294967165 | constraint_table_usage ++ 4294967166 | constraint_column_usage ++ 4294967167 | columns ++ 4294967168 | columns_extensions ++ 4294967169 | column_udt_usage ++ 4294967170 | column_statistics ++ 4294967171 | column_privileges ++ 4294967172 | column_options ++ 4294967173 | column_domain_usage ++ 4294967174 | column_column_usage ++ 4294967175 | collations ++ 4294967176 | collation_character_set_applicability ++ 4294967177 | check_constraints ++ 4294967178 | check_constraint_routine_usage ++ 4294967179 | character_sets ++ 4294967180 | attributes ++ 4294967181 | applicable_roles ++ 4294967182 | administrable_role_authorizations ++ 4294967184 | store_liveness_support_for ++ 4294967185 | store_liveness_support_from ++ 4294967186 | fully_qualified_names ++ 4294967187 | logical_replication_node_processors ++ 4294967188 | cluster_replication_node_stream_checkpoints ++ 4294967189 | cluster_replication_node_stream_spans ++ 4294967190 | cluster_replication_node_streams ++ 4294967191 | logical_replication_spans + 4294967192 | cluster_replication_spans + 4294967193 | kv_session_based_leases + 4294967194 | kv_protected_ts_records @@ -42390,11 +42376,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - + 4294967292 | builtin_functions + 4294967293 | node_build_info + 4294967294 | backward_dependencies -+(357 rows) ++(360 rows) -- Make sure typarray points to a "true" array type of our own base SELECT t1.oid, t1.typname as basetype, t2.typname as arraytype, -@@ -84,10 +449,7 @@ +@@ -84,10 +452,7 @@ WHERE t1.typarray <> 0 AND (t2.oid IS NULL OR t2.typsubscript <> 'array_subscript_handler'::regproc); @@ -42406,7 +42392,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Look for range types that do not have a pg_range entry SELECT t1.oid, t1.typname FROM pg_type as t1 -@@ -128,10 +490,7 @@ +@@ -128,10 +493,7 @@ (p1.pronargs = 3 AND p1.proargtypes[0] = 'cstring'::regtype AND p1.proargtypes[1] = 'oid'::regtype AND p1.proargtypes[2] = 'int4'::regtype)); @@ -42418,7 +42404,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- As of 8.0, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT t1.oid, t1.typname, p1.oid, p1.proname -@@ -140,10 +499,9 @@ +@@ -140,10 +502,9 @@ (t1.typelem != 0 AND t1.typlen < 0) AND NOT (p1.prorettype = t1.oid AND NOT p1.proretset) ORDER BY 1; @@ -42432,7 +42418,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Varlena array types will point to array_in -- Exception as of 8.1: int2vector and oidvector have their own I/O routines -@@ -153,10 +511,10 @@ +@@ -153,10 +514,10 @@ (t1.typelem != 0 AND t1.typlen < 0) AND NOT (p1.oid = 'array_in'::regproc) ORDER BY 1; @@ -42447,7 +42433,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - (2 rows) -- typinput routines should not be volatile -@@ -172,14 +530,11 @@ +@@ -172,14 +533,11 @@ FROM pg_type AS t1 WHERE t1.typtype not in ('b', 'p') ORDER BY 1; @@ -42465,7 +42451,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Check for bogus typoutput routines -- As of 8.0, this check finds refcursor, which is borrowing -@@ -192,19 +547,15 @@ +@@ -192,19 +550,15 @@ (p1.oid = 'array_out'::regproc AND t1.typelem != 0 AND t1.typlen = -1))) ORDER BY 1; @@ -42489,7 +42475,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- typoutput routines should not be volatile SELECT t1.oid, t1.typname, p1.oid, p1.proname FROM pg_type AS t1, pg_proc AS p1 -@@ -218,13 +569,11 @@ +@@ -218,13 +572,11 @@ FROM pg_type AS t1 WHERE t1.typtype not in ('b', 'd', 'p') ORDER BY 1; @@ -42506,7 +42492,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Domains should have same typoutput as their base types SELECT t1.oid, t1.typname, t2.oid, t2.typname -@@ -244,10 +593,7 @@ +@@ -244,10 +596,7 @@ (p1.pronargs = 3 AND p1.proargtypes[0] = 'internal'::regtype AND p1.proargtypes[1] = 'oid'::regtype AND p1.proargtypes[2] = 'int4'::regtype)); @@ -42518,7 +42504,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- As of 7.4, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT t1.oid, t1.typname, p1.oid, p1.proname -@@ -256,10 +602,9 @@ +@@ -256,10 +605,9 @@ (t1.typelem != 0 AND t1.typlen < 0) AND NOT (p1.prorettype = t1.oid AND NOT p1.proretset) ORDER BY 1; @@ -42532,7 +42518,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Varlena array types will point to array_recv -- Exception as of 8.1: int2vector and oidvector have their own I/O routines -@@ -271,8 +616,8 @@ +@@ -271,8 +619,8 @@ ORDER BY 1; oid | typname | oid | proname -----+------------+------+---------------- @@ -42543,7 +42529,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - (2 rows) -- Suspicious if typreceive doesn't take same number of args as typinput -@@ -297,14 +642,11 @@ +@@ -297,14 +645,11 @@ FROM pg_type AS t1 WHERE t1.typtype not in ('b', 'p') ORDER BY 1; @@ -42561,7 +42547,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Check for bogus typsend routines -- As of 7.4, this check finds refcursor, which is borrowing -@@ -317,10 +659,9 @@ +@@ -317,10 +662,9 @@ (p1.oid = 'array_send'::regproc AND t1.typelem != 0 AND t1.typlen = -1))) ORDER BY 1; @@ -42575,7 +42561,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - SELECT t1.oid, t1.typname, p1.oid, p1.proname FROM pg_type AS t1, pg_proc AS p1 -@@ -343,13 +684,11 @@ +@@ -343,13 +687,11 @@ FROM pg_type AS t1 WHERE t1.typtype not in ('b', 'd', 'p') ORDER BY 1; @@ -42592,7 +42578,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Domains should have same typsend as their base types SELECT t1.oid, t1.typname, t2.oid, t2.typname -@@ -366,10 +705,7 @@ +@@ -366,10 +708,7 @@ (p1.pronargs = 1 AND p1.proargtypes[0] = 'cstring[]'::regtype AND p1.prorettype = 'int4'::regtype AND NOT p1.proretset); @@ -42604,7 +42590,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- typmodin routines should not be volatile SELECT t1.oid, t1.typname, p1.oid, p1.proname FROM pg_type AS t1, pg_proc AS p1 -@@ -385,10 +721,7 @@ +@@ -385,10 +724,7 @@ (p1.pronargs = 1 AND p1.proargtypes[0] = 'int4'::regtype AND p1.prorettype = 'cstring'::regtype AND NOT p1.proretset); @@ -42616,7 +42602,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- typmodout routines should not be volatile SELECT t1.oid, t1.typname, p1.oid, p1.proname FROM pg_type AS t1, pg_proc AS p1 -@@ -409,7 +742,8 @@ +@@ -409,7 +745,8 @@ -- Array types should have same typdelim as their element types SELECT t1.oid, t1.typname, t2.oid, t2.typname FROM pg_type AS t1, pg_type AS t2 @@ -42626,7 +42612,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - oid | typname | oid | typname -----+---------+-----+--------- (0 rows) -@@ -428,29 +762,20 @@ +@@ -428,29 +765,20 @@ SELECT t1.oid, t1.typname, t1.typelem FROM pg_type AS t1 WHERE t1.typelem != 0 AND t1.typsubscript = 0; @@ -42659,7 +42645,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Check for bogus typanalyze routines SELECT t1.oid, t1.typname, p1.oid, p1.proname FROM pg_type AS t1, pg_proc AS p1 -@@ -458,10 +783,7 @@ +@@ -458,10 +786,7 @@ (p1.pronargs = 1 AND p1.proargtypes[0] = 'internal'::regtype AND p1.prorettype = 'bool'::regtype AND NOT p1.proretset); @@ -42671,7 +42657,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- there does not seem to be a reason to care about volatility of typanalyze -- domains inherit their base type's typanalyze SELECT d.oid, d.typname, d.typanalyze, t.oid, t.typname, t.typanalyze -@@ -477,10 +799,7 @@ +@@ -477,10 +802,7 @@ FROM pg_type t LEFT JOIN pg_range r on t.oid = r.rngtypid WHERE t.typbasetype = 0 AND (t.typanalyze = 'range_typanalyze'::regproc) != (r.rngtypid IS NOT NULL); @@ -42683,7 +42669,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- array_typanalyze should be used for all and only array types -- (but exclude domains, which we checked above) -- As of 9.2 this finds int2vector and oidvector, which are weird anyway -@@ -490,12 +809,7 @@ +@@ -490,12 +812,7 @@ (t.typanalyze = 'array_typanalyze'::regproc) != (t.typsubscript = 'array_subscript_handler'::regproc) ORDER BY 1; @@ -42697,7 +42683,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- **************** pg_class **************** -- Look for illegal values in pg_class fields SELECT c1.oid, c1.relname -@@ -535,14 +849,10 @@ +@@ -535,14 +852,10 @@ (0 rows) -- Tables, matviews etc should have AMs of type 't' @@ -42716,7 +42702,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- **************** pg_attribute **************** -- Look for illegal values in pg_attribute fields SELECT a1.attrelid, a1.attname -@@ -555,22 +865,48 @@ +@@ -555,22 +868,48 @@ (0 rows) -- Cross-check attnum against parent relation @@ -42763,19 +42749,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - + 1460608405 | table_spans_descriptor_id_idx + 115531396 | tables_parent_id_idx + 115531397 | tables_database_name_idx -+ 3176850730 | pg_attrdef_adrelid_idx -+ 2917114457 | pg_attribute_attrelid_idx -+ 2397641923 | pg_class_oid_idx -+ 3742718928 | pg_constraint_conrelid_idx -+ 4169400142 | pg_namespace_oid_idx -+ 1785378053 | pg_proc_oid_idx -+ 3833625957 | pg_timezone_names_name_idx -+ 1384570493 | pg_type_oid_idx ++ 1312301183 | pg_attrdef_adrelid_idx ++ 4262191470 | pg_attribute_attrelid_idx ++ 3742718928 | pg_class_oid_idx ++ 1878169381 | pg_constraint_conrelid_idx ++ 2304850595 | pg_namespace_oid_idx ++ 3130455066 | pg_proc_oid_idx ++ 1403208208 | pg_timezone_names_name_idx ++ 3249120040 | pg_type_oid_idx +(30 rows) -- Cross-check against pg_type entry -- NOTE: we allow attstorage to be 'plain' even when typstorage is not; -@@ -613,10 +949,7 @@ +@@ -613,10 +952,7 @@ EXISTS(select 1 from pg_catalog.pg_type where oid = r.rngsubtype and typelem != 0 and typsubscript = 'array_subscript_handler'::regproc))); @@ -42787,7 +42773,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- canonical function, if any, had better match the range type SELECT r.rngtypid, r.rngsubtype, p.proname FROM pg_range r JOIN pg_proc p ON p.oid = r.rngcanonical -@@ -639,10 +972,7 @@ +@@ -639,10 +975,7 @@ SELECT r.rngtypid, r.rngsubtype, r.rngmultitypid FROM pg_range r WHERE r.rngmultitypid IS NULL OR r.rngmultitypid = 0; @@ -42799,7 +42785,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Create a table that holds all the known in-core data types and leave it -- around so as pg_upgrade is able to test their binary compatibility. CREATE TABLE tab_core_types AS SELECT -@@ -709,6 +1039,13 @@ +@@ -709,6 +1042,13 @@ '{(2020-01-02 03:04:05, 2021-02-03 06:07:08)}'::tsmultirange, '(2020-01-02 03:04:05, 2021-02-03 06:07:08)'::tstzrange, '{(2020-01-02 03:04:05, 2021-02-03 06:07:08)}'::tstzmultirange; @@ -42813,7 +42799,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out - -- Sanity check on the previous table, checking that all core types are -- included in this table. SELECT oid, typname, typtype, typelem, typarray -@@ -736,7 +1073,4 @@ +@@ -736,7 +1076,4 @@ WHERE a.atttypid=t.oid AND a.attnum > 0 AND a.attrelid='tab_core_types'::regclass); @@ -44557,18 +44543,20 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copydml.out --lab -- triggers create function qqq_trig() returns trigger as $$ begin -@@ -94,19 +441,19 @@ +@@ -94,19 +441,21 @@ $$ language plpgsql; create trigger qqqbef before insert or update or delete on copydml_test for each row execute procedure qqq_trig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger qqqaf after insert or update or delete on copydml_test for each row execute procedure qqq_trig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ copy (insert into copydml_test (t) values ('f') returning id) to stdout; -NOTICE: BEFORE INSERT 8 -8 @@ -44799,13 +44787,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= -- create before insert row trigger on parted_copytest_a2 create function part_ins_func() returns trigger language plpgsql as $$ begin -@@ -94,33 +214,52 @@ - before insert on parted_copytest_a2 +@@ -95,32 +215,45 @@ for each row execute procedure part_ins_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ copy parted_copytest from :'filename'; +ERROR: at or near ":abs_builddir/results/parted_copytest.csv": syntax error: unimplemented: this syntax +DETAIL: source SQL: @@ -44836,9 +44820,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= create index on parted_copytest (b); +ERROR: relation "parted_copytest" does not exist drop trigger part_ins_trig on parted_copytest_a2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ copy parted_copytest from stdin; +ERROR: relation "parted_copytest" does not exist +1 1 str1 @@ -44868,7 +44849,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= -- -- Progress reporting for COPY -- -@@ -131,6 +270,15 @@ +@@ -131,6 +264,15 @@ salary int4, manager name ); @@ -44884,7 +44865,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= -- Add a trigger to catch and print the contents of the catalog view -- pg_stat_progress_copy during data insertion. This allows to test -- the validation of some progress reports for COPY FROM where the trigger -@@ -160,22 +308,56 @@ +@@ -160,22 +302,52 @@ return new; end; $$ language plpgsql; @@ -44895,9 +44876,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= after insert on tab_progress_reporting for each statement execute function notice_after_tab_progress_reporting(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "tab_progress_reporting" does not exist -- Generate COPY FROM report with PIPE. copy tab_progress_reporting from stdin; -INFO: progress: {"type": "PIPE", "command": "COPY FROM", "relname": "tab_progress_reporting", "has_bytes_total": false, "tuples_excluded": 0, "tuples_processed": 3, "has_bytes_processed": true} @@ -44933,9 +44912,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= +We appreciate your feedback. + drop trigger check_after_tab_progress_reporting on tab_progress_reporting; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "tab_progress_reporting" does not exist drop function notice_after_tab_progress_reporting(); +ERROR: unknown function: notice_after_tab_progress_reporting() drop table tab_progress_reporting; @@ -44943,7 +44920,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/copy.out --label= -- Test header matching feature create table header_copytest ( a int, -@@ -186,57 +368,173 @@ +@@ -186,57 +358,173 @@ alter table header_copytest drop column c; alter table header_copytest add column c text; copy header_copytest to stdout with (header match); @@ -46273,17 +46250,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert_conflict.o -- test with statement level triggers create or replace function parted_conflict_update_func() returns trigger as $$ declare -@@ -852,15 +943,40 @@ +@@ -852,15 +943,38 @@ return new; end; $$ language plpgsql; -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + r record; +begin + for r in select * from inserted loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -46300,9 +46277,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert_conflict.o referencing new table as inserted for each statement execute procedure parted_conflict_update_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_conflict" does not exist truncate parted_conflict; +ERROR: relation "parted_conflict" does not exist insert into parted_conflict values (0, 'cero', 1); @@ -46575,10 +46550,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. -+ + +If you would rather not post publicly, please contact us directly +using the support form. - ++ +We appreciate your feedback. + +\d+ inserttest2 @@ -47246,24 +47221,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe -- have a BR trigger modify the row such that the check_b is violated create function mlparted11_trig_fn() returns trigger AS -@@ -538,445 +768,714 @@ - end; - $$ +@@ -540,443 +770,678 @@ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.b := 4 -+^ -+-- -+source SQL: -+begin -+ NEW.b := 4; -+ ^ create trigger mlparted11_trig before insert ON mlparted11 for each row execute procedure mlparted11_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "mlparted11" does not exist -- check that the correct row is shown when constraint check_b fails after -- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due -- to the BR trigger mlparted11_trig_fn) @@ -47272,11 +47234,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe -DETAIL: Failing row contains (1, 4). +ERROR: relation "mlparted" does not exist drop trigger mlparted11_trig on mlparted11; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "mlparted11" does not exist drop function mlparted11_trig_fn(); -+ERROR: unknown function: mlparted11_trig_fn() -- check that inserting into an internal partition successfully results in -- checking its partition constraint before inserting into the leaf partition -- selected by tuple-routing @@ -47378,18 +47337,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe -DETAIL: Failing row contains (1, 45, a). +ERROR: relation "mlparted" does not exist create function mlparted5abrtrig_func() returns trigger as $$ begin new.c = 'b'; return new; end; $$ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.c = 'b' -+^ -+-- -+source SQL: -+begin new.c = 'b'; return new; end; -+ ^ create trigger mlparted5abrtrig before insert on mlparted5a for each row execute procedure mlparted5abrtrig_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ insert into mlparted5 (a, b, c) values (1, 40, 'a'); -ERROR: new row for relation "mlparted5a" violates partition constraint -DETAIL: Failing row contains (b, 1, 40). @@ -47770,18 +47718,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe + ^ +HINT: try \h CREATE TABLE create or replace function brtrigpartcon1trigf() returns trigger as $$begin new.a := 2; return new; end$$ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.a := 2 -+^ -+-- -+source SQL: -+begin new.a := 2; return new; end -+ ^ create trigger brtrigpartcon1trig before insert on brtrigpartcon1 for each row execute procedure brtrigpartcon1trigf(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "brtrigpartcon1" does not exist insert into brtrigpartcon values (1, 'hi there'); -ERROR: new row for relation "brtrigpartcon1" violates partition constraint -DETAIL: Failing row contains (2, hi there). @@ -47815,7 +47753,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe drop table brtrigpartcon; +ERROR: relation "brtrigpartcon" does not exist drop function brtrigpartcon1trigf(); -+ERROR: unknown function: brtrigpartcon1trigf() -- check that "do nothing" BR triggers work with tuple-routing create table donothingbrtrig_test (a int, b text) partition by list (a); +ERROR: at or near "EOF": syntax error @@ -47828,13 +47765,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/insert.out --labe alter table donothingbrtrig_test2 drop column c; create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql; create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1); +ERROR: at or near "attach": syntax error +DETAIL: source SQL: @@ -52958,7 +52897,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_table.out -- user-defined operator class in partition key CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 1 ELSE -1 END; $$; -@@ -958,117 +1699,269 @@ +@@ -958,117 +1699,267 @@ OPERATOR 1 < (int4,int4), OPERATOR 2 <= (int4,int4), OPERATOR 3 = (int4,int4), OPERATOR 4 >= (int4,int4), OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4); @@ -53189,9 +53128,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_table.out + create trigger trig_part_create before insert on tab_part_create for each statement execute procedure func_part_create(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "tab_part_create" does not exist insert into tab_part_create values (1); -ERROR: cannot CREATE TABLE .. PARTITION OF "tab_part_create" because it is being used by active queries in this session -CONTEXT: SQL statement "create table tab_part_create_1 partition of tab_part_create for values in (1)" @@ -53269,7 +53206,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_table.out -- tests of column drop with partition tables and indexes using -- predicates and expressions. create table part_column_drop ( -@@ -1079,42 +1972,58 @@ +@@ -1079,42 +1970,58 @@ b int, useless_3 int ) partition by range (id); @@ -54564,12 +54501,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_view.out - -ERROR: cannot drop constraint view_base_table_pkey on table view_base_table because other objects depend on it -DETAIL: view key_dependent_view depends on constraint view_base_table_pkey on table view_base_table -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "view_base_table" (319): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "view_base_table" (322): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ CREATE VIEW key_dependent_view_no_cols AS SELECT FROM view_base_table GROUP BY key HAVING length(data) > 0; -+ERROR: relation "key_dependent_view_no_cols" (321): table must contain at least 1 column ++ERROR: relation "key_dependent_view_no_cols" (324): table must contain at least 1 column -- -- CREATE OR REPLACE VIEW -- @@ -66442,7 +66379,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/drop_if_exists.ou --- --- role/user/group --- -@@ -68,249 +91,1054 @@ +@@ -68,106 +91,354 @@ CREATE ROLE regress_test_r1; CREATE GROUP regress_test_g1; DROP USER regress_test_u2; @@ -66830,44 +66767,25 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/drop_if_exists.ou -- trigger DROP TRIGGER test_trigger_exists ON test_exists; -ERROR: trigger "test_trigger_exists" for table "test_exists" does not exist -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "test_trigger_exists" of relation "test_exists" does not exist DROP TRIGGER IF EXISTS test_trigger_exists ON test_exists; --NOTICE: trigger "test_trigger_exists" for relation "test_exists" does not exist, skipping -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ + NOTICE: trigger "test_trigger_exists" for relation "test_exists" does not exist, skipping DROP TRIGGER test_trigger_exists ON no_such_table; --ERROR: relation "no_such_table" does not exist -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -175,142 +446,681 @@ DROP TRIGGER IF EXISTS test_trigger_exists ON no_such_table; --NOTICE: relation "no_such_table" does not exist, skipping -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ + NOTICE: relation "no_such_table" does not exist, skipping DROP TRIGGER test_trigger_exists ON no_such_schema.no_such_table; -ERROR: schema "no_such_schema" does not exist -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "no_such_schema.no_such_table" does not exist DROP TRIGGER IF EXISTS test_trigger_exists ON no_such_schema.no_such_table; -NOTICE: schema "no_such_schema" does not exist, skipping -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++NOTICE: relation "no_such_schema.no_such_table" does not exist, skipping CREATE TRIGGER test_trigger_exists BEFORE UPDATE ON test_exists FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: suppress_redundant_updates_trigger() DROP TRIGGER test_trigger_exists ON test_exists; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "test_trigger_exists" of relation "test_exists" does not exist -- rule DROP RULE test_rule_exists ON test_exists; -ERROR: rule "test_rule_exists" for relation "test_exists" does not exist @@ -67574,9 +67492,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/drop_if_exists.ou +See: https://go.crdb.dev/issue-v/7821/_version_ DROP TRIGGER IF EXISTS foo ON no_such_schema.bar; -NOTICE: schema "no_such_schema" does not exist, skipping -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++NOTICE: relation "no_such_schema.bar" does not exist, skipping DROP TYPE IF EXISTS no_such_schema.foo; -NOTICE: schema "no_such_schema" does not exist, skipping DROP VIEW IF EXISTS no_such_schema.foo; @@ -67594,7 +67510,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/drop_if_exists.ou -- cleanup DROP FUNCTION test_ambiguous_funcname(int); DROP FUNCTION test_ambiguous_funcname(text); -@@ -319,24 +1147,37 @@ +@@ -319,24 +1129,37 @@ CREATE PROCEDURE test_ambiguous_procname(text) as $$ begin end; $$ language plpgsql; DROP PROCEDURE test_ambiguous_procname; ERROR: procedure name "test_ambiguous_procname" is not unique @@ -69577,6 +69493,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_function_s LANGUAGE SQL IMMUTABLE AS $$ SELECT array_append($1, $2) || array_append($1, $2) $$; +ERROR: ambiguous call: array_append(anyelement[], anyelement), candidates are: ++array_append(bool[], bool) -> bool[] +array_append(box2d[], box2d) -> box2d[] +array_append(int[], int) -> int[] +array_append(float[], float) -> float[] @@ -69600,7 +69517,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_function_s +array_append(varbit[], varbit) -> varbit[] +array_append(anyenum[], anyenum) -> anyenum[] +array_append(tuple[], tuple) -> tuple[] -+array_append(bool[], bool) -> bool[] + SELECT double_append(array_append(ARRAY[q1], q2), q3) FROM (VALUES(1,2,3), (4,5,6)) v(q1,q2,q3); @@ -72391,17 +72307,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- view on top of view with triggers CREATE TABLE base_tbl (a int PRIMARY KEY, b text DEFAULT 'Unspecified'); INSERT INTO base_tbl SELECT i, 'Row ' || i FROM generate_series(-2, 2) g(i); -@@ -793,6 +795,9 @@ +@@ -793,6 +795,10 @@ LANGUAGE plpgsql; CREATE TRIGGER rw_view1_ins_trig INSTEAD OF INSERT ON rw_view1 FOR EACH ROW EXECUTE PROCEDURE rw_view1_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ SELECT table_name, is_insertable_into FROM information_schema.tables WHERE table_name LIKE 'rw_view%' -@@ -811,7 +816,7 @@ +@@ -811,7 +817,7 @@ ORDER BY table_name; table_name | is_updatable | is_insertable_into | is_trigger_updatable | is_trigger_deletable | is_trigger_insertable_into ------------+--------------+--------------------+----------------------+----------------------+---------------------------- @@ -72410,17 +72327,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o rw_view2 | NO | NO | NO | NO | NO (2 rows) -@@ -829,6 +834,9 @@ +@@ -829,6 +835,10 @@ CREATE TRIGGER rw_view1_upd_trig INSTEAD OF UPDATE ON rw_view1 FOR EACH ROW EXECUTE PROCEDURE rw_view1_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ SELECT table_name, is_insertable_into FROM information_schema.tables WHERE table_name LIKE 'rw_view%' -@@ -847,7 +855,7 @@ +@@ -847,7 +857,7 @@ ORDER BY table_name; table_name | is_updatable | is_insertable_into | is_trigger_updatable | is_trigger_deletable | is_trigger_insertable_into ------------+--------------+--------------------+----------------------+----------------------+---------------------------- @@ -72429,17 +72347,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o rw_view2 | NO | NO | NO | NO | NO (2 rows) -@@ -865,6 +873,9 @@ +@@ -865,6 +875,10 @@ CREATE TRIGGER rw_view1_del_trig INSTEAD OF DELETE ON rw_view1 FOR EACH ROW EXECUTE PROCEDURE rw_view1_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ SELECT table_name, is_insertable_into FROM information_schema.tables WHERE table_name LIKE 'rw_view%' -@@ -883,7 +894,7 @@ +@@ -883,7 +897,7 @@ ORDER BY table_name; table_name | is_updatable | is_insertable_into | is_trigger_updatable | is_trigger_deletable | is_trigger_insertable_into ------------+--------------+--------------------+----------------------+----------------------+---------------------------- @@ -72448,7 +72367,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o rw_view2 | NO | NO | NO | NO | NO (2 rows) -@@ -900,31 +911,18 @@ +@@ -900,31 +914,18 @@ (4 rows) INSERT INTO rw_view2 VALUES (3, 'Row 3') RETURNING *; @@ -72486,7 +72405,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; a | b ---+------- -@@ -933,33 +931,18 @@ +@@ -933,33 +934,18 @@ (2 rows) EXPLAIN (costs off) UPDATE rw_view2 SET a=3 WHERE a=2; @@ -72530,11 +72449,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o DROP FUNCTION rw_view1_trig_fn(); -- update using whole row from view CREATE TABLE base_tbl (a int PRIMARY KEY, b text DEFAULT 'Unspecified'); -@@ -967,165 +950,266 @@ +@@ -967,165 +953,269 @@ CREATE VIEW rw_view1 AS SELECT b AS bb, a AS aa FROM base_tbl; CREATE FUNCTION rw_view1_aa(x rw_view1) RETURNS int AS $$ SELECT x.aa $$ LANGUAGE sql; +ERROR: no data source matches prefix: x in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ UPDATE rw_view1 v SET bb='Updated row 2' WHERE rw_view1_aa(v)=2 RETURNING rw_view1_aa(v), v.bb; - rw_view1_aa | bb @@ -72849,7 +72771,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view1; a | b | c ---+-------+--- -@@ -1133,19 +1217,49 @@ +@@ -1133,19 +1223,49 @@ (1 row) SELECT * FROM rw_view1 FOR UPDATE; -- not allowed @@ -72904,7 +72826,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; a | b | c ---+-------+--- -@@ -1153,12 +1267,27 @@ +@@ -1153,12 +1273,27 @@ (1 row) SELECT * FROM rw_view2 FOR UPDATE; -- not allowed @@ -72934,7 +72856,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view1; a | b | c ---+-------+--- -@@ -1172,167 +1301,341 @@ +@@ -1172,167 +1307,341 @@ (1 row) UPDATE rw_view1 SET b = 'foo' WHERE a = 1; @@ -73332,7 +73254,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view1; -- ok bb | cc | aa -------+----+---- -@@ -1340,35 +1643,103 @@ +@@ -1340,35 +1649,103 @@ (1 row) UPDATE rw_view1 SET aa=aa, bb=bb; -- ok @@ -73445,7 +73367,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; -- ok ccc | aaa | bbb -----+-----+------- -@@ -1376,23 +1747,50 @@ +@@ -1376,23 +1753,50 @@ (1 row) UPDATE rw_view2 SET aaa=aaa; -- not allowed @@ -73502,7 +73424,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; -- ok ccc | aaa | bbb -----+-----+------- -@@ -1400,18 +1798,40 @@ +@@ -1400,18 +1804,40 @@ (1 row) UPDATE rw_view2 SET aaa=aaa; -- not allowed @@ -73547,7 +73469,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; -- ok ccc | aaa | bbb -----+-----+------- -@@ -1419,11 +1839,18 @@ +@@ -1419,11 +1845,18 @@ (1 row) UPDATE rw_view2 SET aaa=aaa; -- not allowed @@ -73568,7 +73490,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; -- ok ccc | aaa | bbb -----+-----+------- -@@ -1431,22 +1858,44 @@ +@@ -1431,22 +1864,44 @@ (1 row) UPDATE rw_view2 SET aaa=aaa; -- not allowed @@ -73619,7 +73541,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2; -- ok ccc | aaa | bbb -----+-----+------- -@@ -1454,39 +1903,47 @@ +@@ -1454,39 +1909,47 @@ (1 row) UPDATE rw_view2 SET aaa=aaa; -- not allowed @@ -73682,13 +73604,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- Table having triggers CREATE TABLE base_tbl (a int PRIMARY KEY, b text DEFAULT 'Unspecified'); INSERT INTO base_tbl VALUES (1, 'Row 1'); -@@ -1505,18 +1962,24 @@ +@@ -1505,18 +1968,23 @@ LANGUAGE plpgsql; CREATE TRIGGER rw_view1_ins_trig AFTER INSERT ON base_tbl FOR EACH ROW EXECUTE PROCEDURE rw_view1_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE VIEW rw_view1 AS SELECT a AS aa, b AS bb FROM base_tbl; INSERT INTO rw_view1 VALUES (3, 'Row 3'); +ERROR: "rw_view1" is not a table @@ -73704,13 +73627,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o DROP VIEW rw_view1; DROP TRIGGER rw_view1_ins_trig on base_tbl; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "rw_view1_ins_trig" of relation "base_tbl" does not exist DROP FUNCTION rw_view1_trig_fn(); DROP TABLE base_tbl; -- view with ORDER BY -@@ -1526,148 +1989,112 @@ +@@ -1526,148 +1994,112 @@ SELECT * FROM rw_view1; a | b ---+---- @@ -73905,7 +73826,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT table_name, is_insertable_into FROM information_schema.tables -@@ -1675,10 +2102,7 @@ +@@ -1675,10 +2107,7 @@ ORDER BY table_name; table_name | is_insertable_into ------------+-------------------- @@ -73917,7 +73838,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT table_name, is_updatable, is_insertable_into FROM information_schema.views -@@ -1686,10 +2110,7 @@ +@@ -1686,10 +2115,7 @@ ORDER BY table_name; table_name | is_updatable | is_insertable_into ------------+--------------+-------------------- @@ -73929,7 +73850,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT table_name, column_name, is_updatable FROM information_schema.columns -@@ -1697,75 +2118,56 @@ +@@ -1697,75 +2123,56 @@ ORDER BY table_name, ordinal_position; table_name | column_name | is_updatable ------------+-------------+-------------- @@ -74025,7 +73946,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o CREATE VIEW rw_view1 AS SELECT * FROM base_tbl_parent; CREATE VIEW rw_view2 AS SELECT * FROM ONLY base_tbl_parent; SELECT * FROM rw_view1 ORDER BY a; -@@ -1779,15 +2181,7 @@ +@@ -1779,15 +2186,7 @@ -3 -2 -1 @@ -74042,7 +73963,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM ONLY rw_view1 ORDER BY a; a -@@ -1800,15 +2194,7 @@ +@@ -1800,15 +2199,7 @@ -3 -2 -1 @@ -74059,7 +73980,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM rw_view2 ORDER BY a; a -@@ -1824,316 +2210,315 @@ +@@ -1824,316 +2215,315 @@ (8 rows) INSERT INTO rw_view1 VALUES (-100), (100); @@ -74567,7 +74488,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- WITH CHECK OPTION with subquery CREATE TABLE base_tbl (a int); CREATE TABLE ref_tbl (a int PRIMARY KEY); -@@ -2142,40 +2527,34 @@ +@@ -2142,40 +2532,34 @@ SELECT * FROM base_tbl b WHERE EXISTS(SELECT 1 FROM ref_tbl r WHERE r.a = b.a) WITH CHECK OPTION; @@ -74629,24 +74550,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- WITH CHECK OPTION with BEFORE trigger on base table CREATE TABLE base_tbl (a int, b int); CREATE FUNCTION base_tbl_trig_fn() -@@ -2187,22 +2566,38 @@ - END; - $$ - LANGUAGE plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.b := 10 -+^ -+-- -+source SQL: -+BEGIN -+ NEW.b := 10; -+ ^ +@@ -2190,19 +2574,22 @@ CREATE TRIGGER base_tbl_trig BEFORE INSERT OR UPDATE ON base_tbl FOR EACH ROW EXECUTE PROCEDURE base_tbl_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ CREATE VIEW rw_view1 AS SELECT * FROM base_tbl WHERE a < b WITH CHECK OPTION; +ERROR: at or near "with": syntax error +DETAIL: source SQL: @@ -74665,7 +74571,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o DROP TABLE base_tbl CASCADE; -NOTICE: drop cascades to view rw_view1 DROP FUNCTION base_tbl_trig_fn(); -+ERROR: unknown function: base_tbl_trig_fn() -- WITH LOCAL CHECK OPTION with INSTEAD OF trigger on base view CREATE TABLE base_tbl (a int, b int); CREATE VIEW rw_view1 AS SELECT a FROM base_tbl WHERE a < b; @@ -74673,13 +74578,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o CREATE FUNCTION rw_view1_trig_fn() RETURNS trigger AS $$ -@@ -2223,75 +2618,133 @@ +@@ -2223,75 +2610,132 @@ CREATE TRIGGER rw_view1_trig INSTEAD OF INSERT OR UPDATE OR DELETE ON rw_view1 FOR EACH ROW EXECUTE PROCEDURE rw_view1_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE VIEW rw_view2 AS SELECT * FROM rw_view1 WHERE a > 0 WITH LOCAL CHECK OPTION; +ERROR: at or near "with": syntax error @@ -74733,9 +74639,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- Neither local nor cascaded check options work with INSTEAD rules DROP TRIGGER rw_view1_trig ON rw_view1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: "rw_view1" is not a table CREATE RULE rw_view1_ins_rule AS ON INSERT TO rw_view1 DO INSTEAD INSERT INTO base_tbl VALUES (NEW.a, 10); +ERROR: at or near "rw_view1_ins_rule": syntax error: unimplemented: this syntax @@ -74838,7 +74742,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- security barrier view CREATE TABLE base_tbl (person text, visibility text); INSERT INTO base_tbl VALUES ('Tom', 'public'), -@@ -2299,6 +2752,7 @@ +@@ -2299,6 +2743,7 @@ ('Harry', 'public'); CREATE VIEW rw_view1 AS SELECT person FROM base_tbl WHERE visibility = 'public'; @@ -74846,7 +74750,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o CREATE FUNCTION snoop(anyelement) RETURNS boolean AS $$ -@@ -2308,6 +2762,29 @@ +@@ -2308,6 +2753,29 @@ END; $$ LANGUAGE plpgsql COST 0.000001; @@ -74876,7 +74780,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o CREATE OR REPLACE FUNCTION leakproof(anyelement) RETURNS boolean AS $$ -@@ -2317,30 +2794,23 @@ +@@ -2317,30 +2785,23 @@ $$ LANGUAGE plpgsql STRICT IMMUTABLE LEAKPROOF; SELECT * FROM rw_view1 WHERE snoop(person); @@ -74916,7 +74820,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o (1 row) SELECT table_name, is_updatable, is_insertable_into -@@ -2348,7 +2818,7 @@ +@@ -2348,7 +2809,7 @@ WHERE table_name = 'rw_view1'; table_name | is_updatable | is_insertable_into ------------+--------------+-------------------- @@ -74925,7 +74829,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o (1 row) SELECT table_name, column_name, is_updatable -@@ -2357,58 +2827,47 @@ +@@ -2357,58 +2818,47 @@ ORDER BY ordinal_position; table_name | column_name | is_updatable ------------+-------------+-------------- @@ -75009,7 +74913,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o (1 row) SELECT table_name, is_updatable, is_insertable_into -@@ -2416,7 +2875,7 @@ +@@ -2416,7 +2866,7 @@ WHERE table_name = 'rw_view2'; table_name | is_updatable | is_insertable_into ------------+--------------+-------------------- @@ -75018,7 +74922,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o (1 row) SELECT table_name, column_name, is_updatable -@@ -2425,61 +2884,34 @@ +@@ -2425,61 +2875,34 @@ ORDER BY ordinal_position; table_name | column_name | is_updatable ------------+-------------+-------------- @@ -75099,7 +75003,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- security barrier view on top of table with rules CREATE TABLE base_tbl(id int PRIMARY KEY, data text, deleted boolean); INSERT INTO base_tbl VALUES (1, 'Row 1', false), (2, 'Row 2', true); -@@ -2487,61 +2919,83 @@ +@@ -2487,61 +2910,83 @@ WHERE EXISTS (SELECT 1 FROM base_tbl t WHERE t.id = new.id) DO INSTEAD UPDATE base_tbl SET data = new.data, deleted = false WHERE id = new.id; @@ -75223,7 +75127,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- security barrier view based on inheritance set CREATE TABLE t1 (a int, b float, c text); CREATE INDEX t1_a_idx ON t1(a); -@@ -2549,83 +3003,71 @@ +@@ -2549,83 +2994,71 @@ SELECT i,i,'t1' FROM generate_series(1,10) g(i); ANALYZE t1; CREATE TABLE t11 (d text) INHERITS (t1); @@ -75348,7 +75252,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM t1 WHERE a=100; -- Nothing should have been changed to 100 a | b | c ---+---+--- -@@ -2633,114 +3075,47 @@ +@@ -2633,114 +3066,47 @@ EXPLAIN (VERBOSE, COSTS OFF) UPDATE v1 SET a=a+1 WHERE snoop(a) AND leakproof(a) AND a = 8; @@ -75488,7 +75392,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM vx1; a -@@ -2756,13 +3131,13 @@ +@@ -2756,13 +3122,13 @@ CREATE TABLE tx3 (c integer); CREATE VIEW vx1 AS SELECT a FROM tx1 WHERE EXISTS(SELECT 1 FROM tx2 JOIN tx3 ON b=c); INSERT INTO vx1 VALUES (1); @@ -75505,7 +75409,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM vx1; a -@@ -2781,13 +3156,13 @@ +@@ -2781,13 +3147,13 @@ ALTER TABLE tx3 DROP COLUMN d; CREATE VIEW vx1 AS SELECT a FROM tx1 WHERE EXISTS(SELECT 1 FROM tx2 JOIN tx3 ON b=c); INSERT INTO vx1 VALUES (1); @@ -75522,7 +75426,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o SELECT * FROM vx1; a -@@ -2803,38 +3178,47 @@ +@@ -2803,38 +3169,47 @@ -- security barrier views, per bug #13988 -- CREATE TABLE t1 (a int, b text, c int); @@ -75583,7 +75487,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o DROP TABLE t2; DROP TABLE t1; -- -@@ -2843,31 +3227,45 @@ +@@ -2843,31 +3218,45 @@ CREATE TABLE t1 (a int); CREATE VIEW v1 WITH (security_barrier = true) AS SELECT * FROM t1; @@ -75647,7 +75551,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o DROP TABLE t1; -- -- Test CREATE OR REPLACE VIEW turning a non-updatable view into an -@@ -2876,85 +3274,120 @@ +@@ -2876,85 +3265,120 @@ CREATE TABLE t1 (a int, b text); CREATE VIEW v1 AS SELECT null::int AS a; CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE a > 0 WITH CHECK OPTION; @@ -75800,7 +75704,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o create table sometable (a int, b text); insert into sometable values (1, 'a'), (2, 'b'); create view wcowrtest_v2 as -@@ -2962,13 +3395,22 @@ +@@ -2962,13 +3386,22 @@ from wcowrtest r where r in (select s from sometable s where r.a = s.a) with check option; @@ -75825,7 +75729,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- Check INSERT .. ON CONFLICT DO UPDATE works correctly when the view's -- columns are named and ordered differently than the underlying table's. create table uv_iocu_tab (a text unique, b float); -@@ -2977,6 +3419,7 @@ +@@ -2977,6 +3410,7 @@ select b, b+1 as c, a, '2.0'::text as two from uv_iocu_tab; insert into uv_iocu_view (a, b) values ('xyxyxy', 1) on conflict (a) do update set b = uv_iocu_view.b; @@ -75833,7 +75737,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o select * from uv_iocu_tab; a | b --------+--- -@@ -2985,40 +3428,39 @@ +@@ -2985,40 +3419,39 @@ insert into uv_iocu_view (a, b) values ('xyxyxy', 1) on conflict (a) do update set b = excluded.b; @@ -75885,7 +75789,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o (1 row) drop view uv_iocu_view; -@@ -3028,112 +3470,179 @@ +@@ -3028,112 +3461,179 @@ create view uv_iocu_view as select b as bb, a as aa, uv_iocu_tab::text as cc from uv_iocu_tab; insert into uv_iocu_view (aa,bb) values (1,'x'); @@ -76099,7 +76003,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o select * from base_tbl; a | b | c ---+-----+--- -@@ -3141,22 +3650,38 @@ +@@ -3141,22 +3641,38 @@ (1 row) set session authorization regress_view_user2; @@ -76140,7 +76044,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o drop view rw_view3; drop view rw_view2; drop view rw_view1; -@@ -3169,36 +3694,43 @@ +@@ -3169,36 +3685,43 @@ c text default 'Table default', d text, e text); create view base_tab_def_view as select * from base_tab_def; alter view base_tab_def_view alter b set default 'View default'; @@ -76201,17 +76105,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- Adding an INSTEAD OF trigger should cause NULLs to be inserted instead of -- table defaults, where there are no view defaults. -@@ -3213,6 +3745,9 @@ +@@ -3213,6 +3736,10 @@ language plpgsql; create trigger base_tab_def_view_instrig instead of insert on base_tab_def_view for each row execute function base_tab_def_view_instrig_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ truncate base_tab_def; insert into base_tab_def values (1); insert into base_tab_def values (2), (3); -@@ -3220,36 +3755,51 @@ +@@ -3220,36 +3747,49 @@ insert into base_tab_def values (5, default, default, default, default), (6, default, default, default, default); insert into base_tab_def_view values (11); @@ -76256,9 +76161,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- Using an unconditional DO INSTEAD rule should also cause NULLs to be -- inserted where there are no view defaults. drop trigger base_tab_def_view_instrig on base_tab_def_view; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: "base_tab_def_view" is not a table drop function base_tab_def_view_instrig_func; create rule base_tab_def_view_ins_rule as on insert to base_tab_def_view do instead insert into base_tab_def values (new.a, new.b, new.c, new.d, new.e); @@ -76280,7 +76183,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o truncate base_tab_def; insert into base_tab_def values (1); insert into base_tab_def values (2), (3); -@@ -3257,29 +3807,26 @@ +@@ -3257,29 +3797,26 @@ insert into base_tab_def values (5, default, default, default, default), (6, default, default, default, default); insert into base_tab_def_view values (11); @@ -76324,7 +76227,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o -- A DO ALSO rule should cause each row to be inserted twice. The first -- insert should behave the same as an auto-updatable view (using table -@@ -3287,8 +3834,38 @@ +@@ -3287,8 +3824,38 @@ -- behave the same as a rule-updatable view (inserting NULLs where there are -- no view defaults). drop rule base_tab_def_view_ins_rule on base_tab_def_view; @@ -76363,7 +76266,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o truncate base_tab_def; insert into base_tab_def values (1); insert into base_tab_def values (2), (3); -@@ -3296,56 +3873,71 @@ +@@ -3296,56 +3863,71 @@ insert into base_tab_def values (5, default, default, default, default), (6, default, default, default, default); insert into base_tab_def_view values (11); @@ -76469,7 +76372,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/updatable_views.o drop view base_tab_def_view; drop table base_tab_def; -@@ -3353,14 +3945,22 @@ +@@ -3353,14 +3935,22 @@ create table base_tab (a serial, b int[], c text, d text default 'Table default'); create view base_tab_view as select c, a, b from base_tab; alter view base_tab_view alter column c set default 'View default'; @@ -76548,30 +76451,24 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create table pkeys (pkey1 int4 not null, pkey2 text not null); create table fkeys (fkey1 int4, fkey2 text, fkey3 int); create table fkeys2 (fkey21 int4, fkey22 text, pkey23 int not null); -@@ -50,10 +67,16 @@ +@@ -50,10 +67,12 @@ for each row execute function check_primary_key ('fkey1', 'fkey2', 'pkeys', 'pkey1', 'pkey2'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: check_primary_key() create trigger check_fkeys_pkey2_exist before insert or update on fkeys for each row execute function check_primary_key ('fkey3', 'fkeys2', 'pkey23'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: check_primary_key() -- -- For fkeys2: -- (fkey21, fkey22) --> pkeys (pkey1, pkey2) -@@ -63,11 +86,25 @@ +@@ -63,11 +82,23 @@ for each row execute procedure check_primary_key ('fkey21', 'fkey22', 'pkeys', 'pkey1', 'pkey2'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: check_primary_key() -- Test comments COMMENT ON TRIGGER check_fkeys2_pkey_bad ON fkeys2 IS 'wrong'; -ERROR: trigger "check_fkeys2_pkey_bad" for table "fkeys2" does not exist @@ -76592,23 +76489,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- -- For pkeys: -- ON DELETE/UPDATE (pkey1, pkey2) CASCADE: -@@ -79,6 +116,9 @@ +@@ -79,6 +110,7 @@ execute procedure check_foreign_key (2, 'cascade', 'pkey1', 'pkey2', 'fkeys', 'fkey1', 'fkey2', 'fkeys2', 'fkey21', 'fkey22'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: check_foreign_key() -- -- For fkeys2: -- ON DELETE/UPDATE (pkey23) RESTRICT: -@@ -88,59 +128,38 @@ +@@ -88,59 +120,36 @@ before delete or update on fkeys2 for each row execute procedure check_foreign_key (1, 'restrict', 'pkey23', 'fkeys', 'fkey3'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: check_foreign_key() insert into fkeys2 values (10, '1', 1); insert into fkeys2 values (30, '3', 2); insert into fkeys2 values (40, '4', 5); @@ -76670,17 +76563,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la DROP TABLE pkeys; DROP TABLE fkeys; -@@ -150,6 +169,9 @@ +@@ -150,6 +159,7 @@ create trigger trigger_return_old before insert or delete or update on trigtest for each row execute procedure trigger_return_old(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: trigger_return_old() insert into trigtest values(1, 'foo'); select * from trigtest; f1 | f2 -@@ -159,9 +181,9 @@ +@@ -159,9 +169,9 @@ update trigtest set f2 = f2 || 'bar'; select * from trigtest; @@ -76693,24 +76584,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) delete from trigtest; -@@ -173,21 +195,32 @@ - -- Also check what happens when such a trigger runs before or after others - create function f1_times_10() returns trigger as - $$ begin new.f1 := new.f1 * 10; return new; end $$ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.f1 := new.f1 * 10 -+^ -+-- -+source SQL: -+begin new.f1 := new.f1 * 10; return new; end -+ ^ +@@ -176,18 +186,22 @@ create trigger trigger_alpha before insert or update on trigtest for each row execute procedure f1_times_10(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ insert into trigtest values(1, 'foo'); select * from trigtest; f1 | f2 @@ -76730,13 +76611,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) delete from trigtest; -@@ -199,18 +232,21 @@ +@@ -199,18 +213,22 @@ create trigger trigger_zed before insert or update on trigtest for each row execute procedure f1_times_10(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ insert into trigtest values(1, 'foo'); select * from trigtest; - f1 | f2 @@ -76758,13 +76640,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) delete from trigtest; -@@ -220,18 +256,21 @@ +@@ -220,18 +238,19 @@ (0 rows) drop trigger trigger_alpha on trigtest; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "trigger_alpha" of relation "trigtest" does not exist insert into trigtest values(1, 'foo'); select * from trigtest; f1 | f2 @@ -76784,17 +76664,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) delete from trigtest; -@@ -249,6 +288,9 @@ +@@ -249,6 +268,7 @@ create trigger trigger_return_old before insert or delete or update on trigtest for each row execute procedure trigger_return_old(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: trigger_return_old() insert into trigtest values(1); select * from trigtest; a | b | c -@@ -266,32 +308,31 @@ +@@ -266,32 +286,31 @@ update trigtest set a = 2 where a = 1 returning *; a | b | c | d ---+---+-------+---- @@ -76834,21 +76712,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) drop table trigtest; -@@ -307,38 +348,43 @@ +@@ -307,38 +326,39 @@ for each row execute procedure ttdummy (price_on, price_off); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: ttdummy() create trigger ttserial before insert or update on tttest for each row execute procedure autoinc (price_on, ttdummy_seq); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: autoinc() insert into tttest values (1, 1, null); insert into tttest values (2, 2, null); insert into tttest values (3, 3, 0); @@ -76887,7 +76761,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (2 rows) -- change price for price_id == 3 -@@ -346,11 +392,9 @@ +@@ -346,11 +366,9 @@ select * from tttest; price_id | price_val | price_on | price_off ----------+-----------+----------+----------- @@ -76902,7 +76776,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- now we want to change pric_id in ALL tuples -- this gets us not what we need -@@ -358,77 +402,51 @@ +@@ -358,77 +376,51 @@ select * from tttest; price_id | price_val | price_on | price_off ----------+-----------+----------+----------- @@ -76992,29 +76866,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table tttest; drop sequence ttdummy_seq; -@@ -445,147 +463,132 @@ - END;'; - CREATE TRIGGER before_ins_stmt_trig BEFORE INSERT ON main_table - FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('before_ins_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER after_ins_stmt_trig AFTER INSERT ON main_table - FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('after_ins_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- - -- if neither 'FOR EACH ROW' nor 'FOR EACH STATEMENT' was specified, - -- CREATE TRIGGER should default to 'FOR EACH STATEMENT' - -- - CREATE TRIGGER after_upd_stmt_trig AFTER UPDATE ON main_table - EXECUTE PROCEDURE trigger_func('after_upd_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- Both insert and update statement level triggers (before and after) should - -- fire. Doesn't fire UPDATE before trigger, but only because one isn't +@@ -458,53 +450,60 @@ -- defined. INSERT INTO main_table (a, b) VALUES (5, 10) ON CONFLICT (a) DO UPDATE SET b = EXCLUDED.b; @@ -77023,9 +76875,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT CREATE TRIGGER after_upd_row_trig AFTER UPDATE ON main_table FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_row'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ INSERT INTO main_table DEFAULT VALUES; -NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT -NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT @@ -77035,6 +76884,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW -NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT ++NOTICE: trigger_func() called: action = UPDATE, when = AFTER, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = AFTER, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = AFTER, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = AFTER, level = ROW -- UPDATE that effects zero rows should still call per-statement trigger UPDATE main_table SET a = a + 2 WHERE b > 100; -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT @@ -77069,37 +76922,29 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- CREATE TRIGGER modified_a BEFORE UPDATE OF a ON main_table FOR EACH ROW WHEN (OLD.a <> NEW.a) EXECUTE PROCEDURE trigger_func('modified_a'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER modified_any BEFORE UPDATE OF a ON main_table FOR EACH ROW WHEN (OLD.* IS DISTINCT FROM NEW.*) EXECUTE PROCEDURE trigger_func('modified_any'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches pattern: old.* CREATE TRIGGER insert_a AFTER INSERT ON main_table FOR EACH ROW WHEN (NEW.a = 123) EXECUTE PROCEDURE trigger_func('insert_a'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER delete_a AFTER DELETE ON main_table FOR EACH ROW WHEN (OLD.a = 123) EXECUTE PROCEDURE trigger_func('delete_a'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER insert_when BEFORE INSERT ON main_table FOR EACH STATEMENT WHEN (true) EXECUTE PROCEDURE trigger_func('insert_when'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ CREATE TRIGGER delete_when AFTER DELETE ON main_table - FOR EACH STATEMENT WHEN (true) EXECUTE PROCEDURE trigger_func('delete_when'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - SELECT trigger_name, event_manipulation, event_object_schema, event_object_table, - action_order, action_condition, action_orientation, action_timing, - action_reference_old_table, action_reference_new_table +@@ -515,77 +514,42 @@ FROM information_schema.triggers WHERE event_object_table IN ('main_table') ORDER BY trigger_name COLLATE "C", 2; @@ -77194,7 +77039,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la SELECT count(*) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'modified_a'; count ------- -@@ -595,15 +598,33 @@ +@@ -595,13 +559,17 @@ SELECT count(*) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'modified_modified_a'; count ------- @@ -77203,72 +77048,32 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) DROP TRIGGER modified_modified_a ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "modified_modified_a" of relation "main_table" does not exist DROP TRIGGER modified_any ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "modified_any" of relation "main_table" does not exist DROP TRIGGER insert_a ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "insert_a" of relation "main_table" does not exist DROP TRIGGER delete_a ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "delete_a" of relation "main_table" does not exist DROP TRIGGER insert_when ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ DROP TRIGGER delete_when ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ -- Test WHEN condition accessing system columns. - create table table_with_oids(a int); - insert into table_with_oids values (1); -@@ -611,57 +632,47 @@ +@@ -611,8 +579,11 @@ for each row when (new.tableoid = old.tableoid AND new.tableoid <> 0) execute procedure trigger_func('after_upd_oid_unchanged'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ update table_with_oids set a = a + 1; -NOTICE: trigger_func(after_upd_oid_unchanged) called: action = UPDATE, when = AFTER, level = ROW drop table table_with_oids; -- Test column-level triggers DROP TRIGGER after_upd_row_trig ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER before_upd_a_row_trig BEFORE UPDATE OF a ON main_table - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_upd_a_row'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER after_upd_b_row_trig AFTER UPDATE OF b ON main_table - FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_b_row'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER after_upd_a_b_row_trig AFTER UPDATE OF a, b ON main_table - FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_a_b_row'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER before_upd_a_stmt_trig BEFORE UPDATE OF a ON main_table - FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('before_upd_a_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -627,41 +598,21 @@ CREATE TRIGGER after_upd_b_stmt_trig AFTER UPDATE OF b ON main_table FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('after_upd_b_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ SELECT pg_get_triggerdef(oid) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'after_upd_a_b_row_trig'; - pg_get_triggerdef -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -77287,8 +77092,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW -NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT -+ERROR: duplicate key value violates unique constraint "main_table_a_key" -+DETAIL: Key (a)=(50) already exists. ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW UPDATE main_table SET b = 10; -NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW -NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW @@ -77308,37 +77117,42 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW -NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW ++NOTICE: trigger_func() called: action = UPDATE, when = BEFORE, level = ROW -- -- Test case for bug with BEFORE trigger followed by AFTER trigger with WHEN -- -@@ -675,76 +686,88 @@ - $$ LANGUAGE plpgsql; - CREATE TRIGGER some_trig_before BEFORE UPDATE ON some_t FOR EACH ROW - EXECUTE PROCEDURE dummy_update_func('before'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -678,73 +629,853 @@ CREATE TRIGGER some_trig_aftera AFTER UPDATE ON some_t FOR EACH ROW WHEN (NOT OLD.some_col AND NEW.some_col) EXECUTE PROCEDURE dummy_update_func('aftera'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER some_trig_afterb AFTER UPDATE ON some_t FOR EACH ROW WHEN (NOT NEW.some_col) EXECUTE PROCEDURE dummy_update_func('afterb'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ INSERT INTO some_t VALUES (TRUE); UPDATE some_t SET some_col = TRUE; -NOTICE: dummy_update_func(before) called: action = UPDATE, old = (t), new = (t) ++NOTICE: dummy_update_func() called: action = UPDATE, old = (t), new = (t) UPDATE some_t SET some_col = FALSE; -NOTICE: dummy_update_func(before) called: action = UPDATE, old = (t), new = (f) -NOTICE: dummy_update_func(afterb) called: action = UPDATE, old = (t), new = (f) ++NOTICE: dummy_update_func() called: action = UPDATE, old = (t), new = (f) UPDATE some_t SET some_col = TRUE; -NOTICE: dummy_update_func(before) called: action = UPDATE, old = (f), new = (t) -NOTICE: dummy_update_func(aftera) called: action = UPDATE, old = (f), new = (t) ++NOTICE: dummy_update_func() called: action = UPDATE, old = (f), new = (t) DROP TABLE some_t; -- bogus cases CREATE TRIGGER error_upd_and_col BEFORE UPDATE OR UPDATE OF a ON main_table @@ -77353,9 +77167,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la CREATE TRIGGER error_upd_a_a BEFORE UPDATE OF a, a ON main_table FOR EACH ROW EXECUTE PROCEDURE trigger_func('error_upd_a_a'); -ERROR: column "a" specified more than once -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ CREATE TRIGGER error_ins_a BEFORE INSERT OF a ON main_table FOR EACH ROW EXECUTE PROCEDURE trigger_func('error_ins_a'); -ERROR: syntax error at or near "OF" @@ -77372,36 +77183,37 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -ERROR: INSERT trigger's WHEN condition cannot reference OLD values -LINE 2: FOR EACH ROW WHEN (OLD.a <> NEW.a) - ^ -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER error_del_when BEFORE DELETE OR UPDATE ON main_table FOR EACH ROW WHEN (OLD.a <> NEW.a) EXECUTE PROCEDURE trigger_func('error_del_new'); -ERROR: DELETE trigger's WHEN condition cannot reference NEW values -LINE 2: FOR EACH ROW WHEN (OLD.a <> NEW.a) - ^ -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER error_del_when BEFORE INSERT OR UPDATE ON main_table FOR EACH ROW WHEN (NEW.tableoid <> 0) EXECUTE PROCEDURE trigger_func('error_when_sys_column'); -ERROR: BEFORE trigger's WHEN condition cannot reference NEW system columns -LINE 2: FOR EACH ROW WHEN (NEW.tableoid <> 0) - ^ -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER error_stmt_when BEFORE UPDATE OF a ON main_table FOR EACH STATEMENT WHEN (OLD.* IS DISTINCT FROM NEW.*) EXECUTE PROCEDURE trigger_func('error_stmt_when'); -ERROR: statement trigger's WHEN condition cannot reference column values -LINE 2: FOR EACH STATEMENT WHEN (OLD.* IS DISTINCT FROM NEW.*) - ^ -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches pattern: old.* -- check dependency restrictions ALTER TABLE main_table DROP COLUMN b; -ERROR: cannot drop column b of table main_table because other objects depend on it @@ -77409,12 +77221,780 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -trigger after_upd_a_b_row_trig on table main_table depends on column b of table main_table -trigger after_upd_b_stmt_trig on table main_table depends on column b of table main_table -HINT: Use DROP ... CASCADE to drop the dependent objects too. ++ERROR: error executing StatementPhase stage 1 of 1 with 8 MutationType ops: relation "main_table" (649): trigger "after_upd_b_row_trig" contains unknown column "b" ++DETAIL: • Schema change plan for ALTER TABLE ‹root›.public.‹main_table› DROP COLUMN ‹b›; ++│ ++├── • StatementPhase ++│ │ ++│ └── • Stage 1 of 1 in StatementPhase ++│ │ ++│ ├── • 4 elements transitioning toward PUBLIC ++│ │ │ ++│ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ ABSENT → BACKFILL_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "index existence precedes index dependents" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "index existence precedes index dependents" ++│ │ │ ++│ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+)} ++│ │ │ ABSENT → PUBLIC ++│ │ │ ++│ │ └── • SameStagePrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ rule: "index data exists as soon as index accepts backfills" ++│ │ ++│ ├── • 3 elements transitioning toward TRANSIENT_ABSENT ++│ │ │ ++│ │ ├── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ ABSENT → DELETE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "temp index existence precedes index dependents" ++│ │ │ ++│ │ └── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++│ │ │ ABSENT → PUBLIC ++│ │ │ ++│ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ rule: "temp index existence precedes index dependents" ++│ │ ++│ ├── • 2 elements transitioning toward ABSENT ++│ │ │ ++│ │ ├── • Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ │ │ PUBLIC → WRITE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" ++│ │ │ ++│ │ └── • ColumnName:{DescID: 649 (main_table), Name: "b", ColumnID: 2 (b-)} ++│ │ │ PUBLIC → ABSENT ++│ │ │ ++│ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ rule: "column no longer public before dependents" ++│ │ ++│ └── • 8 Mutation operations ++│ │ ++│ ├── • MakePublicColumnWriteOnly ++│ │ ColumnID: 2 ++│ │ TableID: 649 ++│ │ ++│ ├── • SetColumnName ++│ │ ColumnID: 2 ++│ │ Name: crdb_internal_column_2_name_placeholder ++│ │ TableID: 649 ++│ │ ++│ ├── • MakeAbsentIndexBackfilling ++│ │ Index: ++│ │ ConstraintID: 3 ++│ │ IndexID: 3 ++│ │ IsUnique: true ++│ │ SourceIndexID: 1 ++│ │ TableID: 649 ++│ │ TemporaryIndexID: 4 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 3 ++│ │ IndexID: 3 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 1 ++│ │ IndexID: 3 ++│ │ Kind: 2 ++│ │ TableID: 649 ++│ │ ++│ ├── • MakeAbsentTempIndexDeleteOnly ++│ │ Index: ++│ │ ConstraintID: 4 ++│ │ IndexID: 4 ++│ │ IsUnique: true ++│ │ SourceIndexID: 1 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 3 ++│ │ IndexID: 4 ++│ │ TableID: 649 ++│ │ ++│ └── • AddColumnToIndex ++│ ColumnID: 1 ++│ IndexID: 4 ++│ Kind: 2 ++│ TableID: 649 ++│ ++├── • PreCommitPhase ++│ │ ++│ ├── • Stage 1 of 2 in PreCommitPhase ++│ │ │ ++│ │ ├── • 4 elements transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ BACKFILL_ONLY → ABSENT ++│ │ │ │ ++│ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ PUBLIC → ABSENT ++│ │ │ │ ++│ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ PUBLIC → ABSENT ++│ │ │ │ ++│ │ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+)} ++│ │ │ PUBLIC → ABSENT ++│ │ │ ++│ │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT ++│ │ │ │ ++│ │ │ ├── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ DELETE_ONLY → ABSENT ++│ │ │ │ ++│ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++│ │ │ │ PUBLIC → ABSENT ++│ │ │ │ ++│ │ │ └── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++│ │ │ PUBLIC → ABSENT ++│ │ │ ++│ │ ├── • 2 elements transitioning toward ABSENT ++│ │ │ │ ++│ │ │ ├── • Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ │ │ WRITE_ONLY → PUBLIC ++│ │ │ │ ++│ │ │ └── • ColumnName:{DescID: 649 (main_table), Name: "b", ColumnID: 2 (b-)} ++│ │ │ ABSENT → PUBLIC ++│ │ │ ++│ │ └── • 1 Mutation operation ++│ │ │ ++│ │ └── • UndoAllInTxnImmediateMutationOpSideEffects ++│ │ {} ++│ │ ++│ └── • Stage 2 of 2 in PreCommitPhase ++│ │ ++│ ├── • 4 elements transitioning toward PUBLIC ++│ │ │ ++│ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ ABSENT → BACKFILL_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "index existence precedes index dependents" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "index existence precedes index dependents" ++│ │ │ ++│ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+)} ++│ │ │ ABSENT → PUBLIC ++│ │ │ ++│ │ └── • SameStagePrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ rule: "index data exists as soon as index accepts backfills" ++│ │ ++│ ├── • 3 elements transitioning toward TRANSIENT_ABSENT ++│ │ │ ++│ │ ├── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ ABSENT → DELETE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" ++│ │ │ ++│ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "temp index existence precedes index dependents" ++│ │ │ ++│ │ └── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++│ │ │ ABSENT → PUBLIC ++│ │ │ ++│ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ rule: "temp index existence precedes index dependents" ++│ │ ++│ ├── • 2 elements transitioning toward ABSENT ++│ │ │ ++│ │ ├── • Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ │ │ PUBLIC → WRITE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" ++│ │ │ ++│ │ └── • ColumnName:{DescID: 649 (main_table), Name: "b", ColumnID: 2 (b-)} ++│ │ │ PUBLIC → ABSENT ++│ │ │ ++│ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++│ │ rule: "column no longer public before dependents" ++│ │ ++│ └── • 12 Mutation operations ++│ │ ++│ ├── • MakePublicColumnWriteOnly ++│ │ ColumnID: 2 ++│ │ TableID: 649 ++│ │ ++│ ├── • SetColumnName ++│ │ ColumnID: 2 ++│ │ Name: crdb_internal_column_2_name_placeholder ++│ │ TableID: 649 ++│ │ ++│ ├── • MakeAbsentIndexBackfilling ++│ │ Index: ++│ │ ConstraintID: 3 ++│ │ IndexID: 3 ++│ │ IsUnique: true ++│ │ SourceIndexID: 1 ++│ │ TableID: 649 ++│ │ TemporaryIndexID: 4 ++│ │ ++│ ├── • MaybeAddSplitForIndex ++│ │ IndexID: 3 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 3 ++│ │ IndexID: 3 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 1 ++│ │ IndexID: 3 ++│ │ Kind: 2 ++│ │ TableID: 649 ++│ │ ++│ ├── • MakeAbsentTempIndexDeleteOnly ++│ │ Index: ++│ │ ConstraintID: 4 ++│ │ IndexID: 4 ++│ │ IsUnique: true ++│ │ SourceIndexID: 1 ++│ │ TableID: 649 ++│ │ ++│ ├── • MaybeAddSplitForIndex ++│ │ IndexID: 4 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 3 ++│ │ IndexID: 4 ++│ │ TableID: 649 ++│ │ ++│ ├── • AddColumnToIndex ++│ │ ColumnID: 1 ++│ │ IndexID: 4 ++│ │ Kind: 2 ++│ │ TableID: 649 ++│ │ ++│ ├── • SetJobStateOnDescriptor ++│ │ DescriptorID: 649 ++│ │ Initialize: true ++│ │ ++│ └── • CreateSchemaChangerJob ++│ Authorization: ++│ AppName: pg_regress/triggers ++│ UserName: test_admin ++│ DescriptorIDs: ++│ - 649 ++│ JobID: 1019300542593302529 ++│ RunningStatus: PostCommitPhase stage 1 of 7 with 1 MutationType op pending ++│ Statements: ++│ - statement: ALTER TABLE main_table DROP COLUMN b ++│ redactedstatement: ALTER TABLE ‹root›.public.‹main_table› DROP COLUMN ‹b› ++│ statementtag: ALTER TABLE ++│ ++├── • PostCommitPhase ++│ │ ++│ ├── • Stage 1 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT ++│ │ │ │ ++│ │ │ ├── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ │ DELETE_ONLY → WRITE_ONLY ++│ │ │ │ │ ++│ │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" ++│ │ │ │ │ ++│ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++│ │ │ │ │ rule: "index-column added to index before temp index receives writes" ++│ │ │ │ │ ++│ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++│ │ │ │ rule: "index-column added to index before temp index receives writes" ++│ │ │ │ ++│ │ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 4} ++│ │ │ │ ABSENT → PUBLIC ++│ │ │ │ ++│ │ │ └── • SameStagePrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "temp index data exists as soon as temp index accepts writes" ++│ │ │ ++│ │ └── • 3 Mutation operations ++│ │ │ ++│ │ ├── • MakeDeleteOnlyIndexWriteOnly ++│ │ │ IndexID: 4 ++│ │ │ TableID: 649 ++│ │ │ ++│ │ ├── • SetJobStateOnDescriptor ++│ │ │ DescriptorID: 649 ++│ │ │ ++│ │ └── • UpdateSchemaChangerJob ++│ │ JobID: 1019300542593302529 ++│ │ RunningStatus: PostCommitPhase stage 2 of 7 with 1 BackfillType op pending ++│ │ ++│ ├── • Stage 2 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 1 element transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ BACKFILL_ONLY → BACKFILLED ++│ │ │ │ ++│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" ++│ │ │ │ ++│ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ rule: "index-column added to index before index is backfilled" ++│ │ │ │ ++│ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 3 (main_table_pkey+)} ++│ │ │ │ rule: "index-column added to index before index is backfilled" ++│ │ │ │ ++│ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "temp index is WRITE_ONLY before backfill" ++│ │ │ ++│ │ └── • 1 Backfill operation ++│ │ │ ++│ │ └── • BackfillIndex ++│ │ IndexID: 3 ++│ │ SourceIndexID: 1 ++│ │ TableID: 649 ++│ │ ++│ ├── • Stage 3 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 1 element transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ BACKFILLED → DELETE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" ++│ │ │ ++│ │ └── • 3 Mutation operations ++│ │ │ ++│ │ ├── • MakeBackfillingIndexDeleteOnly ++│ │ │ IndexID: 3 ++│ │ │ TableID: 649 ++│ │ │ ++│ │ ├── • SetJobStateOnDescriptor ++│ │ │ DescriptorID: 649 ++│ │ │ ++│ │ └── • UpdateSchemaChangerJob ++│ │ JobID: 1019300542593302529 ++│ │ RunningStatus: PostCommitPhase stage 4 of 7 with 1 MutationType op pending ++│ │ ++│ ├── • Stage 4 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 1 element transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ DELETE_ONLY → MERGE_ONLY ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" ++│ │ │ ++│ │ └── • 3 Mutation operations ++│ │ │ ++│ │ ├── • MakeBackfilledIndexMerging ++│ │ │ IndexID: 3 ++│ │ │ TableID: 649 ++│ │ │ ++│ │ ├── • SetJobStateOnDescriptor ++│ │ │ DescriptorID: 649 ++│ │ │ ++│ │ └── • UpdateSchemaChangerJob ++│ │ JobID: 1019300542593302529 ++│ │ RunningStatus: PostCommitPhase stage 5 of 7 with 1 BackfillType op pending ++│ │ ++│ ├── • Stage 5 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 1 element transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ MERGE_ONLY → MERGED ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" ++│ │ │ ++│ │ └── • 1 Backfill operation ++│ │ │ ++│ │ └── • MergeIndex ++│ │ BackfilledIndexID: 3 ++│ │ TableID: 649 ++│ │ TemporaryIndexID: 4 ++│ │ ++│ ├── • Stage 6 of 7 in PostCommitPhase ++│ │ │ ++│ │ ├── • 1 element transitioning toward PUBLIC ++│ │ │ │ ++│ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ MERGED → WRITE_ONLY ++│ │ │ │ ++│ │ │ ├── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" ++│ │ │ │ ++│ │ │ └── • Precedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "temp index disappeared before its master index reaches WRITE_ONLY" ++│ │ │ ++│ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT ++│ │ │ │ ++│ │ │ └── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY ++│ │ │ │ ++│ │ │ ├── • Precedence dependency from MERGED PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ │ rule: "index is MERGED before its temp index starts to disappear" ++│ │ │ │ ++│ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" ++│ │ │ ++│ │ └── • 4 Mutation operations ++│ │ │ ++│ │ ├── • MakeWriteOnlyIndexDeleteOnly ++│ │ │ IndexID: 4 ++│ │ │ TableID: 649 ++│ │ │ ++│ │ ├── • MakeMergedIndexWriteOnly ++│ │ │ IndexID: 3 ++│ │ │ TableID: 649 ++│ │ │ ++│ │ ├── • SetJobStateOnDescriptor ++│ │ │ DescriptorID: 649 ++│ │ │ ++│ │ └── • UpdateSchemaChangerJob ++│ │ JobID: 1019300542593302529 ++│ │ RunningStatus: PostCommitPhase stage 7 of 7 with 1 ValidationType op pending ++│ │ ++│ └── • Stage 7 of 7 in PostCommitPhase ++│ │ ++│ ├── • 1 element transitioning toward PUBLIC ++│ │ │ ++│ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ │ WRITE_ONLY → VALIDATED ++│ │ │ ++│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" ++│ │ ++│ └── • 1 Validation operation ++│ │ ++│ └── • ValidateIndex ++│ IndexID: 3 ++│ TableID: 649 ++│ ++└── • PostCommitNonRevertiblePhase ++ │ ++ ├── • Stage 1 of 3 in PostCommitNonRevertiblePhase ++ │ │ ++ │ ├── • 2 elements transitioning toward PUBLIC ++ │ │ │ ++ │ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ │ │ VALIDATED → PUBLIC ++ │ │ │ │ ++ │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ │ rule: "New primary index should go public only after columns being dropped move to WRITE_ONLY" ++ │ │ │ │ ++ │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ │ rule: "primary index swap" ++ │ │ │ │ ++ │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" ++ │ │ │ │ ++ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 649 (main_table), Name: "main_table_pkey", IndexID: 3 (main_table_pkey+)} ++ │ │ │ │ rule: "index dependents exist before index becomes public" ++ │ │ │ │ rule: "primary index named right before index becomes public" ++ │ │ │ │ ++ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 3 (main_table_pkey+)} ++ │ │ │ │ rule: "index dependents exist before index becomes public" ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 3 (main_table_pkey+)} ++ │ │ │ rule: "index dependents exist before index becomes public" ++ │ │ │ ++ │ │ └── • IndexName:{DescID: 649 (main_table), Name: "main_table_pkey", IndexID: 3 (main_table_pkey+)} ++ │ │ │ ABSENT → PUBLIC ++ │ │ │ ++ │ │ └── • Precedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 3 (main_table_pkey+), ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ rule: "index existence precedes index dependents" ++ │ │ ++ │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT ++ │ │ │ ++ │ │ ├── • TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT ++ │ │ │ │ ++ │ │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" ++ │ │ │ │ ++ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++ │ │ │ │ rule: "dependents removed before index" ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++ │ │ │ rule: "dependents removed before index" ++ │ │ │ ++ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 4} ++ │ │ │ │ PUBLIC → TRANSIENT_ABSENT ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ │ rule: "index drop mutation visible before cleaning up index columns" ++ │ │ │ ++ │ │ └── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 4} ++ │ │ │ PUBLIC → TRANSIENT_ABSENT ++ │ │ │ ++ │ │ └── • Precedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ │ rule: "index drop mutation visible before cleaning up index columns" ++ │ │ ++ │ ├── • 3 elements transitioning toward ABSENT ++ │ │ │ ++ │ │ ├── • Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ │ WRITE_ONLY → DELETE_ONLY ++ │ │ │ │ ++ │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" ++ │ │ │ ++ │ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ │ PUBLIC → VALIDATED ++ │ │ │ │ ++ │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" ++ │ │ │ ++ │ │ └── • IndexName:{DescID: 649 (main_table), Name: "main_table_pkey", IndexID: 1 (main_table_pkey-)} ++ │ │ │ PUBLIC → ABSENT ++ │ │ │ ++ │ │ └── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ rule: "index no longer public before dependents, excluding columns" ++ │ │ ++ │ └── • 10 Mutation operations ++ │ │ ++ │ ├── • MakeWriteOnlyColumnDeleteOnly ++ │ │ ColumnID: 2 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • MakePublicPrimaryIndexWriteOnly ++ │ │ IndexID: 1 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • SetIndexName ++ │ │ IndexID: 1 ++ │ │ Name: crdb_internal_index_1_name_placeholder ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • SetIndexName ++ │ │ IndexID: 3 ++ │ │ Name: main_table_pkey ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • RemoveColumnFromIndex ++ │ │ ColumnID: 3 ++ │ │ IndexID: 4 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • RemoveColumnFromIndex ++ │ │ ColumnID: 1 ++ │ │ IndexID: 4 ++ │ │ Kind: 2 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • MakeValidatedPrimaryIndexPublic ++ │ │ IndexID: 3 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • MakeIndexAbsent ++ │ │ IndexID: 4 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • SetJobStateOnDescriptor ++ │ │ DescriptorID: 649 ++ │ │ ++ │ └── • UpdateSchemaChangerJob ++ │ IsNonCancelable: true ++ │ JobID: 1019300542593302529 ++ │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 3 with 4 MutationType ops pending ++ │ ++ ├── • Stage 2 of 3 in PostCommitNonRevertiblePhase ++ │ │ ++ │ ├── • 4 elements transitioning toward ABSENT ++ │ │ │ ++ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 1 (main_table_pkey-)} ++ │ │ │ │ PUBLIC → ABSENT ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ rule: "index drop mutation visible before cleaning up index columns" ++ │ │ │ ++ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 1 (main_table_pkey-)} ++ │ │ │ │ PUBLIC → ABSENT ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ rule: "index drop mutation visible before cleaning up index columns" ++ │ │ │ ++ │ │ ├── • IndexColumn:{DescID: 649 (main_table), ColumnID: 2 (b-), IndexID: 1 (main_table_pkey-)} ++ │ │ │ │ PUBLIC → ABSENT ++ │ │ │ │ ++ │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ │ rule: "column no longer public before dependents" ++ │ │ │ │ ++ │ │ │ └── • Precedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ rule: "index drop mutation visible before cleaning up index columns" ++ │ │ │ ++ │ │ └── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ VALIDATED → DELETE_ONLY ++ │ │ │ ++ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" ++ │ │ ++ │ └── • 6 Mutation operations ++ │ │ ++ │ ├── • MakeWriteOnlyIndexDeleteOnly ++ │ │ IndexID: 1 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • RemoveColumnFromIndex ++ │ │ ColumnID: 3 ++ │ │ IndexID: 1 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • RemoveColumnFromIndex ++ │ │ ColumnID: 1 ++ │ │ IndexID: 1 ++ │ │ Kind: 2 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • RemoveColumnFromIndex ++ │ │ ColumnID: 2 ++ │ │ IndexID: 1 ++ │ │ Kind: 2 ++ │ │ Ordinal: 1 ++ │ │ TableID: 649 ++ │ │ ++ │ ├── • SetJobStateOnDescriptor ++ │ │ DescriptorID: 649 ++ │ │ ++ │ └── • UpdateSchemaChangerJob ++ │ IsNonCancelable: true ++ │ JobID: 1019300542593302529 ++ │ RunningStatus: PostCommitNonRevertiblePhase stage 3 of 3 with 4 MutationType ops pending ++ │ ++ └── • Stage 3 of 3 in PostCommitNonRevertiblePhase ++ │ ++ ├── • 1 element transitioning toward TRANSIENT_ABSENT ++ │ │ ++ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 4} ++ │ │ PUBLIC → TRANSIENT_ABSENT ++ │ │ ++ │ ├── • SameStagePrecedence dependency from DROPPED IndexData:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-)} ++ │ │ rule: "schedule all GC jobs for a descriptor in the same stage" ++ │ │ ++ │ └── • Precedence dependency from TRANSIENT_ABSENT TemporaryIndex:{DescID: 649 (main_table), IndexID: 4, ConstraintID: 4, SourceIndexID: 1 (main_table_pkey-)} ++ │ rule: "index removed before garbage collection" ++ │ ++ ├── • 4 elements transitioning toward ABSENT ++ │ │ ++ │ ├── • Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ DELETE_ONLY → ABSENT ++ │ │ │ ++ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" ++ │ │ │ ++ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 649 (main_table), Name: "b", ColumnID: 2 (b-)} ++ │ │ │ rule: "dependents removed before column" ++ │ │ │ ++ │ │ ├── • SameStagePrecedence dependency from ABSENT ColumnType:{DescID: 649 (main_table), ColumnFamilyID: 0 (primary), ColumnID: 2 (b-), TypeName: "INT8"} ++ │ │ │ rule: "dependents removed before column" ++ │ │ │ rule: "column type removed right before column when not dropping relation" ++ │ │ │ ++ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 2 (b-), IndexID: 1 (main_table_pkey-)} ++ │ │ │ rule: "dependents removed before column" ++ │ │ │ ++ │ │ └── • Precedence dependency from ABSENT PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ rule: "indexes containing column reach absent before column" ++ │ │ ++ │ ├── • ColumnType:{DescID: 649 (main_table), ColumnFamilyID: 0 (primary), ColumnID: 2 (b-), TypeName: "INT8"} ++ │ │ │ PUBLIC → ABSENT ++ │ │ │ ++ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 649 (main_table), ColumnID: 2 (b-)} ++ │ │ rule: "column no longer public before dependents" ++ │ │ ++ │ ├── • PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ DELETE_ONLY → ABSENT ++ │ │ │ ++ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 3 (rowid), IndexID: 1 (main_table_pkey-)} ++ │ │ │ rule: "dependents removed before index" ++ │ │ │ ++ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 1 (a), IndexID: 1 (main_table_pkey-)} ++ │ │ │ rule: "dependents removed before index" ++ │ │ │ ++ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 649 (main_table), ColumnID: 2 (b-), IndexID: 1 (main_table_pkey-)} ++ │ │ │ rule: "dependents removed before index" ++ │ │ │ ++ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" ++ │ │ │ ++ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 649 (main_table), Name: "main_table_pkey", IndexID: 1 (main_table_pkey-)} ++ │ │ rule: "dependents removed before index" ++ │ │ ++ │ └── • IndexData:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-)} ++ │ │ PUBLIC → ABSENT ++ │ │ ++ │ └── • Precedence dependency from ABSENT PrimaryIndex:{DescID: 649 (main_table), IndexID: 1 (main_table_pkey-), ConstraintID: 2} ++ │ rule: "index removed before garbage collection" ++ │ ++ └── • 6 Mutation operations ++ │ ++ ├── • MakeIndexAbsent ++ │ IndexID: 1 ++ │ TableID: 649 ++ │ ++ ├── • CreateGCJobForIndex ++ │ IndexID: 1 ++ │ StatementForDropJob: ++ │ Statement: ALTER TABLE root.public.main_table DROP COLUMN b ++ │ TableID: 649 ++ │ ++ ├── • CreateGCJobForIndex ++ │ IndexID: 4 ++ │ StatementForDropJob: ++ │ Statement: ALTER TABLE root.public.main_table DROP COLUMN b ++ │ TableID: 649 ++ │ ++ ├── • MakeDeleteOnlyColumnAbsent ++ │ ColumnID: 2 ++ │ TableID: 649 ++ │ ++ ├── • RemoveJobStateFromDescriptor ++ │ DescriptorID: 649 ++ │ JobID: 1019300542593302529 ++ │ ++ └── • UpdateSchemaChangerJob ++ DescriptorIDsToRemove: ++ - 649 ++ IsNonCancelable: true ++ JobID: 1019300542593302529 ++ RunningStatus: all stages completed ++ ++-- ++stages graphviz: https://cockroachdb.github.io/scplan/viz.html#H4sIAAAAAAAA/+x93W7bSNL2cXIVgg8X89NV/UMyX2LAiZ2FZxw7sJ1dfBgsDNpibGIkUq9Ez07mxQK5rZ3LyZW8YMkiKapKoixK5kzmIIDj7mZY1U9V18/TTD++HYeju17vf58/m9xfT/9yM7ifZNH4agL5r5nfo3M08mwQXkeDV3vv00n2Jh0O4+w0Tc6jX6JxFl8Povd34STqTbLwNupBL/3Y071/x9ldD1Tv3X0WZnGaXH4aRb10NNn7f/njEnTeTw/PVC8Oj06OLo+uzk5P/v/ev2bj/mwcXhy8vjg6vSyGvGIpqBfvP7w+OX5TjpXLYGEsKMawPuarYkwvjEExZhbGsBizC2O6GHMvLs8PTi+Oj04vr2rS+KaY5S2ZZYtZ/pJZrpgV1N/GFdIvCO8Vwi/I7hWyL4juFaIvSO4VkrsX/zg4OT48uDw6LEcLib2FrS3E9BeeWci2IJpfAGJzfL7o9e+Hw09730zuwlH0am+Uxkm2980k+zSIXu3FyS/x5OHfff7s2X94o/H9dY0GKy/lRJvxg+U2EyjRZoJAtBmtlGgzWoFoM1qhaDNaadFmtDKizWhlG9iMVq6BzWjlNbAZrXzZZgIQbSbA0mbqutalzdSHTGkz9SFb2gy7uU60msATrSbwJavRKljDapYDtAWj0aDWNRrdxGg0QGk0ta0HlOxFI8j2gijbC2rZXtDI9oJWthd0sr2g18Re0G9iLxg0sRetKvYizgJdWk59yEiWo8FKlqPBSZajwSstpz7kS0ajISiNpq4IJRqNhjWMZjlAWzAaABSMZuHE86avoSU7gXLH1It/nh/X3A+Uu1a3Fahgvm4rUME8vHh98ObHt8cnJ/NPrkC/jhWoQL9uMlCBft1koAL4uslABeaOk7QCcK++ttx+qLta0CgeJFACu+4VoAT2goQlsBcELIG9IF8JbLcguirNoT4E0hkCpb9bkEvrRXNoDr02LECbBhaAldeA3uvw5ueP8WDw8BozA9B2qQFoJxqAsbIBGMcYQBkMg/Fk9BtfRr8JZPRbJaPfwnL0W5TRb7WMfmtk9GtPRL/2RfTrQES/USL6DYjoNyii32gR/caI6Ld2OfqXwq4N8FspO184hVa6f+stRb8V03FwcjoOrpqOM1EtuECGvyfn5ODJOTl4ck4Onl4Of8/I8PesDH9PzrzBipk3ODHzBidm3uDEzBucFuHvjAh/J6bd4MS0Gzwm7W4OvDbw70mJdvU1TCP8e8FS/Ptiag2+nFpDUE2t3x2d/7322ABk+Adyeg2BnF5DIKfXENjl8A+cDP/Ak+EfyEk0+GISDT6K8Pe1CH/fiPD3rQh/34nw98X8GXwxf4aAyZ+b466NOpOSUubqa9gGsQ8qWIZ+VGKijCAnyghYR39ZBAQtIh9BTpQR5EQZQU6UEbylyEfwReQjBCLyEZVcPlJaLB8pIyEflZWQj8pJyEflSchH5UvIRxWIlSMQk2BEJgluDLk2gI9N0l5XeQsj1lRxadqLKKa9qOW0F3U17WUeq+WcF7Wc86KWc17Ucs6LOmDLRFyd0cjpLxo5/UUjp7+IYvqLKKa/iGL6iyimv4hi+otaTH9Ri+kvajH9RbMi/V0OwTYswTRJf705e/xHOIj71ReZmYJZmgCjERNgtHICjLaaAC82g6yc/6KV81+0cv6LTs5/0UFjS3ByKoxOToXRyakwGjEVRiOmwmjEVBitmAqjFVNhtGIqjFZMhdGKqTC6FanwCgi2YAqulguMI6EchbO3qNnjgxm4SiIwL2QlH62PyCmAX80A5vHty8G/X439a0PV0L82VI38a0PVwL82VI35a0PVkL82VI3454c8MeD3xHjfE8N9T4z2PTHY98RY3xNDfU+M9MsEb31QtQDsQK0GNlbfAaVgJ1ga5QdikA9KDvJBVYN8vsKv5FgflBzrg5JjfVByrA+qGutzVSclB/ug5GAfQImgD8RYPxBD/UCM9AMx0A/EOD8Qw/xAjPJBiVE+lJndYyDXAvDNfHXzIguzaBgli8YH07fwJdybpbVNI5Y2rVzZtP4q1Fu5sunkwqaT65pOLms6vRzwTq5qOrmo6ZyIdiOWNK1Y0bRiQdOK9UwrljOtWM20YjHTirXMsob9CJS1wX6YQ/pk9g4FgH/6mCbZJP4terUX7H0znfbyZRZeD6LezSCcTF7tpfdZNN7bf5mN919m/dlv76Kwn/96cjO6/q6Q7eX3WX//5fc0labvzz+L/lI8a/886oc3WdSvrc/6+wcnl0fnvcuD1ydHvS+f/ztO0+zL59+/G91fD+Kb7758/u8wjJMretyXz7/3Ds/P3vfenJ18eHeaT7/+8vn3xVdZ/q+UD5x72vWS51yGt9yjKiu+pwful795PvvV8/3ZriZpEq1Mx+a2MQvHt1Gxh3bjPfwbbeKbdHA/TNbcwRtadNwv9ICLD6AllSnOBI9XUeJaFfc0HEZbEDkpHpv19xkItasSr1WV5N5nCyqJBmQzb8YR+bh3URb2wywsliz9B+IENZyNT8IsGhcrsvE986JxgkavmLqg4GLx5PR+MMgHV/wryzdwNqnQ5Cr5PobDePCpmHucZG8rv6k+M40rWlaL4/+O+9ld5bWaSJ2/52kVscenl/4GePRbwuNx0o9+bcctaQ4o/ejXyhTYtpkG3VMLI3MDtfwcJ+X4xeXZ+dHhtnUHqnvKY5xcW8pLx/04CQfHyY/V2VtHKEBLWn4/jofh+BMpe201J5NsHMZJtrGq48mHJP6f+818+do6xDaR+oj4pIFi5sKTMvC9Gv0cMUdOy/rRbernsAgh2tRPyxJvnmW1K/HWY3RoKye5zBc8QuI8srwOJ1WJQJmti91WbtK2+2wQ/XBTmrnPSXo/vomON7Wq2aRoOErHM+Ers5dGsqs2pq0MqS2fzGj7SX3yHzNiZ6a0rJc/ZsjO6OUJQnZsNWRv4djbOlywrfD5cs4JtnECMGdfXT3clJ2eAGuru9VIe2dea+thCLYaYe/MazF6eQqv1bVgfftwKdpaa3abyqbSbTRtRiQl6W6+r5lU7tTND1RIibUlFUrifP80qRASsTYSCPSWpMI+NLUREMgtSYV56GojWqC2JOWtnhqzJalc5prveiYl6RBrWgv4nmdSEg5NbQD4jmdSkg1dbUDz/c6kpJr6tQHLdzuf56h4/iyx3+5XgJClvQdhZ1Dqh5O7qE9rEpfP9ZrN9fK5frO5fj43aDY3+Ha/otDlc0Hlk6HhZMgnY8PJmE/WDSfrfLJpONnkk21l8sOusZPz3dOu4eR8+7TXcHK+f9pvODnfQB00nJzvoFHNJmO+gwYaTs530FR3cOFiOrss30uj116W76oxay/L99fYtZe5qUEFP80G0ywrB6cWpNhBj1YG/EqPtk4JK6fGBuygT8alkB8kY1KaHyTjUYYfJGNRlh8k41COHyRjUB4/SOBXPq++gDTEy+kpGtw8fP3pX5ObdPTd2WjNGEMVocPf6AHn0TD9JZpGem/H6bBMO56vfNZ01fHhshB4mhocLosGqdJXmbIiplka5TxoGUjLmwfDndQyo8IGWv6xSUC9ha1A2orNQ+tObgVTTm9rK86mfcAdG46m3dq8ht/Wbr0Lf47+OY6z6CwZTEsih9Egmv614aY9jQcypEj+bPEoTA74s8WjuDjgzxafAim1eW2yrf25iLIf0muixZ0lh9HkZhyPsnTccGvKBWso/2Et1N7kw6gfZtHFzV00DN/chcltNP4hvW6KkclpmrwJk5uoCQPoh/S6iicFgVbKGrSB1gotMr2N8/skiZPbXFH3k2Lpmt/7Wbzu1RtFST9ObjdEq0+hWQsUgDbNvjT0qds9uJ7MCJzteOr2rT6Ypoh8FBuQkpGNC7Wilciu1GqaTLLxr1YU/yIb/2pF8S+y8a9WFP8i66O0ovgXWR+lFcW/yPoorchHIZshaEUZgt68P9AW0oiUGP39zQ/p9dt0vE4wUD9XmGpdQRd+m44Px+lo5pBWPns5X3mcptmMD92Auyy60C0YACEV9PQvhEzgM7OAkAl8ZhYQMoE/PQNCZgt93TadFYFhLQ/1JGFJQIYLfHARkOG20Pjsnm0yyv36bJNcL7LFGa3ocNLdiQCmadostswTtW1El48I6HYTkFbffXKZTrUh4POXcFAubBg9P1HAGw4G07h20rtJh6M8wOtvBmugejho9iABqn+DZg8SoJorGH4lVVbBbE7rassgZp882cQNMvW5i0oDf7eHEaAlFbMhJqCjQfakAvRokA0xAXM/B5b1c4ABDbJBOGhFg2wQDhpokA3CQSMNsqEOUF8FNC8n9VFA83JS3wQ0Lyf1ScDwclJfBAwvJ/VBwPByUt8DDC8ndTfA8HJqktPycmqS0/JyGlrp+JWGVrrNeWptxnsza4yT23aqUoxptm9xhvDkeDwZwpPH48kQnjweT5bw5PF4soQnj8eTJTx5PJ4s+WeP98+W/LPHe3ZNclpeTk1yOl5OTXI6Xk5DcjpeTkNyOl5OQ3I6Xk5DcjpeTkNyOl5OS3bjdScV+pOUA7dQ4JO+4rfwdY92SnpgyQQ83gQsmYDPmwD1hoHvDQP1hiHoTv2m6oyjPnnVd9H4dqbAjjpi6hED3yMG6hFDwLsZam1CwLsZarZBwLsZ6u1AwLsZ6lcA368A6lcA368A6lcA368AS3L6vJyO5PR5OR3J6fNyOpLT5+V0JKfPy+lITp+X05GcPi+nIzl9Xk5iRUDQndLJX464iSNe+lHJlhwx0V6Qp70A0V6Qp70AdWUQ+JXUasAWbhy25oij8W20TnJa89qbuODZpPkLRHxp/jF7SGVtBN4ZUZkb+TI3UJkb+TI3UJkb+TI3UJkbgXdGVMdFvo4LVMdF4A9wqgIiXwUEIlohT7QCIlohT7QCIlohT7QCIlohT7QCIlohT7QCIlohT7QCaoaj4uX0SU7gqWjUUEO+oYbUUEO+oYbE60TNryQeJ+rucF3y4IjscmpiBZGiw6ERUj0P+XoeUj0P+XoeUp0F+ToLUp0F+ToLUp0FdXeO7y3QXpj25BY2j6yOr0kh1aSQr0kh1aSQr0khtbGRb2MjtbGRb2MjtbGRb2MjtbGRb2MjtbGRb2MjtbFRC96F5NS8nMQiR83LSbU3NN3hLf4VRjYJI1d8iLYlkg61K5BvVyC1K9DwRqBppeVXalppu9PoeNDfWrHkk5xUVO9Gvt6NVO9Gvt6NVJ9Evj6JVJ9Evj6JVJ9Evj6JVJ9Evj6JVJ9Evj6JVJ9Evj6J1KdBvk+D1KdBvk+D1KdBvk+D1KdBvk+D1KdBvk+D1KdBvk+D1KdBvk+D1KdBvk+DZnp7qTvV1LkoYMpoWzsMeBoiHPVs0PGooKo1ejye7PRaWLe6PTOX1K9+neM9kTy67KCoBoxed8Laiyib/4xGK4o7XevzGVtQMzkyvpqOVAFFvgKKVAFFvgKKVAFFvzvBYDs8t53kIVQgRr87mfiur1ntRssUV/rduS2y62tWjJaf6JoV9TWQ72sgtf2Rb/sjtf2Rb/sjtf2Rb/sjtf2Rb/sjtf3R65b3mh7Z1UN805LYTli7xJJArzverIVznFHc3Dl+M+5fX8VJFo2TcHBFX8a4gqskHEZXo0F4E92lg/7sK79b1j55OZ6GgkRDQZ6GgtRPRL87CcWfpJzT3dtauIPbWsQdCLrD1C4d6/QIXdelPkmGShyLDl3Dv4iy2lfp21HcEp86/VDTFT6FU6WmOPBNceqJg+rO3uQAn6Y8dIhVqJ/rnH3FQ1fsafEFt7XifW5Ksy+4tUQAn01qqQUvnRvvwk/X0UG/fzEaxNmGl4J2UYOhjjrwHXVqqIPqTlh30O8//D8Q6bbz053onohgqjvpaVv6bZCZMvp9msyUuB+gHP1M/DrVnXi49Oy539qgz76Bc2dqCA3KDLt17h1x2LsoahHjCFR3+g87dMo70S8xZTv0BZMdOuXOlAuJHAc8OY4I5jy/nOjlPLucyOU8t5yo5TyznIjlPK+caOU8q5zI1vwX6OgDdMB/gI7otNChj5xsvRpTwDDO4nAQ/yaeFo29+fRG/iPLNgf32V06jn+jmkizE/NgNJrLYEe3V+PodhxNJt9n4/j2NhpPFl/6wyQaz63Kokl2FfaHcdJE5rmr18JrPubK9ZZJSLDmpaJZhFD8v5BNRM3/MP/t4+q9/9r+u8d1IqeV7pro58DTz4l9DgL7nHjOwPOcgXjOwPOcgRiXwDMugRiXwDMugRiXwDMugRiXwDMugRiXgN0JDea/QtVKv2gXIRYQOxV4dioQOxV4dioQOxU0ErIIAvzVBbq5APzNBbq4APzFBbq3APy9Bbq2APy1Bbq1APytBfquFvDf1QL6rhbw39UCIvOD7k6P8k/Sn9nySYfbv7VFHXMX0I859DyV/0h8Kv5KLXGA/OmsHI884Yf4Pj5ZF7F7fPpQFpFVfEM/5jbnW/oxNzGf6ibUR/Q9+jE3IP4SIvXq+VY9der5Rj316fnb+dR25u/mU0+Ub4lSR5RviBLxj+f9Ee3PY+Wi+8h+d06FD0k/PRgMjpPLX5Pj4TDqx2EWzeKts9FF3I+OPn6Mbh4iqiXm8iiix7f7ielWBe0P1/wjWrLpTonnK2v+ETWep80TMd52Z2f+av01gMBsUlutv9UAyg9b/vYE3Y9w3fk8xZ+spUY3TFx3SmhfY0eNLvI4CiLp2o7rTv7yVz+tvX7aahzkMbj7KtkDu6ii0Ie33FdJHuhMn4pu5PHfPqPbg8LNwjwG4O8V0s1B/lYh3Rvk7xTSrUH+RiFdreXvE9LFWv7SLd0ctZxcz//z/P8CAAD//7Z8TBlWsQAA ++-- ++dependencies graphviz: https://cockroachdb.github.io/scplan/viz.html#H4sIAAAAAAAA/+Q8624bt9K/7acg9LOIU+1FtzYW4FhOodaxA1tt8SEIDGqXkfbLitzDpez4HBTIa7WPkyc5ILkX7sWrVZYrb3t+GdYMZ8mZ4dw4pOutKAzWAPzn+CjcLuU/jr8NGaJ3ocF/LvndEr8f+XCJ/NNeyCBDG4RZ2PuR/4zt9x8JZqH3b3Tam/ReSLRXrxhc+gg4PgzD0x7ZMkR701eMTl8xN/51jaDLfw6dYPnyNqb76nvmTl99L1AF+jRLS/yT0JreIBc6DLm58cydnl0uLm7A4uz15QX4+uVPSgj7+uWvl8F26XvOy69f/txAD98Jcl+//AVmN9fvwPn15a9vrzj68uuXv4pTqf5KSjBDbVlBZwFXZaSUEd8LgtP0l+P4p+Ppi3ANA3TawwSj3gchj+Ojoz9KxWhmxMggXaFEhoPGMvxOCPGc+NsN3lOCjhg0dxM+mEUCYoiCMrQn384iPNS63Cu4QS0sGSdkmTstUSG9LBlpZcniMWiDJcgXe+acIsg8gt8iBl3IYDKk8gMeNi3jml5ChmgygtFtyUQ9bNrWDtQCg5PB4dXW9zlwx1eqBRgjJZzctb6PcOP5jwnuHLM3yi8qTeIpXO4X4Q+ey9bKtOqsms/zStXY+dVi3EAfx5r0cY5d9FmPWbLKFMVFnxUUo+1tOukeW0rWXIMtnzycwm8X1zcXs7Z5Z/S7x7wSI6eLeYS6Hob+HP+iYreuoYahicvvqLeB9FEwe28245BR6GHWmNVe+Cv2/rVtZsv35qGpU1O/IT6pwZhMeJIGvnfBJ1TicjTzx9LJn1kSQujkj+YVN8+y9K649Rjd0JWTLPiAb1gxjyyXMFRXZPTt1petKzfRbT5rRD9lKPXMZ0i21EHzprsqRkKbgNB48Qp2ZSS7SzC6MiRdNrmE289qk/+eEXsJima+/D1D9hK+PEPIbmoN2TW4vdbVxdQVPi8yRlCHByjxfXn2lKEc1APszW6tkfbBrFbrYYipNcI+mNUq4ctzWK2uBettq0t05hAdLbgokOcK2By9j37r/3D2+vbiaiEHYHOcAmYXlxeLi7vrq8v/i6GDFPru19eX8/MYMEwBv9/Ms6MG/Rho5IYNEnqGkZ3HwFIgr8/Of3kzv7y8mMVQuwSa+eRQQSiuYzBSwG8vbn5KKZt5SGbcWIFmVzJRIL+dXc5nZ4uUqKEAC+wZpuwxs0wYGgok87lhyh4rN8ZUINkxKdPs3JiBAsmOSRk1yI0ZKpDMmFG6nmFuzESBFKUyMhXw4ubs6nZ+cbW4y5AYGaU4RWLDsYJY4PkoXfEoO8eRpUCy67IVyFPTS786ztEdKpAs3ZECeYLuOGXNJEd3okAydMd9BfIUXaMUZ3Zz/e5dor5WSihnLNJvZz9tJWRzGm2ZKSA7ImF7Tp8tOwVkRyQMzWmzNUgB2REJo3O6bI1TQGaEnUw3p8m2lQKKumdNUmiWXj8F5I2EbaSwgr7ayZpy6mrbKSD7qWRNOUW0RykgK2d7mEKytJL15FTMHJ9MuS9p6lTffwgdEry8DvZ0p/3ES34nCLyFn9AM+Yiha+w/yuDmbBnGXQHHOwnKIfNZVTVNlK0UlB0OutJlZ9kIKSUPnCenPQ/f9144xCf0tEeRG3O1JycIGIU49JhHcAgYAVLAYBusie8C8+Qe0dAjGHj4HlIPYvYDULT0ZJrdxQP+9ebVLZ1CfCdaQeRif6eelGe3ZRhxsU0Zyr13Mi2YB3PIP968zqNThInY5HLTbdltMUacbFOMqfhOpiUxNp+B1X9f8kWZeAFMgE/wClEgO6bAEn0kFAEXBQi7ogFMJWXoIzXSRmowLiN1hR5AIMvjQKRKIFyTre+CFYmpEuw/AviRIQrkh0OwRB5eAZeSIEAu2JB7xAVRTEP4Dh00zwB1bhLpnEQ2+Ro6nz56vu/hVc0dotSPdm+mpGw0qypnyDJPNUq9stGtUjaaVVUKqvdwjJQ9OJjVOzh4uinGKMjicYnOXPc28D32htCUtTXFUM0z/XYqVuYadko9b8pbK+lRKq2VNGgn09I02+Kz6FbooOwjWaXZ1/E8jzwjTrYvz7SYUuZ9BjafR/Maoy6JxtLUvCE1WadvknTE4cNJOgo1SqpoJ1M8LA0PpPNFn72QIewgEFDkIBeFkVcu+HRJytRHaqCPVGZTuR7cEOyWsjuiAhmU3wgBDEFICOZ/JRA6DgpYCJaRWiZfEjFN8yOLNgwhcoUCvUV0tWdscXAjGHGx/a2RyYaLZd4Rn0fz8z6d0uTiiyS5b0L8PLKMeNi+LGX9viQrFlMYVdg3L4wGx7mKx0LA0CaIkw8GKRPTcL0QBgGCNDkm4KvrUOGLa8c+PjJnHJpoh+YQvahJEa8PpEmqUUg85USmrJ0RN/yEfoO+50KGXHXRsm7WabsQsbJ9aSYF9pNp9qjO4DNo3vyjS5ixILufc0aMa190aoUsf04y7MuotSviu0Us2zioRXpXezUM6pf10Chs06rQ+X0+ApcRdOJXBXSJHLJBYVTJ+zFX6cNwg1xAvdW6ctiH5ARcZhxdUYMz141u2JF9NnKhyv1tRbkWFMB8skq7v6x7Kk3rSZonUSkZui5yuamIaSmEvTT5Qm7S2SBTxn+aLpTUI2rowi91+qpaUJhBCwozaElhRrIwcHCF2c3GkXBv3YlO0lMKHuA3qKgmdPc/qCjpkqtKMthzHFR05PChhA/6t3qsozUCwWxWmA8F811JtQ4iSnq9eE4x7FZ6lm4SLTWbg8g15uNh5ZqpxRW7I/mcRqUuQKnU1K8JS3pDbfRGPKYZVxSZKNqQe+TGTmkF6RKuEHCI7yOHcyzpbOQT605Ay5VYCHevBqrnsUeGrDVWyzSp4aXC8FgINjBkiIJYWNBZo7DYPBBL57Bbo7TB9WT6ZG8sn6NdEYFREoDNlok3OsC9F3pckBEvHB9B7OEV2MYMi/orMtRLO0A0UB+OZa22S9qf2Gw958iHMeHjJyNmZSt4qobHIoqj5JxEDqvxauWnur2bz25Stz6hmoHy8z0FIz7ke+DyT9R/IP1QVxT0gPWGw9hwSxqvrvD3Rrhtya43lGz+OUwePp2jV+fTyhbhQZF3j/J7xJZOsoS8kvznAiJBMLk+IYOzrijBAQs5JfJ/pkLOaCgdfVeEoHUn/v0k0eJ2HTXcrmNTOuEultEmMi3rihKLl/HQT+c/k6X+Ck/yZuUbQmeUBD+TZb1qW/WjmZQQFj/KWeMBzSfrXfo3xpjnIuPmTxC0oHhWX97l2WtTyX2c3KqTFwC6orq3iOWe09RzeSNzxOlQd3nnYYYohv6d5MedeYfhBt0FPnQQTxniNx/bVS7LKNzGqjz63CXWH6O/gD0GKEHJHHRGCA9rhAEmTN5l4NkyRb5Ipz8k9yfljY4uKj6PLe0G3sTi0aPVnQzr0BnAQbqPrWFTKfE82OpOiH7o6LAE5ZmiQ2vU1NMICo2UYSxvhf0jlaHEZelShmv5Auhht75tPqkvQqYoBA7BDHqiThu5JFEQB1AcAZTqkKBqV5SF655/2JH/6Iou6Tn/OIxkLek52ynNS+qlJ2baqLd1rBArVcOWxUb36y0ez9vdiefT+/XqkpseUB8meolY2b4446v2hVc6eHpndzIAj6fWPnOUzuriSyViFhXXt3bfE38B0GfH37qpGwpV4vW7UnNXyR9gkLy1wifZnVSjhdPGwzieQcMA0raltnRFEBqauUsYX1HpEMy4M56l0GGL8P8Z2qZqTm1s1N3oobNG7tZHAPo++Okc/D9ZhuAjoQACF4UO9QJGKPAwYGsEQrhBIGRwhZJ3j2QI2xUl1FcrLtHF/7Va8fHRH8dHx0dYPM+TvKKV+Lnei5A9+ui058JwHfUHY/EGzKQeLlfU9FWzalyRLdv1cEURuOZ8De4W00fMdiBz32fVXJ0hsruaUzZEsD2siSwsvzqN6JJWKbLoA+/XRBa3iAc1kUUneF3KXIDp04s7kEUzpV0P2RQdtaOayKITS51zoSGsdJg4rRvsPUw0Zoz3HsblOzb3HHb8x/F/AwAA//+x2AKMC28AAA== -- this should succeed, but we'll roll it back to keep the triggers around begin; DROP TRIGGER after_upd_a_b_row_trig ON main_table; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: DROP TRIGGER is only implemented in the declarative schema changer DROP TRIGGER after_upd_b_row_trig ON main_table; +ERROR: current transaction is aborted, commands ignored until end of transaction block DROP TRIGGER after_upd_b_stmt_trig ON main_table; @@ -77430,32 +78010,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- test that disabling RI triggers works create table trigtest2 (i int references trigtest(i) on delete cascade); create function trigtest() returns trigger as $$ -@@ -754,37 +777,83 @@ - end;$$ language plpgsql; - create trigger trigtest_b_row_tg before insert or update or delete on trigtest - for each row execute procedure trigtest(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - create trigger trigtest_a_row_tg after insert or update or delete on trigtest - for each row execute procedure trigtest(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - create trigger trigtest_b_stmt_tg before insert or update or delete on trigtest - for each statement execute procedure trigtest(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -761,55 +1492,114 @@ create trigger trigtest_a_stmt_tg after insert or update or delete on trigtest for each statement execute procedure trigtest(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ insert into trigtest default values; -NOTICE: trigtest INSERT BEFORE STATEMENT --NOTICE: trigtest INSERT BEFORE ROW --NOTICE: trigtest INSERT AFTER ROW + NOTICE: trigtest INSERT BEFORE ROW + NOTICE: trigtest INSERT AFTER ROW -NOTICE: trigtest INSERT AFTER STATEMENT alter table trigtest disable trigger trigtest_b_row_tg; +ERROR: at or near "disable": syntax error @@ -77465,7 +78026,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE insert into trigtest default values; -NOTICE: trigtest INSERT BEFORE STATEMENT --NOTICE: trigtest INSERT AFTER ROW ++NOTICE: trigtest INSERT BEFORE ROW + NOTICE: trigtest INSERT AFTER ROW -NOTICE: trigtest INSERT AFTER STATEMENT alter table trigtest disable trigger user; +ERROR: at or near "disable": syntax error @@ -77474,6 +78036,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + ^ +HINT: try \h ALTER TABLE insert into trigtest default values; ++NOTICE: trigtest INSERT BEFORE ROW ++NOTICE: trigtest INSERT AFTER ROW alter table trigtest enable trigger trigtest_a_stmt_tg; +ERROR: at or near "enable": syntax error +DETAIL: source SQL: @@ -77482,6 +78046,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE insert into trigtest default values; -NOTICE: trigtest INSERT AFTER STATEMENT ++NOTICE: trigtest INSERT BEFORE ROW ++NOTICE: trigtest INSERT AFTER ROW set session_replication_role = replica; +ERROR: unimplemented: the configuration setting "session_replication_role" is not supported +HINT: You have attempted to use a feature that is not yet implemented. @@ -77496,6 +78062,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +We appreciate your feedback. + insert into trigtest default values; -- does not trigger ++NOTICE: trigtest INSERT BEFORE ROW ++NOTICE: trigtest INSERT AFTER ROW alter table trigtest enable always trigger trigtest_a_stmt_tg; +ERROR: at or near "enable": syntax error +DETAIL: source SQL: @@ -77504,6 +78072,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE insert into trigtest default values; -- now it does -NOTICE: trigtest INSERT AFTER STATEMENT ++NOTICE: trigtest INSERT BEFORE ROW ++NOTICE: trigtest INSERT AFTER ROW reset session_replication_role; +ERROR: unimplemented: the configuration setting "session_replication_role" is not supported +HINT: You have attempted to use a feature that is not yet implemented. @@ -77521,11 +78091,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la insert into trigtest2 values(2); delete from trigtest where i=2; -NOTICE: trigtest DELETE AFTER STATEMENT ++NOTICE: trigtest DELETE BEFORE ROW select * from trigtest2; i --- -@@ -792,12 +861,16 @@ - (1 row) + 1 +-(1 row) ++ 2 ++(2 rows) alter table trigtest disable trigger all; +ERROR: at or near "disable": syntax error @@ -77534,116 +78107,69 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + ^ +HINT: try \h ALTER TABLE delete from trigtest where i=1; ++NOTICE: trigtest DELETE BEFORE ROW select * from trigtest2; i --- -- 1 + 1 -(1 row) -+(0 rows) ++ 2 ++(2 rows) -- ensure we still insert, even when all triggers are disabled insert into trigtest default values; -@@ -869,48 +942,59 @@ ++NOTICE: trigtest INSERT BEFORE ROW ++NOTICE: trigtest INSERT AFTER ROW + select * from trigtest; + i + --- ++ 1 ++ 2 + 3 + 4 + 5 + 6 + 7 +-(5 rows) ++(7 rows) - end; - $$; -+ERROR: at or near "i": syntax error: unimplemented: this syntax -+DETAIL: source SQL: -+declare -+ -+ argstr text; -+ relid text; -+ -+begin -+ -+ relid := TG_relid::regclass; -+ -+ -- plpgsql can't discover its trigger data in a hash like perl and python -+ -- can, or by a sort of reflection like tcl can, -+ -- so we have to hard code the names. -+ raise NOTICE 'TG_NAME: %', TG_name; -+ raise NOTICE 'TG_WHEN: %', TG_when; -+ raise NOTICE 'TG_LEVEL: %', TG_level; -+ raise NOTICE 'TG_OP: %', TG_op; -+ raise NOTICE 'TG_RELID::regclass: %', relid; -+ raise NOTICE 'TG_RELNAME: %', TG_relname; -+ raise NOTICE 'TG_TABLE_NAME: %', TG_table_name; -+ raise NOTICE 'TG_TABLE_SCHEMA: %', TG_table_schema; -+ raise NOTICE 'TG_NARGS: %', TG_nargs; -+ -+ argstr := '['; -+ for i in 0 .. TG_nargs - 1 loop -+ ^ -+HINT: You have attempted to use a feature that is not yet implemented. -+ -+Please check the public issue tracker to check whether this problem is -+already tracked. If you cannot find it there, please report the error -+with details by creating a new issue. -+ -+If you would rather not post publicly, please contact us directly -+using the support form. -+ -+We appreciate your feedback. -+ - CREATE TRIGGER show_trigger_data_trig - BEFORE INSERT OR UPDATE OR DELETE ON trigger_test - FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - insert into trigger_test values(1,'insert'); --NOTICE: TG_NAME: show_trigger_data_trig --NOTICE: TG_WHEN: BEFORE --NOTICE: TG_LEVEL: ROW --NOTICE: TG_OP: INSERT --NOTICE: TG_RELID::regclass: trigger_test --NOTICE: TG_RELNAME: trigger_test --NOTICE: TG_TABLE_NAME: trigger_test --NOTICE: TG_TABLE_SCHEMA: public --NOTICE: TG_NARGS: 2 + drop table trigtest2; + drop table trigtest; +@@ -882,7 +1672,7 @@ + NOTICE: TG_TABLE_NAME: trigger_test + NOTICE: TG_TABLE_SCHEMA: public + NOTICE: TG_NARGS: 2 -NOTICE: TG_ARGV: [23, skidoo] --NOTICE: NEW: (1,insert) ++NOTICE: TG_ARGV: + NOTICE: NEW: (1,insert) update trigger_test set v = 'update' where i = 1; --NOTICE: TG_NAME: show_trigger_data_trig --NOTICE: TG_WHEN: BEFORE --NOTICE: TG_LEVEL: ROW --NOTICE: TG_OP: UPDATE --NOTICE: TG_RELID::regclass: trigger_test --NOTICE: TG_RELNAME: trigger_test --NOTICE: TG_TABLE_NAME: trigger_test --NOTICE: TG_TABLE_SCHEMA: public --NOTICE: TG_NARGS: 2 + NOTICE: TG_NAME: show_trigger_data_trig +@@ -894,7 +1684,7 @@ + NOTICE: TG_TABLE_NAME: trigger_test + NOTICE: TG_TABLE_SCHEMA: public + NOTICE: TG_NARGS: 2 -NOTICE: TG_ARGV: [23, skidoo] --NOTICE: OLD: (1,insert) --NOTICE: NEW: (1,update) ++NOTICE: TG_ARGV: + NOTICE: OLD: (1,insert) + NOTICE: NEW: (1,update) delete from trigger_test; --NOTICE: TG_NAME: show_trigger_data_trig --NOTICE: TG_WHEN: BEFORE --NOTICE: TG_LEVEL: ROW --NOTICE: TG_OP: DELETE --NOTICE: TG_RELID::regclass: trigger_test --NOTICE: TG_RELNAME: trigger_test --NOTICE: TG_TABLE_NAME: trigger_test --NOTICE: TG_TABLE_SCHEMA: public --NOTICE: TG_NARGS: 2 +@@ -907,7 +1697,7 @@ + NOTICE: TG_TABLE_NAME: trigger_test + NOTICE: TG_TABLE_SCHEMA: public + NOTICE: TG_NARGS: 2 -NOTICE: TG_ARGV: [23, skidoo] --NOTICE: OLD: (1,update) ++NOTICE: TG_ARGV: + NOTICE: OLD: (1,update) DROP TRIGGER show_trigger_data_trig on trigger_test; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ DROP FUNCTION trigger_data(); -+ERROR: unknown function: trigger_data() - DROP TABLE trigger_test; - -- - -- Test use of row comparisons on OLD/NEW -@@ -929,18 +1013,15 @@ +@@ -929,18 +1719,16 @@ CREATE TRIGGER t BEFORE UPDATE ON trigger_test FOR EACH ROW EXECUTE PROCEDURE mytrigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ INSERT INTO trigger_test VALUES(1, 'foo', 'bar'); INSERT INTO trigger_test VALUES(2, 'baz', 'quux'); UPDATE trigger_test SET f3 = 'bar'; @@ -77659,7 +78185,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- the right way when considering nulls is CREATE OR REPLACE FUNCTION mytrigger() RETURNS trigger LANGUAGE plpgsql as $$ begin -@@ -952,14 +1033,8 @@ +@@ -952,14 +1740,8 @@ return new; end$$; UPDATE trigger_test SET f3 = 'bar'; @@ -77674,35 +78200,25 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la DROP TABLE trigger_test; DROP FUNCTION mytrigger(); -- Test snapshot management in serializable transactions involving triggers -@@ -973,6 +1048,17 @@ +@@ -973,6 +1755,9 @@ return new; end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.description = 'updated in trigger' -+^ -+-- -+source SQL: -+declare -+ rec record; -+begin -+ new.description = 'updated in trigger'; -+ ^ ++ERROR: unimplemented: RECORD type for PL/pgSQL variables is not yet supported ++HINT: You have attempted to use a feature that is not yet implemented. ++See: https://go.crdb.dev/issue-v/114874/_version_ CREATE TABLE serializable_update_tab ( id int, filler text, -@@ -980,6 +1066,9 @@ +@@ -980,6 +1765,7 @@ ); CREATE TRIGGER serializable_update_trig BEFORE UPDATE ON serializable_update_tab FOR EACH ROW EXECUTE PROCEDURE serializable_update_trig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: serializable_update_trig() INSERT INTO serializable_update_tab SELECT a, repeat('xyzxz', 100), 'new' FROM generate_series(1, 50) a; BEGIN; -@@ -987,9 +1076,9 @@ +@@ -987,9 +1773,9 @@ UPDATE serializable_update_tab SET description = 'no no', id = 1 WHERE id = 1; COMMIT; SELECT description FROM serializable_update_tab WHERE id = 1; @@ -77715,13 +78231,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) DROP TABLE serializable_update_tab; -@@ -1002,9 +1091,12 @@ +@@ -1002,9 +1788,10 @@ CREATE TRIGGER z_min_update BEFORE UPDATE ON min_updates_test FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: suppress_redundant_updates_trigger() \set QUIET false UPDATE min_updates_test SET f1 = f1; -UPDATE 0 @@ -77729,186 +78243,64 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la UPDATE min_updates_test SET f2 = f2 + 1; UPDATE 2 UPDATE min_updates_test SET f3 = 2 WHERE f3 is null; -@@ -1022,6 +1114,7 @@ - -- Test triggers on views - -- - CREATE VIEW main_view AS SELECT a, b FROM main_table; -+ERROR: column "b" does not exist - -- VIEW trigger function - CREATE OR REPLACE FUNCTION view_trigger() RETURNS trigger - LANGUAGE plpgsql AS $$ -@@ -1062,242 +1155,220 @@ - RETURN NULL; - end; - $$; -+ERROR: at or near "i": syntax error: unimplemented: this syntax -+DETAIL: source SQL: -+declare -+ argstr text := ''; -+begin -+ for i in 0 .. TG_nargs - 1 loop -+ ^ -+HINT: You have attempted to use a feature that is not yet implemented. -+ -+Please check the public issue tracker to check whether this problem is -+already tracked. If you cannot find it there, please report the error -+with details by creating a new issue. -+ -+If you would rather not post publicly, please contact us directly -+using the support form. -+ -+We appreciate your feedback. -+ - -- Before row triggers aren't allowed on views - CREATE TRIGGER invalid_trig BEFORE INSERT ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_ins_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig BEFORE UPDATE ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_upd_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig BEFORE DELETE ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_del_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- After row triggers aren't allowed on views - CREATE TRIGGER invalid_trig AFTER INSERT ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_ins_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig AFTER UPDATE ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_upd_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig AFTER DELETE ON main_view - FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_del_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have row-level BEFORE or AFTER triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- Truncate triggers aren't allowed on views - CREATE TRIGGER invalid_trig BEFORE TRUNCATE ON main_view - EXECUTE PROCEDURE trigger_func('before_tru_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have TRUNCATE triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig AFTER TRUNCATE ON main_view - EXECUTE PROCEDURE trigger_func('before_tru_row'); --ERROR: "main_view" is a view --DETAIL: Views cannot have TRUNCATE triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- INSTEAD OF triggers aren't allowed on tables - CREATE TRIGGER invalid_trig INSTEAD OF INSERT ON main_table - FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_ins'); --ERROR: "main_table" is a table --DETAIL: Tables cannot have INSTEAD OF triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig INSTEAD OF UPDATE ON main_table - FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_upd'); --ERROR: "main_table" is a table --DETAIL: Tables cannot have INSTEAD OF triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER invalid_trig INSTEAD OF DELETE ON main_table - FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_del'); --ERROR: "main_table" is a table --DETAIL: Tables cannot have INSTEAD OF triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- Don't support WHEN clauses with INSTEAD OF triggers - CREATE TRIGGER invalid_trig INSTEAD OF UPDATE ON main_view - FOR EACH ROW WHEN (OLD.a <> NEW.a) EXECUTE PROCEDURE view_trigger('instead_of_upd'); --ERROR: INSTEAD OF triggers cannot have WHEN conditions -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- Don't support column-level INSTEAD OF triggers - CREATE TRIGGER invalid_trig INSTEAD OF UPDATE OF a ON main_view - FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_upd'); --ERROR: INSTEAD OF triggers cannot have column lists -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- Don't support statement-level INSTEAD OF triggers - CREATE TRIGGER invalid_trig INSTEAD OF UPDATE ON main_view - EXECUTE PROCEDURE view_trigger('instead_of_upd'); --ERROR: INSTEAD OF triggers must be FOR EACH ROW -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -1125,179 +1912,124 @@ -- Valid INSTEAD OF triggers CREATE TRIGGER instead_of_insert_trig INSTEAD OF INSERT ON main_view FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_ins'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER instead_of_update_trig INSTEAD OF UPDATE ON main_view FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_upd'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER instead_of_delete_trig INSTEAD OF DELETE ON main_view FOR EACH ROW EXECUTE PROCEDURE view_trigger('instead_of_del'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- Valid BEFORE statement VIEW triggers CREATE TRIGGER before_ins_stmt_trig BEFORE INSERT ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('before_view_ins_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER before_upd_stmt_trig BEFORE UPDATE ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('before_view_upd_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER before_del_stmt_trig BEFORE DELETE ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('before_view_del_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- Valid AFTER statement VIEW triggers CREATE TRIGGER after_ins_stmt_trig AFTER INSERT ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('after_view_ins_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER after_upd_stmt_trig AFTER UPDATE ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('after_view_upd_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER after_del_stmt_trig AFTER DELETE ON main_view FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('after_view_del_stmt'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ \set QUIET false -- Insert into view using trigger INSERT INTO main_view VALUES (20, 30); @@ -77919,7 +78311,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT -NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt) -INSERT 0 1 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table INSERT INTO main_view VALUES (21, 31) RETURNING a, b; -NOTICE: main_view BEFORE INSERT STATEMENT (before_view_ins_stmt) -NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins) @@ -77933,7 +78325,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -(1 row) - -INSERT 0 1 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table -- Table trigger will prevent updates UPDATE main_view SET b = 31 WHERE a = 20; -NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt) @@ -77945,7 +78337,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT -NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt) -UPDATE 0 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b; -NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt) -NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd) @@ -77960,13 +78352,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -(0 rows) - -UPDATE 0 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table -- Remove table trigger to allow updates DROP TRIGGER before_upd_a_row_trig ON main_table; --DROP TRIGGER -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ + DROP TRIGGER UPDATE main_view SET b = 31 WHERE a = 20; -NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt) -NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd) @@ -77978,7 +78367,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT -NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt) -UPDATE 1 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b; -NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt) -NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd) @@ -77995,13 +78384,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -(1 row) - -UPDATE 1 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table -- Before and after stmt triggers should fire even when no rows are affected UPDATE main_view SET b = 0 WHERE false; -NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt) -NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt) -UPDATE 0 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table -- Delete from view using trigger DELETE FROM main_view WHERE a IN (20,21); -NOTICE: main_view BEFORE DELETE STATEMENT (before_view_del_stmt) @@ -78013,7 +78402,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: OLD: (21,32) -NOTICE: main_view AFTER DELETE STATEMENT (after_view_del_stmt) -DELETE 3 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table DELETE FROM main_view WHERE a = 31 RETURNING a, b; -NOTICE: main_view BEFORE DELETE STATEMENT (before_view_del_stmt) -NOTICE: main_view INSTEAD OF DELETE ROW (instead_of_del) @@ -78025,7 +78414,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -(1 row) - -DELETE 1 -+ERROR: relation "main_view" does not exist ++ERROR: "main_view" is not a table \set QUIET true -- Describe view should list triggers \d main_view @@ -78056,13 +78445,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + ^ -- Test dropping view triggers DROP TRIGGER instead_of_insert_trig ON main_view; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: "main_view" is not a table DROP TRIGGER instead_of_delete_trig ON main_view; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: "main_view" is not a table \d+ main_view - View "public.main_view" - Column | Type | Collation | Nullable | Default | Storage | Description @@ -78092,7 +78477,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +WHERE c.relname OPERATOR(pg_catalog.~) '^(main_view)$' COLLATE pg_catalog.default + ^ DROP VIEW main_view; -+ERROR: relation "main_view" does not exist -- -- Test triggers on a join view -- @@ -78107,7 +78491,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la INSERT INTO country_table (country_name, continent) VALUES ('Japan', 'Asia'), ('UK', 'Europe'), -@@ -1316,6 +1387,7 @@ +@@ -1316,6 +2048,7 @@ population bigint, country_id int references country_table ); @@ -78115,81 +78499,36 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la CREATE VIEW city_view AS SELECT city_id, city_name, population, country_name, continent FROM city_table ci -@@ -1346,8 +1418,29 @@ +@@ -1346,8 +2079,10 @@ RETURN NEW; end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.continent := NULL -+^ -+-- -+source SQL: -+declare -+ ctry_id int; -+begin -+ if NEW.country_name IS NOT NULL then -+ SELECT country_id, continent INTO ctry_id, NEW.continent -+ FROM country_table WHERE country_name = NEW.country_name; -+ if NOT FOUND then -+ raise exception 'No such country: "%"', NEW.country_name; -+ end if; -+ else -+ NEW.continent := NULL; -+ ^ ++ERROR: "NEW" is not a known variable CREATE TRIGGER city_insert_trig INSTEAD OF INSERT ON city_view FOR EACH ROW EXECUTE PROCEDURE city_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: city_insert() CREATE FUNCTION city_delete() RETURNS trigger LANGUAGE plpgsql AS $$ begin DELETE FROM city_table WHERE city_id = OLD.city_id; -@@ -1357,6 +1450,9 @@ +@@ -1357,6 +2092,10 @@ $$; CREATE TRIGGER city_delete_trig INSTEAD OF DELETE ON city_view FOR EACH ROW EXECUTE PROCEDURE city_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE FUNCTION city_update() RETURNS trigger LANGUAGE plpgsql AS $$ declare ctry_id int; -@@ -1383,102 +1479,70 @@ +@@ -1383,102 +2122,43 @@ RETURN NEW; end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.continent := OLD.continent -+^ -+-- -+source SQL: -+declare -+ ctry_id int; -+begin -+ if NEW.country_name IS DISTINCT FROM OLD.country_name then -+ SELECT country_id, continent INTO ctry_id, NEW.continent -+ FROM country_table WHERE country_name = NEW.country_name; -+ if NOT FOUND then -+ raise exception 'No such country: "%"', NEW.country_name; -+ end if; -+ -+ UPDATE city_table SET city_name = NEW.city_name, -+ population = NEW.population, -+ country_id = ctry_id -+ WHERE city_id = OLD.city_id; -+ else -+ UPDATE city_table SET city_name = NEW.city_name, -+ population = NEW.population -+ WHERE city_id = OLD.city_id; -+ NEW.continent := OLD.continent; -+ ^ ++ERROR: "NEW" is not a known variable CREATE TRIGGER city_update_trig INSTEAD OF UPDATE ON city_view FOR EACH ROW EXECUTE PROCEDURE city_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: city_update() \set QUIET false -- INSERT .. RETURNING INSERT INTO city_view(city_name) VALUES('Tokyo') RETURNING *; @@ -78301,7 +78640,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la \set QUIET true -- read-only view with WHERE clause CREATE VIEW european_city_view AS -@@ -1486,26 +1550,44 @@ +@@ -1486,26 +2166,87 @@ SELECT count(*) FROM european_city_view; count ------- @@ -78313,9 +78652,52 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la AS 'begin RETURN NULL; end'; CREATE TRIGGER no_op_trig INSTEAD OF INSERT OR UPDATE OR DELETE ON european_city_view FOR EACH ROW EXECUTE PROCEDURE no_op_trig_fn(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: internal error: building declarative schema change targets for CREATE TRIGGER: runtime error: invalid memory address or nil pointer dereference ++DETAIL: stack trace: ++pkg/sql/schemachanger/scerrors/errors.go:82: HandlePanicAndLogError() ++GOROOT/src/runtime/panic.go:770: gopanic() ++GOROOT/src/runtime/panic.go:261: panicmem() ++GOROOT/src/runtime/signal_unix.go:881: sigpanic() ++pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_trigger.go:39: CreateTrigger() ++GOROOT/src/reflect/value.go:596: call() ++GOROOT/src/reflect/value.go:380: Call() ++pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go:187: Process() ++pkg/sql/schemachanger/scbuild/build.go:102: Build() ++pkg/sql/schema_change_plan_node.go:79: SchemaChange() ++pkg/sql/opt_exec_factory.go:1946: ConstructCreateTrigger() ++bazel-out/k8-opt/bin/pkg/sql/opt/exec/explain/plan_gist_factory.og.go:1151: ConstructCreateTrigger() ++bazel-out/k8-opt/bin/pkg/sql/opt/exec/explain/explain_factory.og.go:2009: ConstructCreateTrigger() ++pkg/sql/opt/exec/execbuilder/statement.go:90: buildCreateTrigger() ++pkg/sql/opt/exec/execbuilder/relational.go:283: buildRelational() ++pkg/sql/opt/exec/execbuilder/builder.go:357: build() ++pkg/sql/opt/exec/execbuilder/builder.go:275: Build() ++pkg/sql/plan_opt.go:899: runExecBuilder() ++pkg/sql/plan_opt.go:332: makeOptimizerPlan() ++pkg/sql/conn_executor_exec.go:2305: makeExecPlan() ++pkg/sql/conn_executor_exec.go:1854: dispatchToExecutionEngine() ++pkg/sql/conn_executor_exec.go:1187: execStmtInOpenState() ++pkg/sql/conn_executor_exec.go:141: func1() ++pkg/sql/conn_executor_exec.go:3451: execWithProfiling() ++pkg/sql/conn_executor_exec.go:140: execStmt() ++pkg/sql/conn_executor.go:2348: func1() ++pkg/sql/conn_executor.go:2353: execCmd() ++pkg/sql/conn_executor.go:2270: run() ++pkg/sql/conn_executor.go:964: ServeConn() ++pkg/sql/pgwire/conn.go:251: processCommands() ++pkg/sql/pgwire/server.go:1196: func4() ++src/runtime/asm_amd64.s:1695: goexit() ++ ++HINT: You have encountered an unexpected error. ++ ++Please check the public issue tracker to check whether this problem is ++already tracked. If you cannot find it there, please report the error ++with details by creating a new issue. ++ ++If you would rather not post publicly, please contact us directly ++using the support form. ++ ++We appreciate your feedback. ++ \set QUIET false INSERT INTO european_city_view VALUES (0, 'x', 10000, 'y', 'z'); -INSERT 0 0 @@ -78350,7 +78732,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la CREATE RULE european_city_update_rule AS ON UPDATE TO european_city_view DO INSTEAD UPDATE city_view SET city_name = NEW.city_name, -@@ -1513,47 +1595,57 @@ +@@ -1513,47 +2254,57 @@ country_name = NEW.country_name WHERE city_id = OLD.city_id RETURNING NEW.*; @@ -78434,7 +78816,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- join UPDATE test UPDATE city_view v SET population = 599657 FROM city_table ci, country_table co -@@ -1561,26 +1653,14 @@ +@@ -1561,26 +2312,14 @@ AND v.city_id = ci.city_id AND v.country_name = co.country_name RETURNING co.country_id, v.country_name, v.city_id, v.city_name, v.population; @@ -78465,17 +78847,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la DROP TABLE country_table; -- Test pg_trigger_depth() create table depth_a (id int not null primary key); -@@ -1597,6 +1677,9 @@ +@@ -1597,6 +2336,7 @@ $$; create trigger depth_a_tr before insert on depth_a for each row execute procedure depth_a_tf(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: pg_trigger_depth() create function depth_b_tf() returns trigger language plpgsql as $$ begin -@@ -1614,8 +1697,24 @@ +@@ -1614,8 +2354,22 @@ return new; end; $$; @@ -78494,19 +78874,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + create trigger depth_b_tr before insert on depth_b for each row execute procedure depth_b_tf(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: depth_b_tf() create function depth_c_tf() returns trigger language plpgsql as $$ begin -@@ -1629,47 +1728,21 @@ +@@ -1629,47 +2383,19 @@ $$; create trigger depth_c_tr before insert on depth_c for each row execute procedure depth_c_tf(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: pg_trigger_depth() select pg_trigger_depth(); - pg_trigger_depth ------------------- @@ -78555,55 +78931,47 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop function depth_c_tf(); -- -- Test updates to rows during firing of BEFORE ROW triggers. -@@ -1697,8 +1770,21 @@ - return new; - end; +@@ -1699,6 +2425,10 @@ $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.val2 = new.val1 -+^ -+-- -+source SQL: -+begin -+ if old.val1 <> new.val1 then -+ new.val2 = new.val1; -+ ^ create trigger parent_upd_trig before update on parent for each row execute procedure parent_upd_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create function parent_del_func() returns trigger language plpgsql as $$ -@@ -1709,6 +1795,9 @@ +@@ -1709,6 +2439,10 @@ $$; create trigger parent_del_trig before delete on parent for each row execute procedure parent_del_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create function child_ins_func() returns trigger language plpgsql as $$ -@@ -1719,6 +1808,9 @@ +@@ -1719,6 +2453,10 @@ $$; create trigger child_ins_trig after insert on child for each row execute procedure child_ins_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create function child_del_func() returns trigger language plpgsql as $$ -@@ -1729,12 +1821,15 @@ +@@ -1729,12 +2467,16 @@ $$; create trigger child_del_trig after delete on child for each row execute procedure child_del_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ insert into parent values (1, 'a', 'a', 'a', 'a', 0); insert into child values (10, 1, 'b'); select * from parent; select * from child; @@ -78614,7 +78982,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) bid | aid | val1 -@@ -1743,12 +1838,10 @@ +@@ -1743,12 +2485,10 @@ (1 row) update parent set val1 = 'b' where aid = 1; -- should fail @@ -78628,7 +78996,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la (1 row) bid | aid | val1 -@@ -1757,13 +1850,10 @@ +@@ -1757,13 +2497,10 @@ (1 row) delete from parent where aid = 1; -- should fail @@ -78643,7 +79011,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la bid | aid | val1 -----+-----+------ -@@ -1792,10 +1882,12 @@ +@@ -1792,7 +2529,8 @@ bid | aid | val1 -----+-----+------ @@ -78653,31 +79021,29 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table parent, child; drop function parent_upd_func(); -+ERROR: unknown function: parent_upd_func() - drop function parent_del_func(); - drop function child_ins_func(); - drop function child_del_func(); -@@ -1820,6 +1912,9 @@ +@@ -1820,6 +2558,10 @@ $$; create trigger self_ref_trigger_ins_trig before insert on self_ref_trigger for each row execute procedure self_ref_trigger_ins_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create function self_ref_trigger_del_func() returns trigger language plpgsql as $$ -@@ -1833,6 +1928,9 @@ +@@ -1833,6 +2575,10 @@ $$; create trigger self_ref_trigger_del_trig before delete on self_ref_trigger for each row execute procedure self_ref_trigger_del_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ insert into self_ref_trigger values (1, null, 'root'); insert into self_ref_trigger values (2, 1, 'root child A'); insert into self_ref_trigger values (3, 1, 'root child B'); -@@ -1842,25 +1940,18 @@ +@@ -1842,25 +2588,18 @@ select * from self_ref_trigger; id | parent | data | nchildren ----+--------+--------------+----------- @@ -78709,7 +79075,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table self_ref_trigger; drop function self_ref_trigger_ins_func(); -@@ -1870,6 +1961,12 @@ +@@ -1870,6 +2609,12 @@ -- create table stmt_trig_on_empty_upd (a int); create table stmt_trig_on_empty_upd1 () inherits (stmt_trig_on_empty_upd); @@ -78722,19 +79088,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create function update_stmt_notice() returns trigger as $$ begin raise notice 'updating %', TG_TABLE_NAME; -@@ -1879,25 +1976,25 @@ - create trigger before_stmt_trigger - before update on stmt_trig_on_empty_upd - execute procedure update_stmt_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -1882,22 +2627,17 @@ create trigger before_stmt_trigger before update on stmt_trig_on_empty_upd1 execute procedure update_stmt_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "stmt_trig_on_empty_upd1" does not exist -- inherited no-op update update stmt_trig_on_empty_upd set a = a where false returning a+1 as aa; -NOTICE: updating stmt_trig_on_empty_upd @@ -78755,13 +79113,22 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop function update_stmt_notice(); -- -- Check that index creation (or DDL in general) is prohibited in a trigger -@@ -1913,19 +2010,16 @@ +@@ -1913,19 +2653,25 @@ end$$ language plpgsql; create trigger trigger_ddl_func before insert on trigger_ddl_table for each row execute procedure trigger_ddl_func(); -+ERROR: unimplemented: CREATE TRIGGER ++ERROR: unimplemented: ALTER TABLE usage inside a function definition +HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ ++Please check the public issue tracker to check whether this problem is ++already tracked. If you cannot find it there, please report the error ++with details by creating a new issue. ++ ++If you would rather not post publicly, please contact us directly ++using the support form. ++ ++We appreciate your feedback. ++ insert into trigger_ddl_table values (1, 42); -- fail -ERROR: cannot ALTER TABLE "trigger_ddl_table" because it is being used by active queries in this session -CONTEXT: SQL statement "alter table trigger_ddl_table add primary key (col1)" @@ -78778,40 +79145,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table trigger_ddl_table; drop function trigger_ddl_func(); -- -@@ -1951,8 +2045,26 @@ - return new; - end; +@@ -1953,6 +2699,7 @@ $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.key := new.key + 1 -+^ -+-- -+source SQL: -+begin -+ if (TG_OP = 'UPDATE') then -+ raise warning 'before update (old): %', old.*::text; -+ raise warning 'before update (new): %', new.*::text; -+ elsif (TG_OP = 'INSERT') then -+ raise warning 'before insert (new): %', new.*::text; -+ if new.key % 2 = 0 then -+ new.key := new.key + 1; -+ ^ create trigger upsert_before_trig before insert or update on upsert for each row execute procedure upsert_before_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches pattern: old.* create function upsert_after_func() returns trigger language plpgsql as $$ -@@ -1968,55 +2080,33 @@ +@@ -1968,52 +2715,27 @@ $$; create trigger upsert_after_trig after insert or update on upsert for each row execute procedure upsert_after_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches pattern: old.* insert into upsert values(1, 'black') on conflict (key) do update set color = 'updated ' || upsert.color; -WARNING: before insert (new): (1,black) -WARNING: after insert (new): (1,black) @@ -78871,23 +79217,62 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table upsert; drop function upsert_before_func(); -+ERROR: unknown function: upsert_before_func() - drop function upsert_after_func(); - -- - -- Verify that triggers with transition tables are not allowed on -@@ -2027,8 +2117,9 @@ +@@ -2027,8 +2749,52 @@ create function my_trigger_function() returns trigger as $$ begin end; $$ language plpgsql; create trigger my_trigger after update on my_view referencing old table as old_table for each statement execute procedure my_trigger_function(); -ERROR: "my_view" is a view -DETAIL: Triggers on views cannot have transition tables. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: internal error: building declarative schema change targets for CREATE TRIGGER: runtime error: invalid memory address or nil pointer dereference ++DETAIL: stack trace: ++pkg/sql/schemachanger/scerrors/errors.go:82: HandlePanicAndLogError() ++GOROOT/src/runtime/panic.go:770: gopanic() ++GOROOT/src/runtime/panic.go:261: panicmem() ++GOROOT/src/runtime/signal_unix.go:881: sigpanic() ++pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_trigger.go:39: CreateTrigger() ++GOROOT/src/reflect/value.go:596: call() ++GOROOT/src/reflect/value.go:380: Call() ++pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go:187: Process() ++pkg/sql/schemachanger/scbuild/build.go:102: Build() ++pkg/sql/schema_change_plan_node.go:79: SchemaChange() ++pkg/sql/opt_exec_factory.go:1946: ConstructCreateTrigger() ++bazel-out/k8-opt/bin/pkg/sql/opt/exec/explain/plan_gist_factory.og.go:1151: ConstructCreateTrigger() ++bazel-out/k8-opt/bin/pkg/sql/opt/exec/explain/explain_factory.og.go:2009: ConstructCreateTrigger() ++pkg/sql/opt/exec/execbuilder/statement.go:90: buildCreateTrigger() ++pkg/sql/opt/exec/execbuilder/relational.go:283: buildRelational() ++pkg/sql/opt/exec/execbuilder/builder.go:357: build() ++pkg/sql/opt/exec/execbuilder/builder.go:275: Build() ++pkg/sql/plan_opt.go:899: runExecBuilder() ++pkg/sql/plan_opt.go:332: makeOptimizerPlan() ++pkg/sql/conn_executor_exec.go:2305: makeExecPlan() ++pkg/sql/conn_executor_exec.go:1854: dispatchToExecutionEngine() ++pkg/sql/conn_executor_exec.go:1187: execStmtInOpenState() ++pkg/sql/conn_executor_exec.go:141: func1() ++pkg/sql/conn_executor_exec.go:3451: execWithProfiling() ++pkg/sql/conn_executor_exec.go:140: execStmt() ++pkg/sql/conn_executor.go:2348: func1() ++pkg/sql/conn_executor.go:2353: execCmd() ++pkg/sql/conn_executor.go:2270: run() ++pkg/sql/conn_executor.go:964: ServeConn() ++pkg/sql/pgwire/conn.go:251: processCommands() ++pkg/sql/pgwire/server.go:1196: func4() ++src/runtime/asm_amd64.s:1695: goexit() ++ ++HINT: You have encountered an unexpected error. ++ ++Please check the public issue tracker to check whether this problem is ++already tracked. If you cannot find it there, please report the error ++with details by creating a new issue. ++ ++If you would rather not post publicly, please contact us directly ++using the support form. ++ ++We appreciate your feedback. ++ drop function my_trigger_function(); drop view my_view; drop table my_table; -@@ -2036,67 +2127,109 @@ +@@ -2036,67 +2802,95 @@ -- Verify cases that are unsupported with partitioned tables -- create table parted_trig (a int) partition by list (a); @@ -78902,17 +79287,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la for each row execute procedure trigger_nothing(); -ERROR: "parted_trig" is a table -DETAIL: Tables cannot have INSTEAD OF triggers. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist create trigger failed after update on parted_trig referencing old table as old_table for each row execute procedure trigger_nothing(); -ERROR: "parted_trig" is a partitioned table -DETAIL: ROW triggers with transition tables are not supported on partitioned tables. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist drop table parted_trig; +ERROR: relation "parted_trig" does not exist -- @@ -78931,9 +79312,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + ^ +HINT: try \h CREATE TABLE create trigger trg1 after insert on trigpart for each row execute procedure trigger_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart" does not exist create table trigpart2 partition of trigpart for values from (1000) to (2000); +ERROR: at or near "partition": syntax error +DETAIL: source SQL: @@ -78987,21 +79366,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop trigger trg1 on trigpart1; -- fail -ERROR: cannot drop trigger trg1 on table trigpart1 because trigger trg1 on table trigpart requires it -HINT: You can drop trigger trg1 on table trigpart instead. -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart1" does not exist drop trigger trg1 on trigpart2; -- fail -ERROR: cannot drop trigger trg1 on table trigpart2 because trigger trg1 on table trigpart requires it -HINT: You can drop trigger trg1 on table trigpart instead. -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart2" does not exist drop trigger trg1 on trigpart3; -- fail -ERROR: cannot drop trigger trg1 on table trigpart3 because trigger trg1 on table trigpart requires it -HINT: You can drop trigger trg1 on table trigpart instead. -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart3" does not exist drop table trigpart2; -- ok, trigger should be gone in that partition +ERROR: relation "trigpart2" does not exist select tgrelid::regclass, tgname, tgfoid::regproc from pg_trigger @@ -79020,19 +79393,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +(0 rows) drop trigger trg1 on trigpart; -- ok, all gone -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart" does not exist select tgrelid::regclass, tgname, tgfoid::regproc from pg_trigger where tgrelid::regclass::text like 'trigpart%' order by tgrelid::regclass::text; tgrelid | tgname | tgfoid -@@ -2105,74 +2238,152 @@ +@@ -2105,74 +2899,140 @@ -- check detach behavior create trigger trg1 after insert on trigpart for each row execute procedure trigger_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart" does not exist \d trigpart3 - Table "public.trigpart3" - Column | Type | Collation | Nullable | Default @@ -79060,9 +79429,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE drop trigger trg1 on trigpart3; -- fail due to "does not exist" -ERROR: trigger "trg1" for table "trigpart3" does not exist -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart3" does not exist alter table trigpart detach partition trigpart4; +ERROR: at or near "detach": syntax error +DETAIL: source SQL: @@ -79071,9 +79438,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE drop trigger trg1 on trigpart41; -- fail due to "does not exist" -ERROR: trigger "trg1" for table "trigpart41" does not exist -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart41" does not exist drop table trigpart4; +ERROR: relation "trigpart4" does not exist alter table trigpart attach partition trigpart3 for values from (2000) to (3000); @@ -79110,9 +79475,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create table trigpart3 (like trigpart); +ERROR: relation "trigpart" does not exist create trigger trg1 after insert on trigpart3 for each row execute procedure trigger_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart3" does not exist \d trigpart3 - Table "public.trigpart3" - Column | Type | Collation | Nullable | Default @@ -79142,13 +79505,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +ERROR: relation "trigpart3" does not exist -- check display of unrelated triggers create trigger samename after delete on trigpart execute function trigger_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart" does not exist create trigger samename after delete on trigpart1 execute function trigger_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigpart1" does not exist \d trigpart1 - Table "public.trigpart1" - Column | Type | Collation | Nullable | Default @@ -79214,116 +79573,74 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function trigger_notice() returns trigger as $$ begin raise notice 'trigger % on % % % for %', TG_NAME, TG_TABLE_NAME, TG_WHEN, TG_OP, TG_LEVEL; -@@ -2185,133 +2396,219 @@ +@@ -2185,133 +3045,167 @@ -- insert/update/delete statement-level triggers on the parent create trigger trig_ins_before before insert on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_ins_after after insert on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_upd_before before update on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_upd_after after update on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_del_before before delete on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_del_after after delete on parted_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist -- insert/update/delete row-level triggers on the parent create trigger trig_ins_after_parent after insert on parted_stmt_trig for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_upd_after_parent after update on parted_stmt_trig for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist create trigger trig_del_after_parent after delete on parted_stmt_trig for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig" does not exist -- insert/update/delete row-level triggers on the first partition create trigger trig_ins_before_child before insert on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist create trigger trig_ins_after_child after insert on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist create trigger trig_upd_before_child before update on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist create trigger trig_upd_after_child after update on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist create trigger trig_del_before_child before delete on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist create trigger trig_del_after_child after delete on parted_stmt_trig1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_stmt_trig1" does not exist -- insert/update/delete statement-level triggers on the parent create trigger trig_ins_before_3 before insert on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist create trigger trig_ins_after_3 after insert on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist create trigger trig_upd_before_3 before update on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist create trigger trig_upd_after_3 after update on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist create trigger trig_del_before_3 before delete on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist create trigger trig_del_after_3 after delete on parted2_stmt_trig for each statement execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted2_stmt_trig" does not exist with ins (a) as ( insert into parted2_stmt_trig values (1), (2) returning a ) insert into parted_stmt_trig select a from ins returning tableoid::regclass, a; @@ -79439,25 +79756,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la + ^ +HINT: try \h CREATE TABLE create trigger zzz after insert on parted_trig for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist create trigger mmm after insert on parted_trig_1_1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig_1_1" does not exist create trigger aaa after insert on parted_trig_1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig_1" does not exist create trigger bbb after insert on parted_trig for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist create trigger qqq after insert on parted_trig_1_1 for each row execute procedure trigger_notice(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig_1_1" does not exist insert into parted_trig values (50), (1500); -NOTICE: trigger aaa on parted_trig_1_1 AFTER INSERT for ROW -NOTICE: trigger bbb on parted_trig_1_1 AFTER INSERT for ROW @@ -79485,13 +79792,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function trigger_notice() returns trigger as $$ declare arg1 text = TG_ARGV[0]; -@@ -2324,19 +2621,33 @@ +@@ -2324,19 +3218,31 @@ $$ language plpgsql; create trigger aaa after insert on parted_trig for each row execute procedure trigger_notice('quirky', 1); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist -- Verify propagation of trigger arguments to partitions attached after creating trigger create table parted_trig2 partition of parted_trig for values in (2); +ERROR: at or near "partition": syntax error @@ -79522,7 +79827,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function trigger_notice_ab() returns trigger as $$ begin raise notice 'trigger % on % % % for %: (a,b)=(%,%)', -@@ -2350,95 +2661,161 @@ +@@ -2350,42 +3256,76 @@ $$ language plpgsql; create table parted_irreg_ancestor (fd text, b text, fd2 int, fd3 int, a int) partition by range (b); @@ -79563,14 +79868,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE create trigger parted_trig after insert on parted_irreg for each row execute procedure trigger_notice_ab(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_irreg" does not exist create trigger parted_trig_odd after insert on parted_irreg for each row when (bark(new.b) AND new.a % 2 = 1) execute procedure trigger_notice_ab(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_irreg" does not exist -- we should hear barking for every insert, but parted_trig_odd only emits -- noise for odd values of a. parted_trig does it for all inserts. insert into parted_irreg values (1, 'aardvark'), (2, 'aanimals'); @@ -79613,25 +79914,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create function parted_trigfunc() returns trigger language plpgsql as $$ begin new.a = new.a + 1; - return new; +@@ -2393,14 +3333,14 @@ end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.a = new.a + 1 -+^ -+-- -+source SQL: -+begin -+ new.a = new.a + 1; -+ ^ insert into parted values (1, 1, 'uno uno v1'); -- works +ERROR: relation "parted" does not exist create trigger t before insert or update or delete on parted for each row execute function parted_trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted" does not exist insert into parted values (1, 1, 'uno uno v2'); -- fail -ERROR: moving row to another partition during a BEFORE FOR EACH ROW trigger is not supported -DETAIL: Before executing trigger "t", the row was to be in partition "public.parted_1_1". @@ -79643,18 +79933,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function parted_trigfunc() returns trigger language plpgsql as $$ begin new.b = new.b + 1; - return new; +@@ -2408,11 +3348,9 @@ end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.b = new.b + 1 -+^ -+-- -+source SQL: -+begin -+ new.b = new.b + 1; -+ ^ insert into parted values (1, 1, 'uno uno v4'); -- fail -ERROR: moving row to another partition during a BEFORE FOR EACH ROW trigger is not supported -DETAIL: Before executing trigger "t", the row was to be in partition "public.parted_1_1". @@ -79666,18 +79947,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function parted_trigfunc() returns trigger language plpgsql as $$ begin new.c = new.c || ' did '|| TG_OP; - return new; +@@ -2420,25 +3358,26 @@ end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.c = new.c || ' did '|| TG_OP -+^ -+-- -+source SQL: -+begin -+ new.c = new.c || ' did '|| TG_OP; -+ ^ insert into parted values (1, 1, 'uno uno'); -- works +ERROR: relation "parted" does not exist update parted set c = c || ' v6'; -- works @@ -79713,24 +79985,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- both trigger and update change the partition create or replace function parted_trigfunc2() returns trigger language plpgsql as $$ begin -@@ -2446,380 +2823,703 @@ - return new; - end; +@@ -2448,27 +3387,35 @@ $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.a = new.a + 1 -+^ -+-- -+source SQL: -+begin -+ new.a = new.a + 1; -+ ^ create trigger t2 before update on parted for each row execute function parted_trigfunc2(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted" does not exist truncate table parted; +ERROR: relation "parted" does not exist insert into parted values (1, 1, 'uno uno v6'); @@ -79772,18 +80031,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace function parted_trigfunc() returns trigger language plpgsql as $$ begin new.a = new.a + new.b; - return new; +@@ -2476,350 +3423,626 @@ end; $$; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.a = new.a + new.b -+^ -+-- -+source SQL: -+begin -+ new.a = new.a + new.b; -+ ^ create table parted_1 partition of parted for values in (1, 2); +ERROR: at or near "partition": syntax error +DETAIL: source SQL: @@ -79798,9 +80048,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h CREATE TABLE create trigger t before insert or update on parted for each row execute function parted_trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted" does not exist insert into parted values (0, 1, 'zero win'); +ERROR: relation "parted" does not exist insert into parted values (1, 1, 'one fail'); @@ -79821,7 +80069,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table parted; +ERROR: relation "parted" does not exist drop function parted_trigfunc(); -+ERROR: unknown function: parted_trigfunc() -- -- Constraint triggers and partitioned tables create table parted_constr_ancestor (a int, b text) @@ -79952,9 +80199,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE create trigger parted_trigger after update on parted_trigger for each row when (new.a % 2 = 1 and length(old.b) >= 2) execute procedure trigger_notice_ab(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trigger" does not exist create table parted_trigger_3 (b text, a int) partition by range (length(b)); +ERROR: at or near "(": syntax error +DETAIL: source SQL: @@ -80104,9 +80349,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE create trigger parted_trigger after update of b on parted_trigger for each row execute procedure trigger_notice_ab(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trigger" does not exist create table parted_trigger_3 (b text, a int) partition by range (length(b)); +ERROR: at or near "(": syntax error +DETAIL: source SQL: @@ -80215,14 +80458,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la as $$ begin return null; end $$; create trigger tg after insert on parent for each row execute function trig_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ create trigger tg after insert on child1 for each row execute function trig_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist alter table parent disable trigger tg; +ERROR: at or near "disable": syntax error +DETAIL: source SQL: @@ -80271,14 +80509,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h CREATE TABLE create trigger tg after insert on parent for each row execute procedure trig_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "tg" for relation "parent" already exists create trigger tg_stmt after insert on parent for statement execute procedure trig_nothing(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ select tgrelid::regclass, tgname, tgenabled from pg_trigger where tgrelid in ('parent'::regclass, 'child1'::regclass) order by tgrelid::regclass::text, tgname; @@ -80433,9 +80666,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la CREATE OR REPLACE FUNCTION tgf() RETURNS trigger LANGUAGE plpgsql AS $$ begin raise exception 'except'; end $$; CREATE TRIGGER tg AFTER INSERT ON trgfire FOR EACH ROW EXECUTE FUNCTION tgf(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trgfire" does not exist INSERT INTO trgfire VALUES (1); -ERROR: except -CONTEXT: PL/pgSQL function tgf() line 1 at RAISE @@ -80549,7 +80780,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la DROP FUNCTION tgf(); -- -- Test the interaction between transition tables and both kinds of -@@ -2862,120 +3562,196 @@ +@@ -2862,120 +4085,156 @@ -- -- set up a partition hierarchy with some different TupleDescriptors create table parent (a text, b int) partition by list (a); @@ -80585,75 +80816,51 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger parent_insert_trig after insert on parent referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger parent_update_trig after update on parent referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger parent_delete_trig after delete on parent referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child1_insert_trig after insert on child1 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child1_update_trig after update on child1 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child1_delete_trig after delete on child1 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child2_insert_trig after insert on child2 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger child2_update_trig after update on child2 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child2_delete_trig after delete on child2 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child3_insert_trig after insert on child3 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger child3_update_trig after update on child3 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child3_delete_trig after delete on child3 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist SELECT trigger_name, event_manipulation, event_object_schema, event_object_table, action_order, action_condition, action_orientation, action_timing, action_reference_old_table, action_reference_new_table @@ -80729,37 +80936,21 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +AAA 42 +^ drop trigger child1_update_trig on child1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist drop trigger child1_delete_trig on child1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist drop trigger child2_insert_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_insert_trig" of relation "child2" does not exist drop trigger child2_update_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_update_trig" of relation "child2" does not exist drop trigger child2_delete_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_delete_trig" of relation "child2" does not exist drop trigger child3_insert_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_insert_trig" of relation "child3" does not exist drop trigger child3_update_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_update_trig" of relation "child3" does not exist drop trigger child3_delete_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_delete_trig" of relation "child3" does not exist delete from parent; -NOTICE: trigger = parent_delete_trig, old table = (AAA,42), (BBB,42), (CCC,42) -- copy into parent sees tuples collected from children even if there @@ -80775,7 +80966,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- insert into parent with a before trigger on a child tuple before -- insertion, and we capture the newly modified row in parent format create or replace function intercept_insert() returns trigger language plpgsql as -@@ -2985,41 +3761,90 @@ +@@ -2985,41 +4244,82 @@ return new; end; $$; @@ -80786,9 +80977,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger intercept_insert_child3 before insert on child3 for each row execute procedure intercept_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: intercept_insert() -- insert, parent trigger sees post-modification parent-format tuple insert into parent values ('AAA', 42), ('BBB', 42), ('CCC', 66); -NOTICE: trigger = parent_insert_trig, new table = (AAA,42), (BBB,42), (CCC,1066) @@ -80830,9 +81019,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la after insert on child referencing new table as new_table for each row execute procedure dump_insert(); -ERROR: ROW triggers with transition tables are not supported on partitions -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist -- detaching it first works alter table parent detach partition child; +ERROR: at or near "detach": syntax error @@ -80843,9 +81030,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger child_row_trig after insert on child referencing new table as new_table for each row execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist -- but now we're not allowed to reattach it alter table parent attach partition child for values in ('AAA'); -ERROR: trigger "child_row_trig" prevents table "child" from becoming a partition @@ -80857,9 +81042,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE -- drop the trigger, and now we're allowed to attach it again drop trigger child_row_trig on child; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist alter table parent attach partition child for values in ('AAA'); +ERROR: at or near "attach": syntax error +DETAIL: source SQL: @@ -80871,7 +81054,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- -- Verify behavior of statement triggers on (non-partition) -- inheritance hierarchy with transition tables; similar to the -@@ -3028,123 +3853,244 @@ +@@ -3028,123 +4328,198 @@ -- -- set up inheritance hierarchy with different TupleDescriptors create table parent (a text, b int); @@ -80904,75 +81087,51 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger parent_insert_trig after insert on parent referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger parent_update_trig after update on parent referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger parent_delete_trig after delete on parent referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child1_insert_trig after insert on child1 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child1_update_trig after update on child1 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child1_delete_trig after delete on child1 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist create trigger child2_insert_trig after insert on child2 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger child2_update_trig after update on child2 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child2_delete_trig after delete on child2 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child3_insert_trig after insert on child3 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger child3_update_trig after update on child3 referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger child3_delete_trig after delete on child3 referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist -- insert directly into children sees respective child-format tuples insert into child1 values ('AAA', 42); -NOTICE: trigger = child1_insert_trig, new table = (AAA,42) @@ -81039,37 +81198,21 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +DDD 42 +^ drop trigger child1_update_trig on child1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist drop trigger child1_delete_trig on child1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child1" does not exist drop trigger child2_insert_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_insert_trig" of relation "child2" does not exist drop trigger child2_update_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_update_trig" of relation "child2" does not exist drop trigger child2_delete_trig on child2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child2_delete_trig" of relation "child2" does not exist drop trigger child3_insert_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_insert_trig" of relation "child3" does not exist drop trigger child3_update_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_update_trig" of relation "child3" does not exist drop trigger child3_delete_trig on child3; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "child3_delete_trig" of relation "child3" does not exist delete from parent; -NOTICE: trigger = parent_delete_trig, old table = (AAA,42), (BBB,42), (CCC,42), (DDD,42) drop table child1, child2, child3, parent; @@ -81092,9 +81235,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la after insert on child referencing new table as new_table for each row execute procedure dump_insert(); -ERROR: ROW triggers with transition tables are not supported on inheritance children -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist -- disinheriting it first works alter table child no inherit parent; +ERROR: at or near "inherit": syntax error @@ -81105,9 +81246,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger child_row_trig after insert on child referencing new table as new_table for each row execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist -- but now we're not allowed to make it inherit anymore alter table child inherit parent; -ERROR: trigger "child_row_trig" prevents table "child" from becoming an inheritance child @@ -81119,9 +81258,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER TABLE -- drop the trigger, and now we're allowed to make it inherit again drop trigger child_row_trig on child; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist alter table child inherit parent; +ERROR: at or near "inherit": syntax error +DETAIL: source SQL: @@ -81133,19 +81270,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- -- Verify behavior of queries with wCTEs, where multiple transition -- tuplestores can be active at the same time because there are -@@ -3156,29 +4102,32 @@ +@@ -3156,29 +4531,28 @@ create trigger table1_trig after insert on table1 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger table2_trig after insert on table2 referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist with wcte as (insert into table1 values (42)) insert into table2 values ('hello world'); -NOTICE: trigger = table2_trig, new table = ("hello world") @@ -81179,19 +81312,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table table1; drop table table2; -@@ -3190,60 +4139,89 @@ +@@ -3190,60 +4564,81 @@ create trigger my_table_insert_trig after insert on my_table referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger my_table_update_trig after update on my_table referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist -- inserts only insert into my_table values (1, 'AAA'), (2, 'BBB') on conflict (a) do @@ -81246,15 +81375,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create trigger iocdu_tt_parted_insert_trig after insert on iocdu_tt_parted referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "iocdu_tt_parted" does not exist create trigger iocdu_tt_parted_update_trig after update on iocdu_tt_parted referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "iocdu_tt_parted" does not exist -- inserts only insert into iocdu_tt_parted values (1, 'AAA'), (2, 'BBB') on conflict (a) do @@ -81281,57 +81406,23 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- -- Verify that you can't create a trigger with transition tables for -- more than one event. -@@ -3251,7 +4229,9 @@ - create trigger my_table_multievent_trig - after insert or update on my_table referencing new table as new_table - for each statement execute procedure dump_insert(); --ERROR: transition tables cannot be specified for triggers with more than one event -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - -- - -- Verify that you can't create a trigger with transition tables with - -- a column list. -@@ -3259,7 +4239,9 @@ - create trigger my_table_col_update_trig - after update of b on my_table referencing new table as new_table - for each statement execute procedure dump_insert(); --ERROR: transition tables cannot be specified for triggers with column lists -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - drop table my_table; - -- - -- Test firing of triggers with transition tables by foreign key cascades -@@ -3271,15 +4253,27 @@ - create trigger trig_table_before_trig - before insert or update or delete on trig_table - for each statement execute procedure trigger_func('trig_table'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -3274,12 +4669,15 @@ create trigger trig_table_insert_trig after insert on trig_table referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger trig_table_update_trig after update on trig_table referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger trig_table_delete_trig after delete on trig_table referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist insert into refd_table values (1, 'one'), (2, 'two'), -@@ -3291,25 +4285,19 @@ +@@ -3291,25 +4689,19 @@ (2, 'two b'), (3, 'three a'), (3, 'three b'); @@ -81359,25 +81450,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la select * from trig_table; a | b ---+--------- -@@ -3326,27 +4314,30 @@ - create trigger self_ref_before_trig - before delete on self_ref - for each statement execute procedure trigger_func('self_ref'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -3329,24 +4721,18 @@ create trigger self_ref_r_trig after delete on self_ref referencing old table as old_table for each row execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger self_ref_s_trig after delete on self_ref referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist insert into self_ref values (1, null), (2, 1), (3, 2); delete from self_ref where a = 1; -NOTICE: trigger_func(self_ref) called: action = DELETE, when = BEFORE, level = STATEMENT @@ -81389,9 +81470,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -NOTICE: trigger = self_ref_s_trig, old table = (3,2) -- without AR trigger, cascaded deletes all end up in one transition table drop trigger self_ref_r_trig on self_ref; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "self_ref_r_trig" of relation "self_ref" does not exist insert into self_ref values (1, null), (2, 1), (3, 2), (4, 3); delete from self_ref where a = 1; -NOTICE: trigger_func(self_ref) called: action = DELETE, when = BEFORE, level = STATEMENT @@ -81399,29 +81478,23 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table self_ref; -- -- test transition tables with MERGE -@@ -3355,12 +4346,21 @@ +@@ -3355,12 +4741,15 @@ create trigger merge_target_table_insert_trig after insert on merge_target_table referencing new table as new_table for each statement execute procedure dump_insert(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist create trigger merge_target_table_update_trig after update on merge_target_table referencing old table as old_table new table as new_table for each statement execute procedure dump_update(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create trigger merge_target_table_delete_trig after delete on merge_target_table referencing old table as old_table for each statement execute procedure dump_delete(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist create table merge_source_table (a int, b text); insert into merge_source_table values (1, 'initial1'), (2, 'initial2'), -@@ -3370,7 +4370,10 @@ +@@ -3370,7 +4759,10 @@ on t.a = s.a when not matched then insert values (a, b); @@ -81433,7 +81506,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la merge into merge_target_table t using merge_source_table s on t.a = s.a -@@ -3380,9 +4383,10 @@ +@@ -3380,9 +4772,10 @@ delete when not matched then insert values (a, b); @@ -81447,7 +81520,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la merge into merge_target_table t using merge_source_table s on t.a = s.a -@@ -3392,9 +4396,10 @@ +@@ -3392,9 +4785,10 @@ delete when not matched then insert values (a, b); @@ -81461,30 +81534,16 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table merge_source_table, merge_target_table; -- cleanup drop function dump_insert(); -@@ -3417,92 +4422,186 @@ - create trigger my_trig - after insert on my_table - for each row execute procedure funcA(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - create trigger my_trig - before insert on my_table - for each row execute procedure funcB(); -- should fail --ERROR: trigger "my_trig" for relation "my_table" already exists -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - insert into my_table values (1); --NOTICE: hello from funcA +@@ -3426,83 +4820,156 @@ create or replace trigger my_trig before insert on my_table for each row execute procedure funcB(); -- OK -+ERROR: unimplemented: CREATE TRIGGER ++ERROR: unimplemented: CREATE OR REPLACE TRIGGER is not supported +HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++See: https://go.crdb.dev/issue-v/128422/_version_ insert into my_table values (2); -- this insert should become a no-op -NOTICE: hello from funcB ++NOTICE: hello from funcA table my_table; id ---- @@ -81531,18 +81590,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace trigger my_trig after insert on parted_trig for each row execute procedure funcA(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcA +ERROR: relation "parted_trig" does not exist create or replace trigger my_trig after insert on parted_trig for each row execute procedure funcB(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcB +ERROR: relation "parted_trig" does not exist @@ -81550,9 +81605,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la create or replace trigger my_trig after insert on parted_trig for each row execute procedure funcA(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcA +ERROR: relation "parted_trig" does not exist @@ -81560,25 +81613,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la after insert on parted_trig_1 for each row execute procedure funcB(); -- should fail -ERROR: trigger "my_trig" for relation "parted_trig_1" is an internal or a child trigger -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig_1" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcA +ERROR: relation "parted_trig" does not exist drop trigger my_trig on parted_trig; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); +ERROR: relation "parted_trig" does not exist -- test that user trigger can be overwritten by one defined at upper level create trigger my_trig after insert on parted_trig_1 for each row execute procedure funcA(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig_1" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcA +ERROR: relation "parted_trig" does not exist @@ -81586,18 +81633,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la after insert on parted_trig for each row execute procedure funcB(); -- should fail -ERROR: trigger "my_trig" for relation "parted_trig_1" already exists -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcA +ERROR: relation "parted_trig" does not exist create or replace trigger my_trig after insert on parted_trig for each row execute procedure funcB(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "parted_trig" does not exist insert into parted_trig (a) values (50); -NOTICE: hello from funcB +ERROR: relation "parted_trig" does not exist @@ -81617,9 +81660,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la $$ begin end; $$; create trigger aft_row after insert or update on trigger_parted for each row execute function trigger_parted_trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "trigger_parted" does not exist create table trigger_parted_p1 partition of trigger_parted for values in (1) partition by list (a); +ERROR: at or near "partition": syntax error @@ -81661,40 +81702,34 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la -- verify transition table conversion slot's lifetime -- https://postgr.es/m/39a71864-b120-5a5c-8cc5-c632b6f16761@amazon.com create table convslot_test_parent (col1 text primary key); -@@ -3537,8 +4636,10 @@ +@@ -3537,8 +5004,8 @@ create trigger but_trigger after update on convslot_test_child referencing new table as new_table for each statement execute function convslot_trig2(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_table" does not exist update convslot_test_parent set col1 = col1 || '1'; -NOTICE: trigger = but_trigger, new table = (11,tutu), (31,tutu) create function convslot_trig3() returns trigger language plpgsql -@@ -3553,14 +4654,17 @@ +@@ -3553,14 +5020,13 @@ create trigger but_trigger2 after update on convslot_test_child referencing old table as old_table new table as new_table for each statement execute function convslot_trig3(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist update convslot_test_parent set col1 = col1 || '1'; -NOTICE: trigger = but_trigger, new table = (111,tutu), (311,tutu) -NOTICE: trigger = but_trigger2, old_table = (11,tutu), (31,tutu), new table = (111,tutu), (311,tutu) create trigger bdt_trigger after delete on convslot_test_child referencing old table as old_table for each statement execute function convslot_trig1(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "old_table" does not exist delete from convslot_test_parent; -NOTICE: trigger = bdt_trigger, old_table = (111,tutu), (311,tutu) drop table convslot_test_child, convslot_test_parent; drop function convslot_trig1(); drop function convslot_trig2(); -@@ -3569,98 +4673,167 @@ +@@ -3569,98 +5035,153 @@ -- we don't see any ill effects unless trigger tuple requires mapping create table convslot_test_parent (id int primary key, val int) partition by range (id); @@ -81719,9 +81754,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la after update on convslot_test_parent referencing old table as old_rows new table as new_rows for each statement execute procedure convslot_trig4(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "convslot_test_parent" does not exist insert into convslot_test_parent (id, val) values (1, 2); +ERROR: relation "convslot_test_parent" does not exist begin; @@ -81766,9 +81799,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la language plpgsql; create trigger a after insert on grandparent for each row execute procedure f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "grandparent" does not exist alter trigger a on grandparent rename to b; +ERROR: at or near "trigger": syntax error +DETAIL: source SQL: @@ -81807,9 +81838,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER create trigger c after insert on middle for each row execute procedure f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "middle" does not exist alter trigger b on grandparent rename to c; -ERROR: trigger "c" for relation "middle" already exists +ERROR: at or near "trigger": syntax error @@ -81819,13 +81848,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +HINT: try \h ALTER -- Rename cascading does not affect statement triggers create trigger p after insert on grandparent for each statement execute function f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "grandparent" does not exist create trigger p after insert on middle for each statement execute function f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "middle" does not exist alter trigger p on grandparent rename to q; +ERROR: at or near "trigger": syntax error +DETAIL: source SQL: @@ -81864,14 +81889,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la +See: https://go.crdb.dev/issue-v/22456/_version_ create trigger parenttrig after insert on parent for each row execute procedure f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ create trigger parenttrig after insert on child for each row execute procedure f(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "child" does not exist alter trigger parenttrig on parent rename to anothertrig; +ERROR: at or near "trigger": syntax error +DETAIL: source SQL: @@ -81899,6 +81919,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/triggers.out --la drop table parent, child; +ERROR: relation "child" does not exist drop function f(); ++ERROR: cannot drop function "f" because other objects ([root.public.parent]) still depend on it diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/random.out --label=/mnt/data1/postgres/src/test/regress/results/random.out /mnt/data1/postgres/src/test/regress/expected/random.out /mnt/data1/postgres/src/test/regress/results/random.out --- /mnt/data1/postgres/src/test/regress/expected/random.out +++ /mnt/data1/postgres/src/test/regress/results/random.out @@ -87282,11 +87303,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/select_into.out - -- -- SELECT INTO and INSERT permission, if owner is not allowed to insert. -- -@@ -18,87 +30,170 @@ - CREATE USER regress_selinto_user; - ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user +@@ -20,85 +32,166 @@ REVOKE INSERT ON TABLES FROM regress_selinto_user; -+ERROR: must be a member of regress_selinto_user GRANT ALL ON SCHEMA selinto_schema TO public; SET SESSION AUTHORIZATION regress_selinto_user; +ERROR: at or near "regress_selinto_user": syntax error: unimplemented: this syntax @@ -87402,7 +87420,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/select_into.out - +HINT: try \h RESET ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user GRANT INSERT ON TABLES TO regress_selinto_user; -+ERROR: must be a member of regress_selinto_user SET SESSION AUTHORIZATION regress_selinto_user; +ERROR: at or near "regress_selinto_user": syntax error: unimplemented: this syntax +DETAIL: source SQL: @@ -87489,7 +87506,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/select_into.out - SELECT * FROM ctas_nodata; ii | jj ----+---- -@@ -106,26 +201,19 @@ +@@ -106,26 +199,19 @@ (1 row) SELECT * FROM ctas_nodata_2; @@ -87522,7 +87539,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/select_into.out - -- -- CREATE TABLE AS/SELECT INTO as last command in a SQL function -- have been known to cause problems -@@ -134,22 +222,22 @@ +@@ -134,22 +220,22 @@ AS $$ CREATE TABLE created_table AS SELECT * FROM int8_tbl; $$ LANGUAGE SQL; @@ -87559,7 +87576,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/select_into.out - -- Try EXPLAIN ANALYZE SELECT INTO and EXPLAIN ANALYZE CREATE TABLE AS -- WITH NO DATA, but hide the outputs since they won't be stable. DO $$ -@@ -157,66 +245,122 @@ +@@ -157,66 +243,122 @@ EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl'; EXECUTE 'EXPLAIN ANALYZE CREATE TABLE easi2 AS SELECT * FROM int8_tbl WITH NO DATA'; END$$; @@ -96771,13 +96788,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe CREATE FUNCTION trans_updatetrigfunc() RETURNS trigger LANGUAGE plpgsql AS $$ begin -@@ -492,44 +479,43 @@ +@@ -492,44 +479,33 @@ CREATE TRIGGER trans_updatetrig AFTER UPDATE ON range_parted REFERENCING OLD TABLE AS old_table NEW TABLE AS new_table FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end ) WHERE a = 'b' and b > 10 and c >= 96; -NOTICE: trigger = trans_updatetrig, old table = (b,12,96,1,), (b,13,97,2,), (b,15,105,16,), (b,17,105,19,), new table = (b,12,110,1,), (b,13,98,2,), (b,15,106,16,), (b,17,106,19,) +ERROR: relation "range_parted" does not exist @@ -96802,15 +96817,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe CREATE TRIGGER trans_deletetrig AFTER DELETE ON range_parted REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist CREATE TRIGGER trans_inserttrig AFTER INSERT ON range_parted REFERENCING NEW TABLE AS new_table FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96; -NOTICE: trigger = trans_updatetrig, old table = (b,12,96,1,), (b,13,97,2,), (b,15,105,16,), (b,17,105,19,), new table = (b,12,146,1,), (b,13,147,2,), (b,15,155,16,), (b,17,155,19,) +ERROR: relation "range_parted" does not exist @@ -96827,44 +96838,26 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe - +ERROR: relation "range_parted" does not exist DROP TRIGGER trans_deletetrig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist DROP TRIGGER trans_inserttrig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist -- Don't drop trans_updatetrig yet. It is required below. -- Test with transition tuple conversion happening for rows moved into the -- new partition. This requires a trigger that references transition table -@@ -543,139 +529,295 @@ - NEW.b = NEW.b + 1; - return NEW; +@@ -545,74 +521,92 @@ END $$ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.b = NEW.b + 1 -+^ -+-- -+source SQL: -+BEGIN -+ NEW.b = NEW.b + 1; -+ ^ CREATE TRIGGER trig_c1_100 BEFORE UPDATE OR INSERT ON part_c_1_100 FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE TRIGGER trig_d1_15 BEFORE UPDATE OR INSERT ON part_d_1_15 FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist CREATE TRIGGER trig_d15_20 BEFORE UPDATE OR INSERT ON part_d_15_20 FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist :init_range_parted; +ERROR: relation "range_parted" does not exist +ERROR: relation "range_parted" does not exist @@ -96923,23 +96916,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe - +ERROR: relation "range_parted" does not exist DROP TRIGGER trans_updatetrig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist DROP TRIGGER trig_c1_100 ON part_c_1_100; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "trig_c1_100" of relation "part_c_1_100" does not exist DROP TRIGGER trig_d1_15 ON part_d_1_15; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist DROP TRIGGER trig_d15_20 ON part_d_15_20; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist DROP FUNCTION func_parted_mod_b(); -+ERROR: unknown function: func_parted_mod_b() -- RLS policies with update-row-movement ----------------------------------------- ALTER TABLE range_parted ENABLE ROW LEVEL SECURITY; @@ -96987,23 +96971,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe -- Create a trigger on part_d_1_15 CREATE FUNCTION func_d_1_15() RETURNS trigger AS $$ BEGIN - NEW.c = NEW.c + 1; -- Make even numbers odd, or vice versa - return NEW; +@@ -621,61 +615,164 @@ END $$ LANGUAGE plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.c = NEW.c + 1 -+^ -+-- -+source SQL: -+BEGIN -+ NEW.c = NEW.c + 1; -- Make even numbers odd, or vice versa -+ ^ CREATE TRIGGER trig_d_1_15 BEFORE INSERT ON part_d_1_15 FOR EACH ROW EXECUTE PROCEDURE func_d_1_15(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist :init_range_parted; +ERROR: relation "range_parted" does not exist +ERROR: relation "range_parted" does not exist @@ -97049,11 +97021,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe + ^ +HINT: try \h RESET DROP TRIGGER trig_d_1_15 ON part_d_1_15; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist DROP FUNCTION func_d_1_15(); -+ERROR: unknown function: func_d_1_15() -- Policy expression contains SubPlan RESET SESSION AUTHORIZATION; +ERROR: at or near "authorization": syntax error @@ -97170,71 +97139,41 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe CREATE FUNCTION trigfunc() returns trigger language plpgsql as $$ begin -@@ -687,265 +829,345 @@ +@@ -687,10 +784,13 @@ -- Triggers on root partition CREATE TRIGGER parent_delete_trig AFTER DELETE ON range_parted for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist CREATE TRIGGER parent_update_trig AFTER UPDATE ON range_parted for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist CREATE TRIGGER parent_insert_trig AFTER INSERT ON range_parted for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist -- Triggers on leaf partition part_c_1_100 CREATE TRIGGER c1_delete_trig AFTER DELETE ON part_c_1_100 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER c1_update_trig - AFTER UPDATE ON part_c_1_100 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER c1_insert_trig - AFTER INSERT ON part_c_1_100 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -701,221 +801,242 @@ -- Triggers on leaf partition part_d_1_15 CREATE TRIGGER d1_delete_trig AFTER DELETE ON part_d_1_15 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist CREATE TRIGGER d1_update_trig AFTER UPDATE ON part_d_1_15 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist CREATE TRIGGER d1_insert_trig AFTER INSERT ON part_d_1_15 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist -- Triggers on leaf partition part_d_15_20 CREATE TRIGGER d15_delete_trig AFTER DELETE ON part_d_15_20 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist CREATE TRIGGER d15_update_trig AFTER UPDATE ON part_d_15_20 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist CREATE TRIGGER d15_insert_trig AFTER INSERT ON part_d_15_20 for each statement execute procedure trigfunc(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist -- Move all rows from part_c_100_200 to part_c_1_100. None of the delete or -- insert statement triggers should be fired. UPDATE range_parted set c = c - 50 WHERE c > 97; @@ -97253,53 +97192,26 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe - +ERROR: relation "range_parted" does not exist DROP TRIGGER parent_delete_trig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist DROP TRIGGER parent_update_trig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist DROP TRIGGER parent_insert_trig ON range_parted; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "range_parted" does not exist DROP TRIGGER c1_delete_trig ON part_c_1_100; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ DROP TRIGGER c1_update_trig ON part_c_1_100; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ DROP TRIGGER c1_insert_trig ON part_c_1_100; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ DROP TRIGGER d1_delete_trig ON part_d_1_15; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist DROP TRIGGER d1_update_trig ON part_d_1_15; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist DROP TRIGGER d1_insert_trig ON part_d_1_15; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_1_15" does not exist DROP TRIGGER d15_delete_trig ON part_d_15_20; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist DROP TRIGGER d15_update_trig ON part_d_15_20; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist DROP TRIGGER d15_insert_trig ON part_d_15_20; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "part_d_15_20" does not exist -- Creating default partition for range :init_range_parted; +ERROR: relation "range_parted" does not exist @@ -97587,23 +97499,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe -- Test the case where BR UPDATE triggers change the partition key. CREATE FUNCTION func_parted_mod_b() returns trigger as $$ BEGIN - NEW.b = 2; -- This is changing partition key column. - return NEW; - END $$ LANGUAGE plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+NEW.b = 2 -+^ -+-- -+source SQL: -+BEGIN -+ NEW.b = 2; -- This is changing partition key column. -+ ^ +@@ -925,26 +1046,13 @@ CREATE TRIGGER parted_mod_b before update on sub_part1 for each row execute procedure func_parted_mod_b(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4; - tableoid | a | b | c -------------+---+----+---- @@ -97629,19 +97527,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe - +ERROR: relation "list_parted" does not exist DROP TRIGGER parted_mod_b ON sub_part1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ -- If BR DELETE trigger prevented DELETE from happening, we should also skip -- the INSERT if that delete is part of UPDATE=>DELETE+INSERT. - CREATE OR REPLACE FUNCTION func_parted_mod_b() returns trigger as $$ -@@ -955,29 +1177,22 @@ - END $$ LANGUAGE plpgsql; +@@ -956,28 +1064,15 @@ CREATE TRIGGER trig_skip_delete before delete on sub_part2 for each row execute procedure func_parted_mod_b(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ UPDATE list_parted set b = 1 WHERE c = 70; -NOTICE: Trigger: Got OLD row (2,70,1), but returning NULL +ERROR: relation "list_parted" does not exist @@ -97657,9 +97547,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe +ERROR: relation "list_parted" does not exist -- Drop the trigger. Now the row should be moved. DROP TRIGGER trig_skip_delete ON sub_part2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ UPDATE list_parted set b = 1 WHERE c = 70; +ERROR: relation "list_parted" does not exist SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4; @@ -97675,7 +97562,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/update.out --labe DROP FUNCTION func_parted_mod_b(); -- UPDATE partition-key with FROM clause. If join produces multiple output -- rows for the same row to be modified, we should tuple-route the row only -@@ -985,44 +1200,93 @@ +@@ -985,44 +1080,93 @@ CREATE TABLE non_parted (id int); INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3); UPDATE list_parted t1 set a = 2 FROM non_parted t2 WHERE t1.a = t2.id and a = 1; @@ -99155,6 +99042,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- - {NULL} -(1 row) +ERROR: ambiguous call: array_agg(unknown), candidates are: ++array_agg(bool) -> bool[] +array_agg(bool[]) -> bool[][] +array_agg(box2d) -> box2d[] +array_agg(box2d[]) -> box2d[][] @@ -99202,7 +99090,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- +array_agg(anyenum[]) -> anyenum[][] +array_agg(tuple) -> tuple[] +array_agg(tuple[]) -> tuple[][] -+array_agg(bool) -> bool[] -- Ensure no ordering is requested when enable_presorted_aggregate is off set enable_presorted_aggregate to off; @@ -100321,39 +100208,36 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create type avg_state as (total bigint, count bigint); create or replace function avg_transfn(state avg_state, n int) returns avg_state as $$ -@@ -2469,6 +2214,19 @@ +@@ -2469,6 +2214,10 @@ return null; end $$ language plpgsql; -+ERROR: at or near ";": at or near "new_state": syntax error -+DETAIL: source SQL: -+new_state.total := n -+^ ++ERROR: no data source matches prefix: state in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName +-- -+source SQL: -+declare new_state avg_state; -+begin -+ raise notice 'avg_transfn called with %', n; -+ if state is null then -+ if n is not null then -+ new_state.total := n; -+ ^ ++See: https://go.crdb.dev/issue-v/114687/_version_ create function avg_finalfn(state avg_state) returns int4 as $$ begin -@@ -2479,6 +2237,7 @@ +@@ -2479,6 +2228,10 @@ end if; end $$ language plpgsql; +ERROR: no data source matches prefix: state in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create function sum_finalfn(state avg_state) returns int4 as $$ begin -@@ -2489,106 +2248,67 @@ +@@ -2489,106 +2242,70 @@ end if; end $$ language plpgsql; +ERROR: no data source matches prefix: state in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create aggregate my_avg(int4) ( stype = avg_state, @@ -100479,7 +100363,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- -- test that aggs with the same sfunc and initcond share the same agg state create aggregate my_sum_init(int4) ( -@@ -2597,6 +2317,12 @@ +@@ -2597,6 +2314,12 @@ finalfunc = sum_finalfn, initcond = '(10,0)' ); @@ -100492,7 +100376,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create aggregate my_avg_init(int4) ( stype = avg_state, -@@ -2604,6 +2330,12 @@ +@@ -2604,6 +2327,12 @@ finalfunc = avg_finalfn, initcond = '(10,0)' ); @@ -100505,7 +100389,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create aggregate my_avg_init2(int4) ( stype = avg_state, -@@ -2611,30 +2343,28 @@ +@@ -2611,30 +2340,28 @@ finalfunc = avg_finalfn, initcond = '(4,0)' ); @@ -100550,7 +100434,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create or replace function sum_transfn(state int4, n int4) returns int4 as $$ declare new_state int4; -@@ -2664,29 +2394,35 @@ +@@ -2664,29 +2391,35 @@ end if; end $$ language plpgsql; @@ -100595,7 +100479,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- -- test that the aggregate transition logic correctly handles -- transition / combine functions returning NULL -- First test the case of a normal transition function returning NULL -@@ -2708,12 +2444,14 @@ +@@ -2708,12 +2441,14 @@ PARALLEL = SAFE, INITCOND = '0' ); @@ -100615,7 +100499,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- ROLLBACK; -- Secondly test the case of a parallel aggregate combiner function -- returning NULL. For that use normal transition function, but a -@@ -2730,6 +2468,23 @@ +@@ -2730,6 +2465,23 @@ END IF; RETURN NULL; END$$; @@ -100639,7 +100523,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- CREATE AGGREGATE balk(int4) ( SFUNC = int4_sum(int8, int4), -@@ -2738,26 +2493,27 @@ +@@ -2738,26 +2490,27 @@ PARALLEL = SAFE, INITCOND = '0' ); @@ -100681,7 +100565,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- ROLLBACK; -- test multiple usage of an aggregate whose finalfn returns a R/W datum BEGIN; -@@ -2767,6 +2523,7 @@ +@@ -2767,6 +2520,7 @@ RETURN array_fill(y[1], ARRAY[4]); END; $$; @@ -100689,7 +100573,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- CREATE FUNCTION rwagg_finalfunc(x anyarray) RETURNS anyarray LANGUAGE plpgsql STRICT IMMUTABLE AS $$ DECLARE -@@ -2777,11 +2534,18 @@ +@@ -2777,11 +2531,18 @@ RETURN res; END; $$; @@ -100708,7 +100592,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- CREATE FUNCTION eatarray(x real[]) RETURNS real[] LANGUAGE plpgsql STRICT IMMUTABLE AS $$ BEGIN -@@ -2789,21 +2553,35 @@ +@@ -2789,21 +2550,35 @@ RETURN x; END; $$; @@ -100749,7 +100633,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- -- variance(int4) covers numeric_poly_combine -- sum(int8) covers int8_avg_combine -- regr_count(float8, float8) covers int8inc_float8_float8 and aggregates with > 1 arg -@@ -2813,36 +2591,17 @@ +@@ -2813,36 +2588,17 @@ UNION ALL SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk1) u; @@ -100792,7 +100676,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- -- variance(int8) covers numeric_combine -- avg(numeric) covers numeric_avg_combine EXPLAIN (COSTS OFF, VERBOSE) -@@ -2851,46 +2610,22 @@ +@@ -2851,46 +2607,22 @@ UNION ALL SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk1) u; @@ -100847,7 +100731,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- -- Ensure that the STRICT checks for aggregates does not take NULLness -- of ORDER BY columns into account. See bug report around -- 2a505161-2727-2473-7c46-591ed108ac52@email.cz -@@ -2929,27 +2664,46 @@ +@@ -2929,27 +2661,46 @@ -- does not lead to array overflow due to unexpected duplicate hash keys -- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com set enable_memoize to off; @@ -100906,7 +100790,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- select unique1, count(*), sum(twothousand) from tenk1 group by unique1 having sum(fivethous) > 4975 -@@ -3007,12 +2761,48 @@ +@@ -3007,12 +2758,48 @@ (48 rows) set work_mem to default; @@ -100955,7 +100839,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create table agg_data_2k as select g from generate_series(0, 1999) g; analyze agg_data_2k; -@@ -3021,19 +2811,28 @@ +@@ -3021,19 +2808,28 @@ analyze agg_data_20k; -- Produce results with sorting. set enable_hashagg = false; @@ -100993,7 +100877,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create table agg_group_1 as select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3 from agg_data_20k group by g%10000; -@@ -3048,6 +2847,7 @@ +@@ -3048,6 +2844,7 @@ where g < r.a group by g/2) as s; set jit_above_cost to default; @@ -101001,7 +100885,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create table agg_group_3 as select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3 from agg_data_2k group by g/2; -@@ -3056,18 +2856,41 @@ +@@ -3056,18 +2853,41 @@ from agg_data_2k group by g/2; -- Produce results with hash aggregation set enable_hashagg = true; @@ -101050,7 +100934,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create table agg_hash_1 as select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3 from agg_data_20k group by g%10000; -@@ -3082,6 +2905,7 @@ +@@ -3082,6 +2902,7 @@ where g < r.a group by g/2) as s; set jit_above_cost to default; @@ -101058,7 +100942,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out -- create table agg_hash_3 as select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3 from agg_data_2k group by g/2; -@@ -3089,7 +2913,31 @@ +@@ -3089,7 +2910,31 @@ select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3 from agg_data_2k group by g/2; set enable_sort = true; @@ -113275,7 +113159,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/replica_identity. diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.out --label=/mnt/data1/postgres/src/test/regress/results/object_address.out /mnt/data1/postgres/src/test/regress/expected/object_address.out /mnt/data1/postgres/src/test/regress/results/object_address.out --- /mnt/data1/postgres/src/test/regress/expected/object_address.out +++ /mnt/data1/postgres/src/test/regress/results/object_address.out -@@ -10,55 +10,227 @@ +@@ -10,32 +10,146 @@ CREATE SCHEMA addr_nsp; SET search_path TO 'addr_nsp'; CREATE FOREIGN DATA WRAPPER addr_fdw; @@ -113390,9 +113274,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou +See: https://go.crdb.dev/issue-v/27796/_version_ CREATE FUNCTION addr_nsp.trig() RETURNS TRIGGER LANGUAGE plpgsql AS $$ BEGIN END; $$; CREATE TRIGGER t BEFORE INSERT ON addr_nsp.gentable FOR EACH ROW EXECUTE PROCEDURE addr_nsp.trig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ CREATE POLICY genpol ON addr_nsp.gentable; +ERROR: at or near "policy": syntax error +DETAIL: source SQL: @@ -113423,11 +113304,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou + ^ +HINT: try \h CREATE ROLE ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regress_addr_user; -+ERROR: must be a member of regress_addr_user ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE DELETE ON TABLES FROM regress_addr_user; -+ERROR: must be a member of regress_addr_user -- this transform would be quite unsafe to leave lying around, - -- except that the SQL language pays no attention to transforms: +@@ -43,22 +157,75 @@ CREATE TRANSFORM FOR int LANGUAGE SQL ( FROM SQL WITH FUNCTION prsd_lextype(internal), TO SQL WITH FUNCTION int4recv(internal)); @@ -113508,7 +113387,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou -- unrecognized object types DO $$ DECLARE -@@ -75,21 +247,19 @@ +@@ -75,21 +242,19 @@ END LOOP; END; $$; @@ -113538,7 +113417,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou DO $$ DECLARE objtype text; -@@ -123,265 +293,65 @@ +@@ -123,265 +288,65 @@ END LOOP; END; $$; @@ -113835,7 +113714,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou -- Make sure that NULL handling is correct. \pset null 'NULL' -- Temporarily disable fancy output, so as future additions never create -@@ -455,84 +425,75 @@ +@@ -455,86 +420,86 @@ pg_identify_object_as_address(classid, objid, objsubid) AS ioa (typ, nms, args), pg_get_object_address(typ, nms, ioa.args) AS addr2 ORDER BY addr1.classid, addr1.objid, addr1.objsubid; @@ -113980,8 +113859,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/object_address.ou -drop cascades to function proc(integer) DROP OWNED BY regress_addr_user; DROP USER regress_addr_user; - -- -@@ -592,47 +553,6 @@ ++ERROR: role regress_addr_user cannot be dropped because some objects depend on it ++owner of default privileges on new relations belonging to role regress_addr_user in database root ++owner of default privileges on new relations belonging to role regress_addr_user in database root in schema public ++privileges for default privileges on new relations belonging to role regress_addr_user in database root ++privileges for default privileges on new relations belonging to role regress_addr_user in database root in schema public ++HINT: USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE ALL ON TABLES FROM regress_addr_user; ++USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA PUBLIC REVOKE ALL ON TABLES FROM regress_addr_user; ++USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE ALL ON TABLES FROM regress_addr_user; ++USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA PUBLIC REVOKE ALL ON TABLES FROM regress_addr_user; + -- + -- Checks for invalid objects + -- +@@ -592,47 +557,6 @@ AS descr FROM objects ORDER BY objects.classid, objects.objid, objects.objsubid; @@ -114299,7 +114189,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/identity.out --la ALTER TABLE itest4 ALTER COLUMN a ADD GENERATED ALWAYS AS IDENTITY; -- ok ALTER TABLE itest4 ALTER COLUMN a DROP NOT NULL; -- error, disallowed -ERROR: column "a" of relation "itest4" is an identity column -+ERROR: relation "itest4" (1026): conflicting NULL/NOT NULL declarations for column "a" ++ERROR: relation "itest4" (1040): conflicting NULL/NOT NULL declarations for column "a" ALTER TABLE itest4 ALTER COLUMN a ADD GENERATED ALWAYS AS IDENTITY; -- error, already set ERROR: column "a" of relation "itest4" is already an identity column ALTER TABLE itest4 ALTER COLUMN b ADD GENERATED ALWAYS AS IDENTITY; -- error, wrong data type @@ -119181,7 +119071,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/matview.out --lab DROP OWNED BY regress_user_mvtest CASCADE; DROP ROLE regress_user_mvtest; -- make sure that create WITH NO DATA works via SPI -@@ -581,98 +541,115 @@ +@@ -581,21 +541,24 @@ CREATE MATERIALIZED VIEW mvtest2 AS SELECT 1 AS x WITH NO DATA; END; $$ LANGUAGE plpgsql; @@ -119218,10 +119108,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/matview.out --lab ROLLBACK; -- INSERT privileges if relation owner is not allowed to insert. CREATE SCHEMA matview_schema; - CREATE USER regress_matview_user; - ALTER DEFAULT PRIVILEGES FOR ROLE regress_matview_user +@@ -604,75 +567,87 @@ REVOKE INSERT ON TABLES FROM regress_matview_user; -+ERROR: must be a member of regress_matview_user GRANT ALL ON SCHEMA matview_schema TO public; SET SESSION AUTHORIZATION regress_matview_user; +ERROR: at or near "regress_matview_user": syntax error: unimplemented: this syntax @@ -119274,7 +119162,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/matview.out --lab +HINT: try \h RESET ALTER DEFAULT PRIVILEGES FOR ROLE regress_matview_user GRANT INSERT ON TABLES TO regress_matview_user; -+ERROR: must be a member of regress_matview_user DROP SCHEMA matview_schema CASCADE; -NOTICE: drop cascades to 4 other objects -DETAIL: drop cascades to materialized view matview_schema.mv_withdata1 @@ -119353,10 +119240,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/generated.out --l -(0 rows) + attrelid | attname | attgenerated +------------+--------------------------+-------------- -+ 860825005 | crdb_internal_idx_expr | v -+ 2413890983 | crdb_internal_idx_expr | v -+ 2413890977 | crdb_internal_idx_expr_1 | v -+ 310127174 | crdb_internal_idx_expr | v ++ 601088728 | crdb_internal_idx_expr | v ++ 3499231723 | crdb_internal_idx_expr | v ++ 3499231725 | crdb_internal_idx_expr_1 | v ++ 2146918772 | crdb_internal_idx_expr | v +(4 rows) CREATE TABLE gtest0 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (55) STORED); @@ -134813,13 +134700,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- ROLLBACK; -- test default ACLs \c - -@@ -2220,69 +3620,34 @@ - (1 row) - - ALTER DEFAULT PRIVILEGES FOR ROLE regress_priv_user1 REVOKE EXECUTE ON FUNCTIONS FROM public; -+ERROR: must be a member of regress_priv_user1 - ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT USAGE ON SCHEMAS TO regress_priv_user2; -- error - ERROR: cannot use IN SCHEMA clause when using GRANT/REVOKE ON SCHEMAS +@@ -2225,64 +3625,28 @@ -- Test makeaclitem() SELECT makeaclitem('regress_priv_user1'::regrole, 'regress_priv_user2'::regrole, 'SELECT', TRUE); -- single privilege @@ -134894,7 +134775,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- -- -- Testing blanket default grants is very hazardous since it might change -- the privileges attached to objects created by concurrent regression tests. -@@ -2300,7 +3665,7 @@ +@@ -2300,7 +3664,7 @@ SELECT has_schema_privilege('regress_priv_user6', 'testns2', 'USAGE'); -- yes has_schema_privilege ---------------------- @@ -134903,7 +134784,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- (1 row) SELECT has_schema_privilege('regress_priv_user2', 'testns2', 'CREATE'); -- no -@@ -2354,19 +3719,18 @@ +@@ -2354,19 +3718,18 @@ classid = 'pg_default_acl'::regclass; count ------- @@ -134928,7 +134809,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- ROLLBACK; CREATE SCHEMA testns5; SELECT has_schema_privilege('regress_priv_user2', 'testns5', 'USAGE'); -- no -@@ -2384,30 +3748,59 @@ +@@ -2384,30 +3747,59 @@ SET ROLE regress_priv_user1; CREATE FUNCTION testns.foo() RETURNS int AS 'select 1' LANGUAGE sql; CREATE AGGREGATE testns.agg1(int) (sfunc = int4pl, stype = int4); @@ -134995,7 +134876,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- DROP PROCEDURE testns.bar(); CREATE PROCEDURE testns.bar() AS 'select 1' LANGUAGE sql; SELECT has_function_privilege('regress_priv_user2', 'testns.foo()', 'EXECUTE'); -- yes -@@ -2417,11 +3810,7 @@ +@@ -2417,11 +3809,7 @@ (1 row) SELECT has_function_privilege('regress_priv_user2', 'testns.agg1(int)', 'EXECUTE'); -- yes @@ -135008,7 +134889,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_function_privilege('regress_priv_user2', 'testns.bar()', 'EXECUTE'); -- yes (counts as function here) has_function_privilege ------------------------ -@@ -2430,36 +3819,57 @@ +@@ -2430,36 +3818,57 @@ DROP FUNCTION testns.foo(); DROP AGGREGATE testns.agg1(int); @@ -135078,7 +134959,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- DROP SCHEMA testns2 CASCADE; DROP SCHEMA testns3 CASCADE; DROP SCHEMA testns4 CASCADE; -@@ -2510,6 +3920,12 @@ +@@ -2510,6 +3919,12 @@ CREATE FUNCTION testns.priv_testfunc(int) RETURNS int AS 'select 3 * $1;' LANGUAGE sql; CREATE AGGREGATE testns.priv_testagg(int) (sfunc = int4pl, stype = int4); @@ -135091,7 +134972,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- CREATE PROCEDURE testns.priv_testproc(int) AS 'select 3' LANGUAGE sql; SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testfunc(int)', 'EXECUTE'); -- true by default has_function_privilege -@@ -2518,11 +3934,7 @@ +@@ -2518,11 +3933,7 @@ (1 row) SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testagg(int)', 'EXECUTE'); -- true by default @@ -135104,7 +134985,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testproc(int)', 'EXECUTE'); -- true by default has_function_privilege ------------------------ -@@ -2533,15 +3945,11 @@ +@@ -2533,15 +3944,11 @@ SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testfunc(int)', 'EXECUTE'); -- false has_function_privilege ------------------------ @@ -135122,7 +135003,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testproc(int)', 'EXECUTE'); -- still true, not a function has_function_privilege ------------------------ -@@ -2552,10 +3960,15 @@ +@@ -2552,10 +3959,15 @@ SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testproc(int)', 'EXECUTE'); -- now false has_function_privilege ------------------------ @@ -135139,7 +135020,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testfunc(int)', 'EXECUTE'); -- true has_function_privilege ------------------------ -@@ -2563,11 +3976,7 @@ +@@ -2563,11 +3975,7 @@ (1 row) SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testagg(int)', 'EXECUTE'); -- true @@ -135152,7 +135033,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_function_privilege('regress_priv_user1', 'testns.priv_testproc(int)', 'EXECUTE'); -- true has_function_privilege ------------------------ -@@ -2575,38 +3984,52 @@ +@@ -2575,38 +3983,52 @@ (1 row) DROP SCHEMA testns CASCADE; @@ -135217,7 +135098,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- -- test that dependent privileges are revoked (or not) properly \c - set session role regress_priv_user1; -@@ -2620,59 +4043,179 @@ +@@ -2620,59 +4042,179 @@ set session role regress_priv_user4; grant select on dep_priv_test to regress_priv_user5; \dp dep_priv_test @@ -135428,7 +135309,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- DROP TABLE atest1; DROP TABLE atest2; DROP TABLE atest3; -@@ -2680,108 +4223,204 @@ +@@ -2680,108 +4222,204 @@ DROP TABLE atest5; DROP TABLE atest6; DROP TABLE atestc; @@ -135646,7 +135527,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- -- clean up DROP TABLE lock_table; DROP USER regress_locktable_user; -@@ -2791,24 +4430,17 @@ +@@ -2791,24 +4429,17 @@ \c - CREATE ROLE regress_readallstats; SELECT has_table_privilege('regress_readallstats','pg_backend_memory_contexts','SELECT'); -- no @@ -135675,7 +135556,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT has_table_privilege('regress_readallstats','pg_shmem_allocations','SELECT'); -- yes has_table_privilege --------------------- -@@ -2818,11 +4450,7 @@ +@@ -2818,11 +4449,7 @@ -- run query to ensure that functions within views can be executed SET ROLE regress_readallstats; SELECT COUNT(*) >= 0 AS ok FROM pg_backend_memory_contexts; @@ -135688,7 +135569,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- SELECT COUNT(*) >= 0 AS ok FROM pg_shmem_allocations; ok ---- -@@ -2838,28 +4466,48 @@ +@@ -2838,28 +4465,48 @@ CREATE ROLE regress_group_indirect_manager; CREATE ROLE regress_group_member; GRANT regress_group TO regress_group_direct_manager WITH INHERIT FALSE, ADMIN TRUE; @@ -135747,7 +135628,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/privileges.out -- DROP ROLE regress_group; DROP ROLE regress_group_direct_manager; DROP ROLE regress_group_indirect_manager; -@@ -2871,22 +4519,59 @@ +@@ -2871,22 +4518,59 @@ CREATE SCHEMA regress_roleoption; GRANT CREATE, USAGE ON SCHEMA regress_roleoption TO PUBLIC; GRANT regress_roleoption_donor TO regress_roleoption_protagonist WITH INHERIT TRUE, SET FALSE; @@ -143042,7 +142923,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/misc.out --label= CREATE FUNCTION hobby_construct(text, text) RETURNS hobbies_r AS 'select $1 as name, $2 as hobby' -@@ -127,32 +1172,44 @@ +@@ -127,32 +1172,56 @@ RETURNS hobbies_r.person%TYPE AS 'select person from hobbies_r where name = $1' LANGUAGE SQL; @@ -143066,21 +142947,33 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/misc.out --label= AS 'select * from equipment_r where equipment_r.hobby = equipment_named.hobby.name' LANGUAGE SQL; +ERROR: no data source matches prefix: equipment_named.hobby in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE FUNCTION equipment_named_ambiguous_1a(hobby hobbies_r) RETURNS setof equipment_r AS 'select * from equipment_r where hobby = equipment_named_ambiguous_1a.hobby.name' LANGUAGE SQL; +ERROR: no data source matches prefix: equipment_named_ambiguous_1a.hobby in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE FUNCTION equipment_named_ambiguous_1b(hobby hobbies_r) RETURNS setof equipment_r AS 'select * from equipment_r where equipment_r.hobby = hobby.name' LANGUAGE SQL; +ERROR: no data source matches prefix: hobby in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE FUNCTION equipment_named_ambiguous_1c(hobby hobbies_r) RETURNS setof equipment_r AS 'select * from equipment_r where hobby = hobby.name' LANGUAGE SQL; +ERROR: no data source matches prefix: hobby in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ CREATE FUNCTION equipment_named_ambiguous_2a(hobby text) RETURNS setof equipment_r AS 'select * from equipment_r where hobby = equipment_named_ambiguous_2a.hobby' @@ -143089,7 +142982,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/misc.out --label= CREATE FUNCTION equipment_named_ambiguous_2b(hobby text) RETURNS setof equipment_r AS 'select * from equipment_r where equipment_r.hobby = hobby' -@@ -163,230 +1220,89 @@ +@@ -163,230 +1232,89 @@ -- everyone else does nothing. -- SELECT p.name, name(p.hobbies) FROM ONLY person p; @@ -144540,7 +144433,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/incremental_sort. return nodes; end; $$; -+ERROR: at or near "node": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + nodes jsonb := '[]'::jsonb; @@ -144549,7 +144442,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/incremental_sort. + space_key text; +begin + for node in select * from jsonb_array_elements(explain_analyze_inc_sort_nodes(query)) t loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -144568,7 +144461,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/incremental_sort. return true; end; $$; -+ERROR: at or near "node": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + node jsonb; @@ -144577,7 +144470,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/incremental_sort. + space_key text; +begin + for node in select * from jsonb_array_elements(explain_analyze_inc_sort_nodes(query)) t loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -146748,7 +146641,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- remove constraints alter table target drop CONSTRAINT target_pkey; -+ERROR: relation "target" (1292): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "target" (1306): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ alter table target alter column tid drop not null; @@ -147189,57 +147082,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label DROP TABLE wq_target, wq_source; -- test triggers -@@ -874,24 +944,56 @@ - END; - $$; - CREATE TRIGGER merge_bsi BEFORE INSERT ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_bsu BEFORE UPDATE ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_bsd BEFORE DELETE ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_asi AFTER INSERT ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_asu AFTER UPDATE ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_asd AFTER DELETE ON target FOR EACH STATEMENT EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_bri BEFORE INSERT ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_bru BEFORE UPDATE ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_brd BEFORE DELETE ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_ari AFTER INSERT ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_aru AFTER UPDATE ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - CREATE TRIGGER merge_ard AFTER DELETE ON target FOR EACH ROW EXECUTE PROCEDURE merge_trigfunc (); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ +@@ -888,10 +958,8 @@ -- now the classic UPSERT, with a DELETE BEGIN; UPDATE target SET balance = 0 WHERE tid = 3; @@ -147247,10 +147090,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -NOTICE: BEFORE UPDATE ROW trigger row: (3,30) -> (3,0) -NOTICE: AFTER UPDATE ROW trigger row: (3,30) -> (3,0) -NOTICE: AFTER UPDATE STATEMENT trigger ++NOTICE: BEFORE UPDATE ROW trigger row: ((3, 30) AS tid, balance) -> ((3, 0) AS tid, balance) ++NOTICE: AFTER UPDATE ROW trigger row: ((3, 30) AS tid, balance) -> ((3, 0) AS tid, balance) --EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF) MERGE INTO target t USING source AS s -@@ -902,26 +1004,12 @@ +@@ -902,26 +970,12 @@ DELETE WHEN NOT MATCHED THEN INSERT VALUES (s.sid, s.delta); @@ -147282,17 +147127,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- Test behavior of triggers that turn UPDATE/DELETE into no-ops create or replace function skip_merge_op() returns trigger -@@ -942,6 +1030,9 @@ - - create trigger merge_skip BEFORE INSERT OR UPDATE or DELETE - ON target FOR EACH ROW EXECUTE FUNCTION skip_merge_op(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - DO $$ - DECLARE - result integer; -@@ -961,17 +1052,10 @@ +@@ -961,17 +1015,10 @@ RAISE NOTICE 'ROW_COUNT = %', result; END; $$; @@ -147314,17 +147149,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label SELECT * FROM target FULL OUTER JOIN source ON (sid = tid); tid | balance | sid | delta -----+---------+-----+------- -@@ -982,6 +1066,9 @@ - (4 rows) - - DROP TRIGGER merge_skip ON target; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ - DROP FUNCTION skip_merge_op(); - -- test from PL/pgSQL - -- make sure MERGE INTO isn't interpreted to mean returning variables like SELECT INTO -@@ -995,12 +1082,10 @@ +@@ -995,12 +1042,10 @@ UPDATE SET balance = t.balance - s.delta; END; $$; @@ -147341,7 +147166,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; --source constants BEGIN; -@@ -1009,19 +1094,12 @@ +@@ -1009,19 +1054,12 @@ ON t.tid = s.sid WHEN NOT MATCHED THEN INSERT (tid, balance) VALUES (s.sid, s.delta); @@ -147366,7 +147191,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; --source query BEGIN; -@@ -1030,19 +1108,12 @@ +@@ -1030,19 +1068,12 @@ ON t.tid = s.sid WHEN NOT MATCHED THEN INSERT (tid, balance) VALUES (s.sid, s.delta); @@ -147391,7 +147216,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; MERGE INTO target t -@@ -1050,19 +1121,12 @@ +@@ -1050,19 +1081,12 @@ ON t.tid = s.sid WHEN NOT MATCHED THEN INSERT (tid, balance) VALUES (s.sid, s.newname); @@ -147416,7 +147241,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; --self-merge BEGIN; -@@ -1073,24 +1137,12 @@ +@@ -1073,24 +1097,12 @@ UPDATE SET balance = t1.balance + t2.balance WHEN NOT MATCHED THEN INSERT VALUES (t2.tid, t2.balance); @@ -147446,7 +147271,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; MERGE INTO target t -@@ -1098,16 +1150,12 @@ +@@ -1098,16 +1110,12 @@ ON t.tid = s.sid WHEN NOT MATCHED THEN INSERT (tid, balance) VALUES (s.sid, s.delta); @@ -147468,7 +147293,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; MERGE INTO target t -@@ -1120,19 +1168,12 @@ +@@ -1120,19 +1128,12 @@ ON t.tid = s.sid WHEN NOT MATCHED THEN INSERT (tid, balance) VALUES (s.sid, s.delta); @@ -147493,7 +147318,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- plpgsql parameters and results BEGIN; -@@ -1154,41 +1195,38 @@ +@@ -1154,41 +1155,38 @@ RETURN result; END; $$; @@ -147559,7 +147384,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; PREPARE foom2 (integer, integer) AS -@@ -1197,26 +1235,25 @@ +@@ -1197,26 +1195,25 @@ ON t.tid = $1 WHEN MATCHED THEN UPDATE SET balance = $2; @@ -147596,7 +147421,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label INSERT INTO sq_target(tid, balance) VALUES (1,100), (2,200), (3,300); INSERT INTO sq_source(sid, delta) VALUES (1,10), (2,20), (4,40); BEGIN; -@@ -1225,14 +1262,12 @@ +@@ -1225,14 +1222,12 @@ ON tid = sid WHEN MATCHED AND t.balance > delta THEN UPDATE SET balance = t.balance + delta; @@ -147616,7 +147441,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- try a view CREATE VIEW v AS SELECT * FROM sq_source WHERE sid < 2; -@@ -1242,14 +1277,12 @@ +@@ -1242,14 +1237,12 @@ ON tid = sid WHEN MATCHED THEN UPDATE SET balance = v.balance + delta; @@ -147636,7 +147461,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- ambiguous reference to a column BEGIN; -@@ -1262,9 +1295,10 @@ +@@ -1262,9 +1255,10 @@ INSERT (balance, tid) VALUES (balance + delta, sid) WHEN MATCHED AND tid < 2 THEN DELETE; @@ -147650,7 +147475,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; INSERT INTO sq_source (sid, balance, delta) VALUES (-1, -1, -10); -@@ -1277,14 +1311,12 @@ +@@ -1277,14 +1271,12 @@ INSERT (balance, tid) VALUES (balance + delta, sid) WHEN MATCHED AND tid < 2 THEN DELETE; @@ -147670,7 +147495,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- CTEs BEGIN; -@@ -1301,6 +1333,13 @@ +@@ -1301,6 +1293,13 @@ INSERT (balance, tid) VALUES (balance + delta, sid) WHEN MATCHED AND tid < 2 THEN DELETE; @@ -147684,7 +147509,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- RETURNING BEGIN; -@@ -1315,15 +1354,18 @@ +@@ -1315,15 +1314,18 @@ WHEN MATCHED AND tid < 2 THEN DELETE RETURNING *; @@ -147706,7 +147531,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label INSERT INTO ex_mtarget SELECT i, i*10 FROM generate_series(1,100,2) i; INSERT INTO ex_msource SELECT i, i*10 FROM generate_series(1,100,1) i; CREATE FUNCTION explain_merge(query text) RETURNS SETOF text -@@ -1340,48 +1382,21 @@ +@@ -1340,48 +1342,21 @@ END LOOP; END; $$; @@ -147760,7 +147585,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- updates + deletes SELECT explain_merge(' MERGE INTO ex_mtarget t USING ex_msource s ON t.a = s.a -@@ -1389,43 +1404,13 @@ +@@ -1389,43 +1364,13 @@ UPDATE SET b = t.b + 1 WHEN MATCHED AND t.a >= 10 AND t.a <= 20 THEN DELETE'); @@ -147806,7 +147631,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- all three SELECT explain_merge(' MERGE INTO ex_mtarget t USING ex_msource s ON t.a = s.a -@@ -1435,45 +1420,16 @@ +@@ -1435,45 +1380,16 @@ DELETE WHEN NOT MATCHED AND s.a < 20 THEN INSERT VALUES (a, b)'); @@ -147855,7 +147680,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- Subqueries BEGIN; MERGE INTO sq_target t -@@ -1481,12 +1437,12 @@ +@@ -1481,12 +1397,12 @@ ON tid = sid WHEN MATCHED THEN UPDATE SET balance = (SELECT count(*) FROM sq_target); @@ -147873,7 +147698,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; MERGE INTO sq_target t -@@ -1494,12 +1450,12 @@ +@@ -1494,12 +1410,12 @@ ON tid = sid WHEN MATCHED AND (SELECT count(*) > 0 FROM sq_target) THEN UPDATE SET balance = 42; @@ -147891,7 +147716,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; BEGIN; MERGE INTO sq_target t -@@ -1507,30 +1463,57 @@ +@@ -1507,30 +1423,57 @@ ON tid = sid AND (SELECT count(*) > 0 FROM sq_target) WHEN MATCHED THEN UPDATE SET balance = 42; @@ -147955,7 +147780,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- try simple MERGE BEGIN; MERGE INTO pa_target t -@@ -1540,25 +1523,12 @@ +@@ -1540,25 +1483,12 @@ UPDATE SET balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (sid, delta, 'inserted by merge'); @@ -147986,7 +147811,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- same with a constant qual BEGIN; -@@ -1569,31 +1539,12 @@ +@@ -1569,31 +1499,12 @@ UPDATE SET balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (sid, delta, 'inserted by merge'); @@ -148023,7 +147848,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- try updating the partition key column BEGIN; -@@ -1614,52 +1565,80 @@ +@@ -1614,52 +1525,80 @@ RETURN result; END; $$; @@ -148127,7 +147952,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- try simple MERGE BEGIN; MERGE INTO pa_target t -@@ -1669,25 +1648,12 @@ +@@ -1669,25 +1608,12 @@ UPDATE SET balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (sid, delta, 'inserted by merge'); @@ -148158,7 +147983,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- same with a constant qual BEGIN; -@@ -1699,29 +1665,12 @@ +@@ -1699,29 +1625,12 @@ UPDATE SET balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (sid, delta, 'inserted by merge'); @@ -148193,7 +148018,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; -- try updating the partition key column BEGIN; -@@ -1732,64 +1681,110 @@ +@@ -1732,64 +1641,110 @@ UPDATE SET tid = tid + 1, balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (sid, delta, 'inserted by merge'); @@ -148323,7 +148148,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- try simple MERGE BEGIN; MERGE INTO pa_target t -@@ -1799,91 +1794,78 @@ +@@ -1799,91 +1754,78 @@ UPDATE SET balance = balance + delta, val = val || ' updated by merge' WHEN NOT MATCHED THEN INSERT VALUES (slogts::timestamp, sid, delta, 'inserted by merge'); @@ -148455,7 +148280,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label INSERT INTO cj_source1 VALUES (1, 10, 100); INSERT INTO cj_source1 VALUES (1, 20, 200); INSERT INTO cj_source1 VALUES (2, 20, 300); -@@ -1898,6 +1880,10 @@ +@@ -1898,6 +1840,10 @@ ON t.tid = sid1 WHEN NOT MATCHED THEN INSERT VALUES (sid1, delta, sval); @@ -148466,7 +148291,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- try accessing columns from either side of the source join MERGE INTO cj_target t USING cj_source2 s2 -@@ -1907,6 +1893,10 @@ +@@ -1907,6 +1853,10 @@ INSERT VALUES (sid2, delta, sval) WHEN MATCHED THEN DELETE; @@ -148477,7 +148302,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- some simple expressions in INSERT targetlist MERGE INTO cj_target t USING cj_source2 s2 -@@ -1916,20 +1906,24 @@ +@@ -1916,20 +1866,24 @@ INSERT VALUES (sid2, delta + scat, sval) WHEN MATCHED THEN UPDATE SET val = val || ' updated by merge'; @@ -148509,7 +148334,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label -- try it with an outer join and PlaceHolderVar MERGE INTO cj_target t -@@ -1938,19 +1932,14 @@ +@@ -1938,19 +1892,14 @@ ON t.tid = fj.scat WHEN NOT MATCHED THEN INSERT (tid, balance, val) VALUES (fj.scat, fj.delta, fj.phv); @@ -148536,7 +148361,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ALTER TABLE cj_source1 RENAME COLUMN sid1 TO sid; ALTER TABLE cj_source2 RENAME COLUMN sid2 TO sid; -@@ -1961,10 +1950,15 @@ +@@ -1961,10 +1910,15 @@ ON t.tid = s1.sid WHEN NOT MATCHED THEN INSERT VALUES (s2.sid, delta, sval); @@ -148552,7 +148377,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label MERGE INTO fs_target t USING generate_series(1,100,1) AS id ON t.a = id -@@ -1972,6 +1966,10 @@ +@@ -1972,6 +1926,10 @@ UPDATE SET b = b + id WHEN NOT MATCHED THEN INSERT VALUES (id, -1); @@ -148563,7 +148388,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label MERGE INTO fs_target t USING generate_series(1,100,2) AS id ON t.a = id -@@ -1979,10 +1977,14 @@ +@@ -1979,10 +1937,14 @@ UPDATE SET b = b + id, c = 'updated '|| id.*::text WHEN NOT MATCHED THEN INSERT VALUES (id, -1, 'inserted ' || id.*::text); @@ -148579,7 +148404,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label (1 row) DROP TABLE fs_target; -@@ -1995,12 +1997,29 @@ +@@ -1995,12 +1957,29 @@ peaktemp int, unitsales int ) WITH (autovacuum_enabled=off); @@ -148609,7 +148434,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label CREATE TABLE measurement_y2007m01 ( filler text, peaktemp int, -@@ -2009,8 +2028,14 @@ +@@ -2009,8 +1988,14 @@ unitsales int CHECK ( logdate >= DATE '2007-01-01' AND logdate < DATE '2007-02-01') ) WITH (autovacuum_enabled=off); @@ -148624,17 +148449,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label INSERT INTO measurement VALUES (0, '2005-07-21', 5, 15); CREATE OR REPLACE FUNCTION measurement_insert_trigger() RETURNS TRIGGER AS $$ -@@ -2034,6 +2059,9 @@ +@@ -2034,6 +2019,7 @@ CREATE TRIGGER insert_measurement_trigger BEFORE INSERT ON measurement FOR EACH ROW EXECUTE PROCEDURE measurement_insert_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "measurement_y2006m02" does not exist INSERT INTO measurement VALUES (1, '2006-02-10', 35, 10); INSERT INTO measurement VALUES (1, '2006-02-16', 45, 20); INSERT INTO measurement VALUES (1, '2006-03-17', 25, 10); -@@ -2041,18 +2069,19 @@ +@@ -2041,18 +2027,19 @@ INSERT INTO measurement VALUES (1, '2007-01-15', 10, 10); INSERT INTO measurement VALUES (1, '2007-01-17', 10, 10); SELECT tableoid::regclass, * FROM measurement ORDER BY city_id, logdate; @@ -148663,7 +148486,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label INSERT INTO new_measurement VALUES (0, '2005-07-21', 25, 20); INSERT INTO new_measurement VALUES (1, '2006-03-01', 20, 10); INSERT INTO new_measurement VALUES (1, '2006-02-16', 50, 10); -@@ -2072,25 +2101,12 @@ +@@ -2072,25 +2059,12 @@ WHEN NOT MATCHED THEN INSERT (city_id, logdate, peaktemp, unitsales) VALUES (city_id, logdate, peaktemp, unitsales); @@ -148694,7 +148517,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/merge.out --label ROLLBACK; MERGE into measurement m USING new_measurement nm ON -@@ -2102,56 +2118,64 @@ +@@ -2102,56 +2076,64 @@ WHEN NOT MATCHED THEN INSERT (city_id, logdate, peaktemp, unitsales) VALUES (city_id, logdate, peaktemp, unitsales); @@ -148844,7 +148667,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_table_like CREATE TABLE inhf (LIKE inhx, LIKE inhx); /* Throw error */ -ERROR: column "xx" specified more than once -+ERROR: relation "inhf" (1325): duplicate column name: "xx" ++ERROR: relation "inhf" (1339): duplicate column name: "xx" CREATE TABLE inhf (LIKE inhx INCLUDING DEFAULTS INCLUDING CONSTRAINTS); INSERT INTO inhf DEFAULT VALUES; SELECT * FROM inhf; /* Single entry with value 'text' */ @@ -149643,7 +149466,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_table_like diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.linux.utf8_1.out --label=/mnt/data1/postgres/src/test/regress/results/collate.linux.utf8.out /mnt/data1/postgres/src/test/regress/expected/collate.linux.utf8_1.out /mnt/data1/postgres/src/test/regress/results/collate.linux.utf8.out --- /mnt/data1/postgres/src/test/regress/expected/collate.linux.utf8_1.out +++ /mnt/data1/postgres/src/test/regress/results/collate.linux.utf8.out -@@ -7,5 +7,936 @@ +@@ -7,5 +7,1008 @@ (SELECT count(*) FROM pg_collation WHERE collname IN ('de_DE', 'en_US', 'sv_SE', 'tr_TR') AND collencoding = pg_char_to_encoding('UTF8')) <> 4 OR version() !~ 'linux-gnu' AS skip_test \gset @@ -149733,15 +149556,28 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.linux.utf +INSERT INTO collate_test3 SELECT * FROM collate_test1; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test1 WHERE b >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+----- ++ 3 | bbc ++(1 row) ++ +SELECT * FROM collate_test2 WHERE b >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+----- ++ 2 | äbc ++ 3 | bbc ++(2 rows) ++ +SELECT * FROM collate_test3 WHERE b >= 'bbc'; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test3 WHERE b >= 'BBC'; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+----- ++ 3 | bbc ++(1 row) ++ +SELECT * FROM collate_test1 WHERE b >= 'bbc' COLLATE "C"; +ERROR: unsupported comparison operator: >= +SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "C"; @@ -149974,46 +149810,105 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.linux.utf +ERROR: unknown function: to_date() +-- backwards parsing +CREATE VIEW collview1 AS SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc'; -+ERROR: unsupported comparison operator: >= +CREATE VIEW collview2 AS SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C"; +CREATE VIEW collview3 AS SELECT a, lower((x || x) COLLATE "C") FROM collate_test10; +ERROR: lower(): unsupported binary operator: || (returning ) +SELECT table_name, view_definition FROM information_schema.views + WHERE table_name LIKE 'collview%' ORDER BY 1; -+ table_name | view_definition -+------------+------------------------------------------------------------------------ ++ table_name | view_definition ++------------+---------------------------------------------------------------------------------------------------------- ++ collview1 | SELECT collate_test1.a, collate_test1.b FROM root.collate_tests.collate_test1 WHERE b COLLATE c >= 'bbc' + collview2 | SELECT a, b FROM root.collate_tests.collate_test1 ORDER BY b COLLATE c -+(1 row) ++(2 rows) + +-- collation propagation in various expression types +SELECT a, coalesce(b, 'foo') FROM collate_test1 ORDER BY 2; -+ERROR: incompatible COALESCE expressions: expected 'foo' to be of type collatedstring{en_US}, found type string ++ a | coalesce ++---+---------- ++ 1 | abc ++ 4 | ABC ++ 2 | äbc ++ 3 | bbc ++(4 rows) ++ +SELECT a, coalesce(b, 'foo') FROM collate_test2 ORDER BY 2; -+ERROR: incompatible COALESCE expressions: expected 'foo' to be of type collatedstring{sv_SE}, found type string ++ a | coalesce ++---+---------- ++ 1 | abc ++ 4 | ABC ++ 3 | bbc ++ 2 | äbc ++(4 rows) ++ +SELECT a, coalesce(b, 'foo') FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +SELECT a, lower(coalesce(x, 'foo')), lower(coalesce(y, 'foo')) FROM collate_test10; -+ERROR: lower(): incompatible COALESCE expressions: expected 'foo' to be of type collatedstring{en_US}, found type string ++ERROR: unknown signature: lower(collatedstring{en_US}) ++HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT a, b, greatest(b, 'CCC') FROM collate_test1 ORDER BY 3; -+ERROR: greatest(): expected 'CCC' to be of type collatedstring{en_US}, found type string ++ a | b | greatest ++---+-----+---------- ++ 1 | abc | CCC ++ 2 | äbc | CCC ++ 3 | bbc | CCC ++ 4 | ABC | CCC ++(4 rows) ++ +SELECT a, b, greatest(b, 'CCC') FROM collate_test2 ORDER BY 3; -+ERROR: greatest(): expected 'CCC' to be of type collatedstring{sv_SE}, found type string ++ a | b | greatest ++---+-----+---------- ++ 1 | abc | CCC ++ 3 | bbc | CCC ++ 4 | ABC | CCC ++ 2 | äbc | äbc ++(4 rows) ++ +SELECT a, b, greatest(b, 'CCC') FROM collate_test3 ORDER BY 3; +ERROR: relation "collate_test3" does not exist +SELECT a, x, y, lower(greatest(x, 'foo')), lower(greatest(y, 'foo')) FROM collate_test10; -+ERROR: lower(): greatest(): expected 'foo' to be of type collatedstring{en_US}, found type string ++ERROR: unknown signature: lower(collatedstring{en_US}) ++HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT a, nullif(b, 'abc') FROM collate_test1 ORDER BY 2; -+ERROR: incompatible NULLIF expressions: expected 'abc' to be of type collatedstring{en_US}, found type string ++ a | nullif ++---+-------- ++ 1 | ++ 4 | ABC ++ 2 | äbc ++ 3 | bbc ++(4 rows) ++ +SELECT a, nullif(b, 'abc') FROM collate_test2 ORDER BY 2; -+ERROR: incompatible NULLIF expressions: expected 'abc' to be of type collatedstring{sv_SE}, found type string ++ a | nullif ++---+-------- ++ 1 | ++ 4 | ABC ++ 3 | bbc ++ 2 | äbc ++(4 rows) ++ +SELECT a, nullif(b, 'abc') FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +SELECT a, lower(nullif(x, 'foo')), lower(nullif(y, 'foo')) FROM collate_test10; -+ERROR: lower(): incompatible NULLIF expressions: expected 'foo' to be of type collatedstring{en_US}, found type string ++ERROR: unknown signature: lower(collatedstring{en_US}) ++HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test1 ORDER BY 2; -+ERROR: incompatible condition type:: expected 'abc' to be of type collatedstring{en_US}, found type string ++ a | b ++---+------ ++ 4 | ABC ++ 2 | äbc ++ 1 | abcd ++ 3 | bbc ++(4 rows) ++ +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test2 ORDER BY 2; -+ERROR: incompatible condition type:: expected 'abc' to be of type collatedstring{sv_SE}, found type string ++ a | b ++---+------ ++ 4 | ABC ++ 1 | abcd ++ 3 | bbc ++ 2 | äbc ++(4 rows) ++ +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +CREATE DOMAIN testdomain AS text; @@ -150583,7 +150478,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.linux.utf diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.windows.win1252_1.out --label=/mnt/data1/postgres/src/test/regress/results/collate.windows.win1252.out /mnt/data1/postgres/src/test/regress/expected/collate.windows.win1252_1.out /mnt/data1/postgres/src/test/regress/results/collate.windows.win1252.out --- /mnt/data1/postgres/src/test/regress/expected/collate.windows.win1252_1.out +++ /mnt/data1/postgres/src/test/regress/results/collate.windows.win1252.out -@@ -9,5 +9,818 @@ +@@ -9,5 +9,851 @@ (SELECT count(*) FROM pg_collation WHERE collname IN ('de_DE', 'en_US', 'sv_SE') AND collencoding = pg_char_to_encoding('WIN1252')) <> 3 OR (version() !~ 'Visual C\+\+' AND version() !~ 'mingw32' AND version() !~ 'windows') AS skip_test \gset @@ -150681,15 +150576,24 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.windows.w +INSERT INTO collate_test3 SELECT * FROM collate_test1; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test1 WHERE b >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+--- ++(0 rows) ++ +SELECT * FROM collate_test2 WHERE b >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+--- ++(0 rows) ++ +SELECT * FROM collate_test3 WHERE b >= 'bbc'; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test3 WHERE b >= 'BBC'; +ERROR: relation "collate_test3" does not exist +SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc'; -+ERROR: unsupported comparison operator: >= ++ a | b ++---+--- ++(0 rows) ++ +SELECT * FROM collate_test1 WHERE b >= 'bbc' COLLATE "C"; +ERROR: unsupported comparison operator: >= +SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "C"; @@ -150844,38 +150748,62 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/collate.windows.w + +-- backwards parsing +CREATE VIEW collview1 AS SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc'; -+ERROR: unsupported comparison operator: >= +CREATE VIEW collview2 AS SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C"; +SELECT table_name, view_definition FROM information_schema.views + WHERE table_name LIKE 'collview%' ORDER BY 1; -+ table_name | view_definition -+------------+------------------------------------------------------------------------ ++ table_name | view_definition ++------------+---------------------------------------------------------------------------------------------------------- ++ collview1 | SELECT collate_test1.a, collate_test1.b FROM root.collate_tests.collate_test1 WHERE b COLLATE c >= 'bbc' + collview2 | SELECT a, b FROM root.collate_tests.collate_test1 ORDER BY b COLLATE c -+(1 row) ++(2 rows) + +-- collation propagation in various expression types +SELECT a, coalesce(b, 'foo') FROM collate_test1 ORDER BY 2; -+ERROR: incompatible COALESCE expressions: expected 'foo' to be of type collatedstring{en_US}, found type string ++ a | coalesce ++---+---------- ++(0 rows) ++ +SELECT a, coalesce(b, 'foo') FROM collate_test2 ORDER BY 2; -+ERROR: incompatible COALESCE expressions: expected 'foo' to be of type collatedstring{sv_SE}, found type string ++ a | coalesce ++---+---------- ++(0 rows) ++ +SELECT a, coalesce(b, 'foo') FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +SELECT a, b, greatest(b, 'CCC') FROM collate_test1 ORDER BY 3; -+ERROR: greatest(): expected 'CCC' to be of type collatedstring{en_US}, found type string ++ a | b | greatest ++---+---+---------- ++(0 rows) ++ +SELECT a, b, greatest(b, 'CCC') FROM collate_test2 ORDER BY 3; -+ERROR: greatest(): expected 'CCC' to be of type collatedstring{sv_SE}, found type string ++ a | b | greatest ++---+---+---------- ++(0 rows) ++ +SELECT a, b, greatest(b, 'CCC') FROM collate_test3 ORDER BY 3; +ERROR: relation "collate_test3" does not exist +SELECT a, nullif(b, 'abc') FROM collate_test1 ORDER BY 2; -+ERROR: incompatible NULLIF expressions: expected 'abc' to be of type collatedstring{en_US}, found type string ++ a | nullif ++---+-------- ++(0 rows) ++ +SELECT a, nullif(b, 'abc') FROM collate_test2 ORDER BY 2; -+ERROR: incompatible NULLIF expressions: expected 'abc' to be of type collatedstring{sv_SE}, found type string ++ a | nullif ++---+-------- ++(0 rows) ++ +SELECT a, nullif(b, 'abc') FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test1 ORDER BY 2; -+ERROR: incompatible condition type:: expected 'abc' to be of type collatedstring{en_US}, found type string ++ a | b ++---+--- ++(0 rows) ++ +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test2 ORDER BY 2; -+ERROR: incompatible condition type:: expected 'abc' to be of type collatedstring{sv_SE}, found type string ++ a | b ++---+--- ++(0 rows) ++ +SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test3 ORDER BY 2; +ERROR: relation "collate_test3" does not exist +CREATE DOMAIN testdomain AS text; @@ -168414,7 +168342,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/portals_p2.out -- diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out --label=/mnt/data1/postgres/src/test/regress/results/dependency.out /mnt/data1/postgres/src/test/regress/expected/dependency.out /mnt/data1/postgres/src/test/regress/results/dependency.out --- /mnt/data1/postgres/src/test/regress/expected/dependency.out +++ /mnt/data1/postgres/src/test/regress/results/dependency.out -@@ -6,26 +6,44 @@ +@@ -6,26 +6,40 @@ CREATE USER regress_dep_user3; CREATE GROUP regress_dep_group; CREATE TABLE deptest (f1 serial primary key, f2 text); @@ -168456,16 +168384,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- +ERROR: cannot drop role/user regress_dep_user: grants still exist on root.public.deptest -- now we are OK to drop him REVOKE TRIGGER ON deptest FROM regress_dep_user; -+ERROR: at or near "on": syntax error: not a valid privilege: "trigger" -+DETAIL: source SQL: -+REVOKE TRIGGER ON deptest FROM regress_dep_user -+ ^ DROP USER regress_dep_user; +ERROR: cannot drop role/user regress_dep_user: grants still exist on root.public.deptest -- we are OK too if we drop the privileges all at once REVOKE ALL ON deptest FROM regress_dep_user2; DROP USER regress_dep_user2; -@@ -35,7 +53,8 @@ +@@ -35,7 +49,8 @@ \set VERBOSITY terse ALTER TABLE deptest OWNER TO regress_dep_user3; DROP USER regress_dep_user3; @@ -168475,7 +168399,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- \set VERBOSITY default -- if we drop the object, we can drop the user too DROP TABLE deptest; -@@ -45,59 +64,169 @@ +@@ -45,59 +60,168 @@ CREATE USER regress_dep_user1; CREATE USER regress_dep_user2; SET SESSION AUTHORIZATION regress_dep_user0; @@ -168653,7 +168577,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- +ERROR: relation "root.public.deptest" already exists ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA deptest GRANT ALL ON TABLES TO regress_dep_user2; -+ERROR: must be a member of regress_dep_user1 CREATE FUNCTION deptest_func() RETURNS void LANGUAGE plpgsql AS $$ BEGIN END; $$; CREATE TYPE deptest_enum AS ENUM ('red'); @@ -168667,7 +168590,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- CREATE TABLE deptest2 (f1 int); -- make a serial column the hard way CREATE SEQUENCE ss1; -@@ -114,14 +243,24 @@ +@@ -114,14 +238,24 @@ (1 row) RESET SESSION AUTHORIZATION; @@ -168698,7 +168621,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- SELECT typowner = relowner FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t'; ?column? -@@ -131,24 +270,11 @@ +@@ -131,24 +265,17 @@ -- doesn't work: grant still exists DROP USER regress_dep_user1; @@ -168709,6 +168632,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- +ERROR: cannot drop role/user regress_dep_user1: grants still exist on root.public.deptest1 DROP OWNED BY regress_dep_user1; DROP USER regress_dep_user1; ++ERROR: role regress_dep_user1 cannot be dropped because some objects depend on it ++owner of default privileges on new relations belonging to role regress_dep_user1 in database root in schema deptest ++HINT: USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA DEPTEST REVOKE ALL ON TABLES FROM regress_dep_user2; DROP USER regress_dep_user2; -ERROR: role "regress_dep_user2" cannot be dropped because some objects depend on it -DETAIL: owner of schema deptest @@ -168724,6 +168650,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/dependency.out -- +ERROR: cannot drop role/user regress_dep_user2: grants still exist on root.public.deptest1 DROP OWNED BY regress_dep_user2, regress_dep_user0; DROP USER regress_dep_user2; ++ERROR: role regress_dep_user2 cannot be dropped because some objects depend on it ++privileges for default privileges on new relations belonging to role regress_dep_user1 in database root in schema deptest ++HINT: USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA DEPTEST REVOKE ALL ON TABLES FROM regress_dep_user2; DROP USER regress_dep_user0; diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/xmlmap_1.out --label=/mnt/data1/postgres/src/test/regress/results/xmlmap.out /mnt/data1/postgres/src/test/regress/expected/xmlmap_1.out /mnt/data1/postgres/src/test/regress/results/xmlmap.out --- /mnt/data1/postgres/src/test/regress/expected/xmlmap_1.out @@ -172130,7 +172059,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/functional_deps.o -ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it -DETAIL: view fdv1 depends on constraint articles_pkey on table articles -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "articles" (1577): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles" (1593): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ DROP VIEW fdv1; @@ -172143,14 +172072,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/functional_deps.o -ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it -DETAIL: view fdv2 depends on constraint articles_pkey on table articles -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "articles" (1577): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles" (1593): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ ALTER TABLE articles_in_category DROP CONSTRAINT articles_in_category_pkey RESTRICT; --fail -ERROR: cannot drop constraint articles_in_category_pkey on table articles_in_category because other objects depend on it -DETAIL: view fdv2 depends on constraint articles_in_category_pkey on table articles_in_category -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "articles_in_category" (1578): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles_in_category" (1594): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ DROP VIEW fdv2; @@ -172163,7 +172092,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/functional_deps.o -ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it -DETAIL: view fdv3 depends on constraint articles_pkey on table articles -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "articles" (1577): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles" (1593): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ DROP VIEW fdv3; @@ -172173,7 +172102,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/functional_deps.o -ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it -DETAIL: view fdv4 depends on constraint articles_pkey on table articles -HINT: Use DROP ... CASCADE to drop the dependent objects too. -+ERROR: relation "articles" (1577): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles" (1593): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ DROP VIEW fdv4; @@ -172183,7 +172112,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/functional_deps.o (0 rows) ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -+ERROR: relation "articles" (1577): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "articles" (1593): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ EXECUTE foo; -- fail @@ -177128,17 +177057,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/indirect_toast.ou SELECT substring(indtoasttest::text, 1, 200) FROM indtoasttest; substring ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -@@ -99,6 +102,9 @@ +@@ -99,6 +102,7 @@ ON indtoasttest FOR EACH ROW EXECUTE PROCEDURE update_using_indirect(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: make_tuple_indirect() -- modification without changing varlenas UPDATE indtoasttest SET cnt = cnt +1 RETURNING substring(indtoasttest::text, 1, 200); substring -@@ -151,6 +157,10 @@ +@@ -151,6 +155,10 @@ -- check we didn't screw with main/toast tuple visibility VACUUM FREEZE indtoasttest; @@ -177149,7 +177076,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/indirect_toast.ou SELECT substring(indtoasttest::text, 1, 200) FROM indtoasttest; substring ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -@@ -164,3 +174,4 @@ +@@ -164,3 +172,4 @@ DROP TABLE indtoasttest; DROP FUNCTION update_using_indirect(); RESET default_toast_compression; @@ -179843,9 +179770,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/tsearch.out --lab CREATE TRIGGER tsvectorupdate BEFORE UPDATE OR INSERT ON test_tsvector FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(a, 'pg_catalog.english', t); -+ERROR: unimplemented: CREATE TRIGGER ++ERROR: tsvector_update_trigger(): unimplemented: this function is not yet supported +HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++See: https://go.crdb.dev/issue-v/7821/_version_ SELECT count(*) FROM test_tsvector WHERE a @@ to_tsquery('345&qwerty'); count ------- @@ -185312,20 +185239,16 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out -- Triggers CREATE FUNCTION dummy_trigger() RETURNS TRIGGER AS $$ BEGIN -@@ -1355,39 +3030,78 @@ +@@ -1355,39 +3030,60 @@ ON foreign_schema.foreign_table_1 FOR EACH STATEMENT EXECUTE PROCEDURE dummy_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist CREATE TRIGGER trigtest_after_stmt AFTER INSERT OR UPDATE OR DELETE ON foreign_schema.foreign_table_1 FOR EACH STATEMENT EXECUTE PROCEDURE dummy_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist CREATE TRIGGER trigtest_after_stmt_tt AFTER INSERT OR UPDATE OR DELETE -- ERROR ON foreign_schema.foreign_table_1 REFERENCING NEW TABLE AS new_table @@ -185333,23 +185256,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out EXECUTE PROCEDURE dummy_trigger(); -ERROR: "foreign_table_1" is a foreign table -DETAIL: Triggers on foreign tables cannot have transition tables. -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist CREATE TRIGGER trigtest_before_row BEFORE INSERT OR UPDATE OR DELETE ON foreign_schema.foreign_table_1 FOR EACH ROW EXECUTE PROCEDURE dummy_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist CREATE TRIGGER trigtest_after_row AFTER INSERT OR UPDATE OR DELETE ON foreign_schema.foreign_table_1 FOR EACH ROW EXECUTE PROCEDURE dummy_trigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist CREATE CONSTRAINT TRIGGER trigtest_constraint AFTER INSERT OR UPDATE OR DELETE ON foreign_schema.foreign_table_1 FOR EACH ROW @@ -185377,25 +185294,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out + ^ +HINT: try \h ALTER DROP TRIGGER trigtest_before_stmt ON foreign_schema.foreign_table_1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist DROP TRIGGER trigtest_before_row ON foreign_schema.foreign_table_1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist DROP TRIGGER trigtest_after_stmt ON foreign_schema.foreign_table_1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist DROP TRIGGER trigtest_after_row ON foreign_schema.foreign_table_1; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "foreign_schema.foreign_table_1" does not exist DROP FUNCTION dummy_trigger(); -- Table inheritance CREATE TABLE fd_pt1 ( -@@ -1397,113 +3111,181 @@ +@@ -1397,113 +3093,181 @@ ); CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value'); @@ -185661,7 +185570,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out -- add attributes recursively ALTER TABLE fd_pt1 ADD COLUMN c4 integer; ALTER TABLE fd_pt1 ADD COLUMN c5 integer DEFAULT 0; -@@ -1511,111 +3293,109 @@ +@@ -1511,111 +3275,109 @@ ALTER TABLE fd_pt1 ADD COLUMN c7 integer NOT NULL; ALTER TABLE fd_pt1 ADD COLUMN c8 integer; \d+ fd_pt1 @@ -185859,7 +185768,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out -- drop attributes recursively ALTER TABLE fd_pt1 DROP COLUMN c4; ALTER TABLE fd_pt1 DROP COLUMN c5; -@@ -1623,172 +3403,205 @@ +@@ -1623,172 +3385,205 @@ ALTER TABLE fd_pt1 DROP COLUMN c7; ALTER TABLE fd_pt1 DROP COLUMN c8; \d+ fd_pt1 @@ -186191,7 +186100,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_data.out -- changes name of an attribute recursively ALTER TABLE fd_pt1 RENAME COLUMN c1 TO f1; ALTER TABLE fd_pt1 RENAME COLUMN c2 TO f2; -@@ -1796,297 +3609,606 @@ +@@ -1796,297 +3591,606 @@ -- changes name of a constraint recursively ALTER TABLE fd_pt1 RENAME CONSTRAINT fd_pt1chk3 TO f2_check; \d+ fd_pt1 @@ -191122,24 +191031,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/foreign_key.out - -- check that regular and deferrable AR triggers on the PK tables -- still work as expected CREATE FUNCTION fkpart11.print_row () RETURNS TRIGGER LANGUAGE plpgsql AS $$ -@@ -2896,24 +3882,44 @@ +@@ -2896,24 +3882,38 @@ RETURN NULL; END; $$; +ERROR: cannot create "fkpart11.print_row" because the target database or schema does not exist +HINT: verify that the current database and search_path are valid and/or the target database exists CREATE TRIGGER trig_upd_pk AFTER UPDATE ON fkpart11.pk FOR EACH ROW EXECUTE FUNCTION fkpart11.print_row(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "fkpart11.pk" does not exist CREATE TRIGGER trig_del_pk AFTER DELETE ON fkpart11.pk FOR EACH ROW EXECUTE FUNCTION fkpart11.print_row(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "fkpart11.pk" does not exist CREATE TRIGGER trig_ins_pk AFTER INSERT ON fkpart11.pk FOR EACH ROW EXECUTE FUNCTION fkpart11.print_row(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "fkpart11.pk" does not exist CREATE CONSTRAINT TRIGGER trig_upd_fk_parted AFTER UPDATE ON fkpart11.fk_parted INITIALLY DEFERRED FOR EACH ROW EXECUTE FUNCTION fkpart11.print_row(); +ERROR: at or near "trig_upd_fk_parted": syntax error: unimplemented: this syntax +DETAIL: source SQL: @@ -208490,7 +208393,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plancache.out --l ----------- - -(1 row) -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare r int; +begin @@ -208498,7 +208401,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plancache.out --l + create temp table temptable as select * from generate_series(1,3) as f1; + create temp view vv as select * from temptable; + for r in select * from vv loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select cachebug(); @@ -213735,13 +213638,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- triggers will fire, too create function noticetrigger() returns trigger as $$ -@@ -1764,70 +1316,54 @@ +@@ -1764,70 +1316,55 @@ end $$ language plpgsql; create trigger tnoticetrigger after insert on tt for each row execute procedure noticetrigger(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ select insert_tt2('foolme','barme') limit 1; -NOTICE: noticetrigger 11 foolme -NOTICE: noticetrigger 12 barme @@ -213841,7 +213745,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- test case for a whole-row-variable bug create function rngfunc1(n integer, out a text, out b text) -@@ -1835,6 +1371,18 @@ +@@ -1835,6 +1372,18 @@ language sql as $$ select 'foo ' || i, 'bar ' || i from generate_series(1,$1) i $$; set work_mem='64kB'; @@ -213860,7 +213764,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select t.a, t, t.a from rngfunc1(10000) t limit 1; a | t | a -------+-------------------+------- -@@ -1842,6 +1390,18 @@ +@@ -1842,6 +1391,18 @@ (1 row) reset work_mem; @@ -213879,7 +213783,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select t.a, t, t.a from rngfunc1(10000) t limit 1; a | t | a -------+-------------------+------- -@@ -1871,31 +1431,24 @@ +@@ -1871,31 +1432,24 @@ select * from array_to_set(array['one', 'two']); -- fail ERROR: a column definition list is required for functions returning "record" @@ -213923,7 +213827,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- but without, it can be: create or replace function array_to_set(anyarray) returns setof record as $$ select i AS "index", $1[i] AS "value" from generate_subscripts($1, 1) i -@@ -1914,26 +1467,21 @@ +@@ -1914,26 +1468,21 @@ 2 | two (2 rows) @@ -213962,7 +213866,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- create temp table rngfunc(f1 int8, f2 int8); create function testrngfunc() returns record as $$ insert into rngfunc values (1,2) returning *; -@@ -1952,8 +1500,6 @@ +@@ -1952,8 +1501,6 @@ select * from testrngfunc(); -- fail ERROR: a column definition list is required for functions returning "record" @@ -213971,7 +213875,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- drop function testrngfunc(); create function testrngfunc() returns setof record as $$ insert into rngfunc values (1,2), (3,4) returning *; -@@ -1974,8 +1520,6 @@ +@@ -1974,8 +1521,6 @@ select * from testrngfunc(); -- fail ERROR: a column definition list is required for functions returning "record" @@ -213980,7 +213884,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- drop function testrngfunc(); -- Check that typmod imposed by a composite type is honored create type rngfunc_type as (f1 numeric(35,6), f2 numeric(35,2)); -@@ -1984,12 +1528,11 @@ +@@ -1984,12 +1529,11 @@ $$ language sql immutable; explain (verbose, costs off) select testrngfunc(); @@ -213998,7 +213902,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select testrngfunc(); testrngfunc ----------------- -@@ -1998,13 +1541,11 @@ +@@ -1998,13 +1542,11 @@ explain (verbose, costs off) select * from testrngfunc(); @@ -214017,7 +213921,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select * from testrngfunc(); f1 | f2 ----------+------ -@@ -2016,12 +1557,11 @@ +@@ -2016,12 +1558,11 @@ $$ language sql volatile; explain (verbose, costs off) select testrngfunc(); @@ -214035,7 +213939,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select testrngfunc(); testrngfunc ----------------- -@@ -2030,13 +1570,11 @@ +@@ -2030,13 +1571,11 @@ explain (verbose, costs off) select * from testrngfunc(); @@ -214054,7 +213958,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select * from testrngfunc(); f1 | f2 ----------+------ -@@ -2049,13 +1587,11 @@ +@@ -2049,13 +1588,11 @@ $$ language sql immutable; explain (verbose, costs off) select testrngfunc(); @@ -214073,7 +213977,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select testrngfunc(); testrngfunc ----------------- -@@ -2064,12 +1600,11 @@ +@@ -2064,12 +1601,11 @@ explain (verbose, costs off) select * from testrngfunc(); @@ -214091,7 +213995,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select * from testrngfunc(); f1 | f2 ----------+------ -@@ -2081,13 +1616,11 @@ +@@ -2081,13 +1617,11 @@ $$ language sql volatile; explain (verbose, costs off) select testrngfunc(); @@ -214110,7 +214014,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select testrngfunc(); testrngfunc ----------------- -@@ -2096,13 +1629,11 @@ +@@ -2096,13 +1630,11 @@ explain (verbose, costs off) select * from testrngfunc(); @@ -214129,7 +214033,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select * from testrngfunc(); f1 | f2 ----------+------ -@@ -2112,62 +1643,45 @@ +@@ -2112,62 +1644,45 @@ create or replace function testrngfunc() returns setof rngfunc_type as $$ select 1, 2 union select 3, 4 order by 1; $$ language sql immutable; @@ -214213,7 +214117,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- -- Check some cases involving added/dropped columns in a rowtype result -- -@@ -2178,79 +1692,37 @@ +@@ -2178,79 +1693,37 @@ create or replace function get_first_user() returns users as $$ SELECT * FROM users ORDER BY userid LIMIT 1; $$ language sql stable; @@ -214306,7 +214210,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- We used to have a bug that would allow the above to succeed, posing -- hazards for later execution of the view. Check that the internal -- defenses for those hazards haven't bit-rotted, in case some other -@@ -2264,18 +1736,17 @@ +@@ -2264,18 +1737,17 @@ returning pg_describe_object(classid, objid, objsubid) as obj, pg_describe_object(refclassid, refobjid, refobjsubid) as ref, deptype; @@ -214332,7 +214236,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- -- likewise, check we don't crash if the dependency goes wrong begin; -- destroy the dependency entry that prevents the ALTER: -@@ -2286,19 +1757,18 @@ +@@ -2286,19 +1758,18 @@ returning pg_describe_object(classid, objid, objsubid) as obj, pg_describe_object(refclassid, refobjid, refobjsubid) as ref, deptype; @@ -214358,7 +214262,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- drop table users; -- check behavior with type coercion required for a set-op create or replace function rngfuncbar() returns setof text as -@@ -2320,17 +1790,11 @@ +@@ -2320,17 +1791,11 @@ -- this function is now inlinable, too: explain (verbose, costs off) select * from rngfuncbar(); @@ -214381,7 +214285,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- drop function rngfuncbar(); -- check handling of a SQL function with multiple OUT params (bug #5777) create or replace function rngfuncbar(out integer, out numeric) as -@@ -2344,115 +1808,100 @@ +@@ -2344,115 +1809,103 @@ create or replace function rngfuncbar(out integer, out numeric) as $$ select (1, 2) $$ language sql; select * from rngfuncbar(); -- fail @@ -214410,6 +214314,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- select t.q2 $$ language sql immutable; +ERROR: no data source matches prefix: t in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ explain (verbose, costs off) select x from int8_tbl, extractq2(int8_tbl) f(x); - QUERY PLAN @@ -214555,7 +214462,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rangefuncs.out -- (0 rows) drop type rngfunc2; -@@ -2463,25 +1912,16 @@ +@@ -2463,25 +1916,16 @@ from unnest(array['{"lectures": [{"id": "1"}]}'::jsonb]) as unnested_modules(module)) as ss, jsonb_to_recordset(ss.lecture) as j (id text); @@ -215814,7 +215721,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la -- Test ON TRUNCATE triggers CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text); CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text, -@@ -294,12 +228,28 @@ +@@ -294,12 +228,26 @@ return null; end; $$ LANGUAGE plpgsql; @@ -215837,13 +215744,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la BEFORE TRUNCATE ON trunc_trigger_test FOR EACH STATEMENT EXECUTE PROCEDURE trunctrigger('before trigger truncate'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: trunctrigger() SELECT count(*) as "Row count in test table" FROM trunc_trigger_test; Row count in test table ------------------------- -@@ -319,12 +269,14 @@ +@@ -319,12 +267,12 @@ (1 row) SELECT * FROM trunc_trigger_log; @@ -215856,23 +215761,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la +(0 rows) DROP TRIGGER t ON trunc_trigger_test; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "t" of relation "trunc_trigger_test" does not exist truncate trunc_trigger_log; -- same test with an after trigger INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux'); -@@ -332,6 +284,9 @@ +@@ -332,6 +280,7 @@ AFTER TRUNCATE ON trunc_trigger_test FOR EACH STATEMENT EXECUTE PROCEDURE trunctrigger('after trigger truncate'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: trunctrigger() SELECT count(*) as "Row count in test table" FROM trunc_trigger_test; Row count in test table ------------------------- -@@ -351,17 +306,18 @@ +@@ -351,17 +300,18 @@ (1 row) SELECT * FROM trunc_trigger_log; @@ -215896,7 +215797,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la id1 integer default nextval('truncate_a_id1')); ALTER SEQUENCE truncate_a_id1 OWNED BY truncate_a.id1; INSERT INTO truncate_a DEFAULT VALUES; -@@ -384,14 +340,20 @@ +@@ -384,14 +334,20 @@ (2 rows) TRUNCATE truncate_a RESTART IDENTITY; @@ -215920,7 +215821,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la CREATE TABLE truncate_b (id int GENERATED ALWAYS AS IDENTITY (START WITH 44)); INSERT INTO truncate_b DEFAULT VALUES; -@@ -414,56 +376,74 @@ +@@ -414,56 +370,74 @@ (2 rows) TRUNCATE truncate_b RESTART IDENTITY; @@ -216013,7 +215914,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la -- foreign key on partitioned table: partition key is referencing column. -- Make sure truncate did execute on all tables CREATE FUNCTION tp_ins_data() RETURNS void LANGUAGE plpgsql AS $$ -@@ -472,6 +452,7 @@ +@@ -472,6 +446,7 @@ INSERT INTO truncpart VALUES (1), (100), (150); END $$; @@ -216021,7 +215922,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/truncate.out --la CREATE FUNCTION tp_chk_data(OUT pktb regclass, OUT pkval int, OUT fktb regclass, OUT fkval int) RETURNS SETOF record LANGUAGE plpgsql AS $$ BEGIN -@@ -481,114 +462,173 @@ +@@ -481,114 +456,173 @@ ORDER BY 2, 4; END $$; @@ -217871,7 +217772,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -ERROR: column "test" is in a primary key +ERROR: column "test" is in a primary index alter table atacc1 drop constraint "atacc1_pkey"; -+ERROR: relation "atacc1" (1943): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "atacc1" (1959): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ alter table atacc1 alter column test drop not null; @@ -220350,13 +220251,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - rollback; begin; create trigger ttdummy -@@ -2817,52 +3212,31 @@ +@@ -2817,52 +3212,29 @@ for each row execute procedure ttdummy (1, 1); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: ttdummy() select * from my_locks order by 1; - relname | max_lockmode ------------+----------------------- @@ -220413,7 +220312,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - rollback; create or replace view my_locks as select case when c.relname like 'pg_toast%' then 'pg_toast' else c.relname end, max(mode::lockmodes) as max_lockmode -@@ -2875,40 +3249,57 @@ +@@ -2875,40 +3247,57 @@ and relnamespace != (select oid from pg_namespace where nspname = 'pg_catalog') and c.relname = 'my_locks' group by c.relname; @@ -220483,7 +220382,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - drop type lockmodes; -- -- alter function -@@ -2950,60 +3341,178 @@ +@@ -2950,60 +3339,178 @@ -- create schema alter1; create schema alter2; @@ -220676,7 +220575,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - select alter2.plus1(41); plus1 -@@ -3013,225 +3522,389 @@ +@@ -3013,225 +3520,389 @@ -- clean up drop schema alter2 cascade; @@ -221224,7 +221123,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - DROP TABLE test_tblx; DROP TYPE test_typex; -- This test isn't that interesting on its own, but the purpose is to leave -@@ -3240,6 +3913,12 @@ +@@ -3240,6 +3911,12 @@ CREATE TYPE test_type3 AS (a int); CREATE TABLE test_tbl3 (c) AS SELECT '(1)'::test_type3; ALTER TYPE test_type3 DROP ATTRIBUTE a, ADD ATTRIBUTE b int; @@ -221237,7 +221136,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - CREATE TYPE test_type_empty AS (); DROP TYPE test_type_empty; -- -@@ -3247,6 +3926,12 @@ +@@ -3247,6 +3924,12 @@ -- CREATE TYPE tt_t0 AS (z inet, x int, y numeric(8,2)); ALTER TYPE tt_t0 DROP ATTRIBUTE z; @@ -221250,7 +221149,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - CREATE TABLE tt0 (x int NOT NULL, y numeric(8,2)); -- OK CREATE TABLE tt1 (x int, y bigint); -- wrong base type CREATE TABLE tt2 (x int, y numeric(9,2)); -- wrong typmod -@@ -3254,76 +3939,128 @@ +@@ -3254,76 +3937,128 @@ CREATE TABLE tt4 (x int); -- too few columns CREATE TABLE tt5 (x int, y numeric(8,2), z int); -- too few columns CREATE TABLE tt6 () INHERITS (tt0); -- can't have a parent @@ -221410,7 +221309,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - DROP TABLE alter2.tt8; DROP SCHEMA alter2; -- -@@ -3334,32 +4071,28 @@ +@@ -3334,32 +4069,28 @@ ALTER TABLE tt9 ADD CHECK(c > 2); -- picks nonconflicting name ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 3); ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 4); -- fail, dup name @@ -221423,13 +221322,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - +ERROR: index with name "tt9_c_key" already exists ALTER TABLE tt9 ADD CONSTRAINT foo UNIQUE(c); -- fail, dup name -ERROR: constraint "foo" for relation "tt9" already exists -+ERROR: error executing StatementPhase stage 1 of 1 with 7 MutationType ops: relation "tt9" (2037): duplicate constraint name: "foo" ++ERROR: error executing StatementPhase stage 1 of 1 with 7 MutationType ops: relation "tt9" (2053): duplicate constraint name: "foo" ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key CHECK(c > 5); -- fail, dup name -ERROR: constraint "tt9_c_key" for relation "tt9" already exists -+ERROR: error executing StatementPhase stage 1 of 1 with 2 MutationType ops: relation "tt9" (2037): duplicate constraint name: "tt9_c_key" ++ERROR: error executing StatementPhase stage 1 of 1 with 2 MutationType ops: relation "tt9" (2053): duplicate constraint name: "tt9_c_key" ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key2 CHECK(c > 6); ALTER TABLE tt9 ADD UNIQUE(c); -- picks nonconflicting name -+ERROR: error executing StatementPhase stage 1 of 1 with 7 MutationType ops: relation "tt9" (2037): duplicate constraint name: "tt9_c_key2" ++ERROR: error executing StatementPhase stage 1 of 1 with 7 MutationType ops: relation "tt9" (2053): duplicate constraint name: "tt9_c_key2" \d tt9 - Table "public.tt9" - Column | Type | Collation | Nullable | Default @@ -221457,7 +221356,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - DROP TABLE tt9; -- Check that comments on constraints and indexes are not lost at ALTER TABLE. CREATE TABLE comment_test ( -@@ -3371,6 +4104,7 @@ +@@ -3371,6 +4102,7 @@ COMMENT ON COLUMN comment_test.id IS 'Column ''id'' on comment_test'; COMMENT ON INDEX comment_test_index IS 'Simple index on comment_test'; COMMENT ON CONSTRAINT comment_test_positive_col_check ON comment_test IS 'CHECK constraint on comment_test.positive_col'; @@ -221465,7 +221364,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - COMMENT ON CONSTRAINT comment_test_pk ON comment_test IS 'PRIMARY KEY constraint of comment_test'; COMMENT ON INDEX comment_test_pk IS 'Index backing the PRIMARY KEY of comment_test'; SELECT col_description('comment_test'::regclass, 1) as comment; -@@ -3387,10 +4121,10 @@ +@@ -3387,10 +4119,10 @@ (2 rows) SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2; @@ -221480,7 +221379,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - (2 rows) -- Change the datatype of all the columns. ALTER TABLE is optimized to not -@@ -3399,8 +4133,16 @@ +@@ -3399,8 +4131,16 @@ -- first, to test that no-op codepath, and another one that does. ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE int; ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE text; @@ -221497,7 +221396,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE int; ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE bigint; -- Check that the comments are intact. -@@ -3418,10 +4160,10 @@ +@@ -3418,10 +4158,10 @@ (2 rows) SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2; @@ -221512,7 +221411,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - (2 rows) -- Check compatibility for foreign keys and comments. This is done -@@ -3429,34 +4171,33 @@ +@@ -3429,34 +4169,33 @@ -- to an error and would reduce the test scope. CREATE TABLE comment_test_child ( id text CONSTRAINT comment_test_child_fk REFERENCES comment_test); @@ -221563,7 +221462,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- Check that we map relation oids to filenodes and back correctly. Only -- display bad mappings so the test output doesn't change all the time. A -- filenode function call can return NULL for a relation dropped concurrently -@@ -3468,31 +4209,28 @@ +@@ -3468,31 +4207,28 @@ FROM pg_class, pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) AS mapped_oid WHERE relkind IN ('r', 'i', 'S', 't', 'm') AND mapped_oid IS DISTINCT FROM oid; @@ -221603,11 +221502,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - ALTER TABLE new_system_table RENAME TO old_system_table; CREATE INDEX old_system_table__othercol ON old_system_table (othercol); INSERT INTO old_system_table(othercol) VALUES ('somedata'), ('otherdata'); -@@ -3500,10 +4238,16 @@ +@@ -3500,10 +4236,16 @@ DELETE FROM old_system_table WHERE othercol = 'somedata'; TRUNCATE old_system_table; ALTER TABLE old_system_table DROP CONSTRAINT new_system_table_pkey; -+ERROR: relation "old_system_table" (2040): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction ++ERROR: relation "old_system_table" (2056): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/48026/_version_ ALTER TABLE old_system_table DROP COLUMN othercol; @@ -221620,7 +221519,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- check relpersistence of an unlogged table SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1' UNION ALL -@@ -3511,21 +4255,36 @@ +@@ -3511,21 +4253,36 @@ UNION ALL SELECT r.relname || ' toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1' ORDER BY relname; @@ -221666,7 +221565,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- check relpersistence of an unlogged table after changing to permanent SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1' UNION ALL -@@ -3533,21 +4292,24 @@ +@@ -3533,21 +4290,24 @@ UNION ALL SELECT r.relname || ' toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1' ORDER BY relname; @@ -221699,7 +221598,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- check relpersistence of a permanent table SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1' UNION ALL -@@ -3555,22 +4317,40 @@ +@@ -3555,22 +4315,40 @@ UNION ALL SELECT r.relname ||' toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1' ORDER BY relname; @@ -221749,7 +221648,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- check relpersistence of a permanent table after changing to unlogged SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1' UNION ALL -@@ -3578,36 +4358,45 @@ +@@ -3578,36 +4356,45 @@ UNION ALL SELECT r.relname || ' toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1' ORDER BY relname; @@ -221814,7 +221713,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - ALTER TABLE test_add_column ADD COLUMN c2 integer; -- fail because c2 already exists ERROR: column "c2" of relation "test_add_column" already exists -@@ -3615,159 +4404,132 @@ +@@ -3615,159 +4402,132 @@ ADD COLUMN c2 integer; -- fail because c2 already exists ERROR: column "c2" of relation "test_add_column" already exists \d test_add_column @@ -222066,7 +221965,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- assorted cases with multiple ALTER TABLE steps CREATE TABLE ataddindex(f1 INT); INSERT INTO ataddindex VALUES (42), (43); -@@ -3775,100 +4537,134 @@ +@@ -3775,100 +4535,134 @@ ALTER TABLE ataddindex ADD PRIMARY KEY USING INDEX ataddindexi0, ALTER f1 TYPE BIGINT; @@ -222251,7 +222150,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- -- ATTACH PARTITION -- -@@ -3878,7 +4674,11 @@ +@@ -3878,7 +4672,11 @@ ); CREATE TABLE fail_part (like unparted); ALTER TABLE unparted ATTACH PARTITION fail_part FOR VALUES IN ('a'); @@ -222264,7 +222163,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - DROP TABLE unparted, fail_part; -- check that partition bound is compatible CREATE TABLE list_parted ( -@@ -3886,62 +4686,146 @@ +@@ -3886,62 +4684,146 @@ b char(2) COLLATE "C", CONSTRAINT check_a CHECK (a > 0) ) PARTITION BY LIST (a); @@ -222425,7 +222324,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - DROP TABLE fail_part; -- check that columns match in type, collation and NOT NULL status CREATE TABLE fail_part ( -@@ -3949,158 +4833,335 @@ +@@ -3949,158 +4831,335 @@ a int NOT NULL ); ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1); @@ -222790,7 +222689,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- Check the case where attnos of the partitioning columns in the table being -- attached differs from the parent. It should not affect the constraint- -- checking logic that allows to skip the scan. -@@ -4109,8 +5170,15 @@ +@@ -4109,8 +5168,15 @@ LIKE list_parted2, CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 6) ); @@ -222806,7 +222705,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- Similar to above, but the table being attached is a partitioned table -- whose partition has still different attnos for the root partitioning -- columns. -@@ -4118,6 +5186,14 @@ +@@ -4118,6 +5184,14 @@ LIKE list_parted2, CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7) ) PARTITION BY LIST (b); @@ -222821,7 +222720,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - CREATE TABLE part_7_a_null ( c int, d int, -@@ -4126,63 +5202,150 @@ +@@ -4126,63 +5200,150 @@ CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'), CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7) ); @@ -222985,7 +222884,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- check validation when attaching hash partitions -- Use hand-rolled hash functions and operator class to get predictable result -- on different machines. part_test_int4_ops is defined in insert.sql. -@@ -4191,233 +5354,430 @@ +@@ -4191,233 +5352,430 @@ a int, b int ) PARTITION BY HASH (a part_test_int4_ops); @@ -223500,7 +223399,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- attnum for key attribute 'a' is different in p, p1, and p11 select attrelid::regclass, attname, attnum from pg_attribute -@@ -4426,73 +5786,156 @@ +@@ -4426,73 +5784,156 @@ or attrelid = 'p1'::regclass or attrelid = 'p11'::regclass) order by attrelid::regclass::text; @@ -223669,7 +223568,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - create or replace function func_part_attach() returns trigger language plpgsql as $$ begin -@@ -4500,14 +5943,30 @@ +@@ -4500,14 +5941,28 @@ execute 'alter table tab_part_attach attach partition tab_part_attach_1 for values in (1)'; return null; end $$; @@ -223688,9 +223587,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - + create trigger trig_part_attach before insert on tab_part_attach for each statement execute procedure func_part_attach(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "tab_part_attach" does not exist insert into tab_part_attach values (1); -ERROR: cannot ALTER TABLE "tab_part_attach" because it is being used by active queries in this session -CONTEXT: SQL statement "alter table tab_part_attach attach partition tab_part_attach_1 for values in (1)" @@ -223703,7 +223600,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- test case where the partitioning operator is a SQL function whose -- evaluation results in the table's relcache being rebuilt partway through -- the execution of an ATTACH PARTITION command -@@ -4517,11 +5976,43 @@ +@@ -4517,11 +5972,43 @@ operator 1 < (int4, int4), operator 2 <= (int4, int4), operator 3 = (int4, int4), operator 4 >= (int4, int4), operator 5 > (int4, int4), function 1 at_test_sql_partop(int4, int4); @@ -223747,7 +223644,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - drop function at_test_sql_partop; /* Test case for bug #16242 */ -- We create a parent and child where the child has missing -@@ -4529,18 +6020,25 @@ +@@ -4529,18 +6016,25 @@ -- tuple conversion from the child to the parent tupdesc create table bar1 (a integer, b integer not null default 1) partition by range (a); @@ -223778,17 +223675,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - -- this exercises tuple conversion: create function xtrig() returns trigger language plpgsql -@@ -4554,22 +6052,52 @@ +@@ -4554,22 +6048,50 @@ return NULL; end; $$; -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + r record; + begin + for r in select * from old loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -223804,9 +223701,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - after update on bar1 referencing old table as old for each statement execute procedure xtrig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "bar1" does not exist update bar1 set a = a + 1; -INFO: a=1, b=1 +ERROR: relation "bar1" does not exist @@ -223832,7 +223727,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - create table atref (c1 int references attbl(p1)); alter table attbl alter column p1 set data type bigint; alter table atref alter column c1 set data type bigint; -@@ -4579,15 +6107,21 @@ +@@ -4579,15 +6101,21 @@ -- for normal indexes and indexes on constraints. create table alttype_cluster (a int); alter table alttype_cluster add primary key (a); @@ -223855,7 +223750,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - alttype_cluster_pkey | f (2 rows) -@@ -4597,19 +6131,24 @@ +@@ -4597,19 +6125,24 @@ order by indexrelid::regclass::text; indexrelid | indisclustered ----------------------+---------------- @@ -223882,7 +223777,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - (2 rows) alter table alttype_cluster alter a type int; -@@ -4619,7 +6158,7 @@ +@@ -4619,7 +6152,7 @@ indexrelid | indisclustered ----------------------+---------------- alttype_cluster_ind | f @@ -223891,7 +223786,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/alter_table.out - (2 rows) drop table alttype_cluster; -@@ -4628,38 +6167,97 @@ +@@ -4628,38 +6161,97 @@ -- to its partitions' constraint being updated to reflect the parent's -- newly added/removed constraint create table target_parted (a int, b int) partition by list (a); @@ -224013,10 +223908,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out -(1 row) +ERROR: ambiguous binary operator: + +HINT: candidates are: +++(int, int) -> int ++(inet, int) -> inet -++(date, int) -> date ++(decimal, int) -> decimal -++(int, int) -> int +++(date, int) -> date +select polyf(42) as int, polyf(4.5) as num; +ERROR: unknown function: polyf() @@ -224045,10 +223940,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out -(1 row) +ERROR: ambiguous binary operator: + +HINT: candidates are: +++(int, int) -> int ++(inet, int) -> inet -++(date, int) -> date ++(decimal, int) -> decimal -++(int, int) -> int +++(date, int) -> date +select polyf(42) as int, polyf(4.5) as num; +ERROR: unknown function: polyf() @@ -224339,6 +224234,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out 'select $1 || $2' LANGUAGE SQL; +ERROR: ambiguous binary operator: || +HINT: candidates are: ++||(varbit[], varbit[]) -> varbit[] +||(jsonb[], jsonb[]) -> jsonb[] +||(timetz[], timetz[]) -> timetz[] +||(time[], time[]) -> time[] @@ -224382,7 +224278,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out +||(varbit[], varbit) -> varbit[] +||(timetz[], timetz) -> timetz[] +||(jsonb[], jsonb) -> jsonb[] -+||(varbit[], varbit[]) -> varbit[] + -- dual non-polymorphic transfn CREATE FUNCTION tfnp(int[],int) RETURNS int[] AS @@ -224393,6 +224288,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out 'select $1+$2+$3' language sql strict; +ERROR: ambiguous binary operator: + +HINT: candidates are: +++(int, int) -> int ++(float, float) -> float ++(decimal, decimal) -> decimal ++(decimal, int) -> decimal @@ -224419,7 +224315,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out ++(decimal, pg_lsn) -> pg_lsn ++(pg_lsn, decimal) -> pg_lsn ++(vector, vector) -> vector -++(int, int) -> int + -- finalfn polymorphic CREATE FUNCTION ffp(anyarray) RETURNS anyarray AS @@ -225342,6 +225237,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out language plpgsql immutable; +ERROR: ambiguous binary operator: || (returning ) +HINT: candidates are: ++||(varbit[], varbit[]) -> varbit[] +||(jsonb[], jsonb[]) -> jsonb[] +||(timetz[], timetz[]) -> timetz[] +||(time[], time[]) -> time[] @@ -225385,7 +225281,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out +||(varbit[], varbit) -> varbit[] +||(timetz[], timetz) -> timetz[] +||(jsonb[], jsonb) -> jsonb[] -+||(varbit[], varbit[]) -> varbit[] + create aggregate build_group(anyelement, integer) ( SFUNC = add_group, @@ -225432,6 +225327,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out 'select $1 || $2' language sql immutable; +ERROR: ambiguous binary operator: || +HINT: candidates are: ++||(varbit[], varbit[]) -> varbit[] +||(jsonb[], jsonb[]) -> jsonb[] +||(timetz[], timetz[]) -> timetz[] +||(time[], time[]) -> time[] @@ -225475,7 +225371,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out +||(varbit[], varbit) -> varbit[] +||(timetz[], timetz) -> timetz[] +||(jsonb[], jsonb) -> jsonb[] -+||(varbit[], varbit[]) -> varbit[] + create function first_el(anyarray) returns anyelement as 'select $1[1]' language sql strict immutable; @@ -225951,8 +225846,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out - ^ -HINT: Could not choose a best candidate function. You might need to add explicit type casts. +ERROR: ambiguous call: dfunc(int), candidates are: -+dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8, int DEFAULT 3:::INT8, int DEFAULT 4:::INT8) -> int +dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8) -> int ++dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8, int DEFAULT 3:::INT8, int DEFAULT 4:::INT8) -> int + select dfunc(1, 2); -- fail -ERROR: function dfunc(integer, integer) is not unique @@ -225960,8 +225855,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out - ^ -HINT: Could not choose a best candidate function. You might need to add explicit type casts. +ERROR: ambiguous call: dfunc(int, int), candidates are: -+dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8, int DEFAULT 3:::INT8, int DEFAULT 4:::INT8) -> int +dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8) -> int ++dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8, int DEFAULT 3:::INT8, int DEFAULT 4:::INT8) -> int + select dfunc(1, 2, 3); -- ok dfunc @@ -226112,8 +226007,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/polymorphism.out - ^ -HINT: Could not choose a best candidate function. You might need to add explicit type casts. +ERROR: ambiguous call: dfunc(int), candidates are: -+dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8) -> int +dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8, int DEFAULT 3:::INT8) -> int ++dfunc(int DEFAULT 1:::INT8, int DEFAULT 2:::INT8) -> int + -- but this works since the ambiguous functions aren't preferred anyway select dfunc('Hi'); @@ -228495,7 +228390,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rowtypes.out --la -- -- Tests for component access / FieldSelect -- -@@ -1247,9 +1170,7 @@ +@@ -1247,9 +1170,10 @@ INSERT INTO compositetable(a, b) VALUES('fa', 'fb'); -- composite type columns can't directly be accessed (error) SELECT d.a FROM (SELECT compositetable AS d FROM compositetable) s; @@ -228503,10 +228398,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rowtypes.out --la -LINE 1: SELECT d.a FROM (SELECT compositetable AS d FROM compositeta... - ^ +ERROR: no data source matches prefix: d in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- but can be accessed with proper parens SELECT (d).a, (d).b FROM (SELECT compositetable AS d FROM compositetable) s; a | b -@@ -1259,14 +1180,10 @@ +@@ -1259,14 +1183,10 @@ -- system columns can't be accessed in composite types (error) SELECT (d).ctid FROM (SELECT compositetable AS d FROM compositetable) s; @@ -228523,7 +228421,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/rowtypes.out --la -- existing column in a NULL composite yield NULL SELECT (NULL::compositetable).a; a -@@ -1276,7 +1193,5 @@ +@@ -1276,7 +1196,5 @@ -- oids can't be accessed in composite types (error) SELECT (NULL::compositetable).oid; @@ -232175,27 +232073,29 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * -- * Trigger procedures and functions for the patchfield -@@ -103,6 +114,9 @@ +@@ -103,6 +114,10 @@ ' language plpgsql; create trigger tg_room_au after update on Room for each row execute procedure tg_room_au(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * AFTER DELETE on Room -- * - delete wall slots in this room -@@ -115,6 +129,9 @@ +@@ -115,6 +130,10 @@ ' language plpgsql; create trigger tg_room_ad after delete on Room for each row execute procedure tg_room_ad(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE INSERT or UPDATE on WSlot -- * - Check that room exists -@@ -127,8 +144,23 @@ +@@ -127,8 +146,21 @@ return new; end; $$ language plpgsql; @@ -232213,33 +232113,33 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +HINT: try \h SET SESSION create trigger tg_wslot_biu before insert or update on WSlot for each row execute procedure tg_wslot_biu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_wslot_biu() -- ************************************************************ -- * AFTER UPDATE on PField -- * - Let PSlots of this field follow -@@ -143,6 +175,9 @@ +@@ -143,6 +175,10 @@ ' language plpgsql; create trigger tg_pfield_au after update on PField for each row execute procedure tg_pfield_au(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * AFTER DELETE on PField -- * - Remove all slots of this patchfield -@@ -155,6 +190,9 @@ +@@ -155,6 +191,10 @@ ' language plpgsql; create trigger tg_pfield_ad after delete on PField for each row execute procedure tg_pfield_ad(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE INSERT or UPDATE on PSlot -- * - Ensure that our patchfield does exist -@@ -171,8 +209,28 @@ +@@ -171,8 +211,26 @@ return ps; end; $proc$ language plpgsql; @@ -232262,93 +232162,44 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + create trigger tg_pslot_biu before insert or update on PSlot for each row execute procedure tg_pslot_biu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_pslot_biu() -- ************************************************************ -- * AFTER UPDATE on System -- * - If system name changes let interfaces follow -@@ -187,6 +245,9 @@ +@@ -187,6 +245,10 @@ ' language plpgsql; create trigger tg_system_au after update on System for each row execute procedure tg_system_au(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE INSERT or UPDATE on IFace -- * - set the slotname to IF.sysname.ifname -@@ -210,8 +271,33 @@ +@@ -210,8 +272,12 @@ return new; end; $$ language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.slotname := sname -+^ -+-- -+source SQL: -+declare -+ sname text; -+ sysrec record; -+begin -+ select into sysrec * from system where name = new.sysname; -+ if not found then -+ raise exception $q$system "%" does not exist$q$, new.sysname; -+ end if; -+ sname := 'IF.' || new.sysname; -+ sname := sname || '.'; -+ sname := sname || new.ifname; -+ if length(sname) > 20 then -+ raise exception 'IFace slotname "%" too long (20 char max)', sname; -+ end if; -+ new.slotname := sname; -+ ^ ++ERROR: unimplemented: RECORD type for PL/pgSQL variables is not yet supported ++HINT: You have attempted to use a feature that is not yet implemented. ++See: https://go.crdb.dev/issue-v/114874/_version_ create trigger tg_iface_biu before insert or update on IFace for each row execute procedure tg_iface_biu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_iface_biu() -- ************************************************************ -- * AFTER INSERT or UPDATE or DELETE on Hub -- * - insert/delete/rename slots as required -@@ -240,6 +326,9 @@ +@@ -240,6 +306,7 @@ ' language plpgsql; create trigger tg_hub_a after insert or update or delete on Hub for each row execute procedure tg_hub_a(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_hub_adjustslots() -- ************************************************************ -- * Support function to add/remove slots of Hub -- ************************************************************ -@@ -262,11 +351,51 @@ - return 0; - end +@@ -264,9 +331,26 @@ ' language plpgsql; -+ERROR: at or near "i": syntax error: unimplemented: this syntax -+DETAIL: source SQL: -+begin -+ if newnslots = oldnslots then -+ return 0; -+ end if; -+ if newnslots < oldnslots then -+ delete from HSlot where hubname = hname and slotno > newnslots; -+ return 0; -+ end if; -+ for i in oldnslots + 1 .. newnslots loop -+ ^ -+HINT: You have attempted to use a feature that is not yet implemented. -+ -+Please check the public issue tracker to check whether this problem is -+already tracked. If you cannot find it there, please report the error -+with details by creating a new issue. -+ -+If you would rather not post publicly, please contact us directly -+using the support form. -+ -+We appreciate your feedback. -+ -- Test comments COMMENT ON FUNCTION tg_hub_adjustslots_wrong(bpchar, integer, integer) IS 'function with args'; -ERROR: function tg_hub_adjustslots_wrong(character, integer, integer) does not exist @@ -232375,7 +232226,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * BEFORE INSERT or UPDATE on HSlot -- * - prevent from manual manipulation -@@ -300,8 +429,20 @@ +@@ -300,8 +384,18 @@ return new; end; ' language plpgsql; @@ -232390,13 +232241,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +See: https://go.crdb.dev/issue-v/114676/_version_ create trigger tg_hslot_biu before insert or update on HSlot for each row execute procedure tg_hslot_biu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_hslot_biu() -- ************************************************************ -- * BEFORE DELETE on HSlot -- * - prevent from manual manipulation -@@ -320,8 +461,14 @@ +@@ -320,8 +414,12 @@ raise exception ''no manual manipulation of HSlot''; end; ' language plpgsql; @@ -232405,197 +232254,184 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +See: https://go.crdb.dev/issue-v/114874/_version_ create trigger tg_hslot_bd before delete on HSlot for each row execute procedure tg_hslot_bd(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_hslot_bd() -- ************************************************************ -- * BEFORE INSERT on all slots -- * - Check name prefix -@@ -336,14 +483,29 @@ +@@ -336,14 +434,34 @@ ' language plpgsql; create trigger tg_chkslotname before insert on PSlot for each row execute procedure tg_chkslotname('PS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotname before insert on WSlot for each row execute procedure tg_chkslotname('WS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotname before insert on PLine for each row execute procedure tg_chkslotname('PL'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotname before insert on IFace for each row execute procedure tg_chkslotname('IF'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotname before insert on PHone for each row execute procedure tg_chkslotname('PH'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE INSERT or UPDATE on all slots with slotlink -- * - Set slotlink to empty string if NULL value given -@@ -356,16 +518,41 @@ - return new; - end; +@@ -358,14 +476,34 @@ ' language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.slotlink := '' -+^ -+-- -+source SQL: -+begin -+ if new.slotlink isnull then -+ new.slotlink := ''; -+ ^ create trigger tg_chkslotlink before insert or update on PSlot for each row execute procedure tg_chkslotlink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotlink before insert or update on WSlot for each row execute procedure tg_chkslotlink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotlink before insert or update on IFace for each row execute procedure tg_chkslotlink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotlink before insert or update on HSlot for each row execute procedure tg_chkslotlink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkslotlink before insert or update on PHone for each row execute procedure tg_chkslotlink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE INSERT or UPDATE on all slots with backlink -- * - Set backlink to empty string if NULL value given -@@ -378,12 +565,31 @@ - return new; - end; +@@ -380,10 +518,22 @@ ' language plpgsql; -+ERROR: at or near ";": at or near "new": syntax error -+DETAIL: source SQL: -+new.backlink := '' -+^ -+-- -+source SQL: -+begin -+ if new.backlink isnull then -+ new.backlink := ''; -+ ^ create trigger tg_chkbacklink before insert or update on PSlot for each row execute procedure tg_chkbacklink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkbacklink before insert or update on WSlot for each row execute procedure tg_chkbacklink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ create trigger tg_chkbacklink before insert or update on PLine for each row execute procedure tg_chkbacklink(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: new in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on PSlot -- * - do delete/insert instead of update if name changes -@@ -410,6 +616,9 @@ +@@ -410,6 +560,10 @@ ' language plpgsql; create trigger tg_pslot_bu before update on PSlot for each row execute procedure tg_pslot_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on WSlot -- * - do delete/insert instead of update if name changes -@@ -436,6 +645,9 @@ +@@ -436,6 +590,10 @@ ' language plpgsql; create trigger tg_wslot_bu before update on WSlot for each row execute procedure tg_Wslot_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on PLine -- * - do delete/insert instead of update if name changes -@@ -462,6 +674,9 @@ +@@ -462,6 +620,10 @@ ' language plpgsql; create trigger tg_pline_bu before update on PLine for each row execute procedure tg_pline_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on IFace -- * - do delete/insert instead of update if name changes -@@ -488,6 +703,9 @@ +@@ -488,6 +650,10 @@ ' language plpgsql; create trigger tg_iface_bu before update on IFace for each row execute procedure tg_iface_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on HSlot -- * - do delete/insert instead of update if name changes -@@ -514,6 +732,9 @@ +@@ -514,6 +680,10 @@ ' language plpgsql; create trigger tg_hslot_bu before update on HSlot for each row execute procedure tg_hslot_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * BEFORE UPDATE on PHone -- * - do delete/insert instead of update if name changes -@@ -538,6 +759,9 @@ +@@ -538,6 +708,10 @@ ' language plpgsql; create trigger tg_phone_bu before update on PHone for each row execute procedure tg_phone_bu(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: no data source matches prefix: old in this context ++HINT: to access a field of a composite-typed column or variable, surround the column/variable name in parentheses: (varName).fieldName ++-- ++See: https://go.crdb.dev/issue-v/114687/_version_ -- ************************************************************ -- * AFTER INSERT or UPDATE or DELETE on slot with backlink -- * - Ensure that the opponent correctly points back to us -@@ -577,10 +801,19 @@ +@@ -577,10 +751,13 @@ ' language plpgsql; create trigger tg_backlink_a after insert or update or delete on PSlot for each row execute procedure tg_backlink_a('PS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_backlink_unset() create trigger tg_backlink_a after insert or update or delete on WSlot for each row execute procedure tg_backlink_a('WS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_backlink_unset() create trigger tg_backlink_a after insert or update or delete on PLine for each row execute procedure tg_backlink_a('PL'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_backlink_unset() -- ************************************************************ -- * Support function to set the opponents backlink field -- * if it does not already point to the requested slot -@@ -635,6 +868,9 @@ +@@ -635,6 +812,9 @@ raise exception ''illegal backlink beginning with %'', mytype; end; ' language plpgsql; @@ -232605,7 +232441,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * Support function to clear out the backlink field if -- * it still points to specific slot -@@ -680,6 +916,11 @@ +@@ -680,6 +860,11 @@ end if; end ' language plpgsql; @@ -232617,37 +232453,27 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * AFTER INSERT or UPDATE or DELETE on slot with slotlink -- * - Ensure that the opponent correctly points back to us -@@ -719,14 +960,29 @@ +@@ -719,14 +904,19 @@ ' language plpgsql; create trigger tg_slotlink_a after insert or update or delete on PSlot for each row execute procedure tg_slotlink_a('PS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_slotlink_unset() create trigger tg_slotlink_a after insert or update or delete on WSlot for each row execute procedure tg_slotlink_a('WS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_slotlink_unset() create trigger tg_slotlink_a after insert or update or delete on IFace for each row execute procedure tg_slotlink_a('IF'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_slotlink_unset() create trigger tg_slotlink_a after insert or update or delete on HSlot for each row execute procedure tg_slotlink_a('HS'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_slotlink_unset() create trigger tg_slotlink_a after insert or update or delete on PHone for each row execute procedure tg_slotlink_a('PH'); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: tg_slotlink_unset() -- ************************************************************ -- * Support function to set the opponents slotlink field -- * if it does not already point to the requested slot -@@ -811,6 +1067,11 @@ +@@ -811,6 +1001,11 @@ raise exception ''illegal slotlink beginning with %'', mytype; end; ' language plpgsql; @@ -232659,7 +232485,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * Support function to clear out the slotlink field if -- * it still points to specific slot -@@ -876,6 +1137,11 @@ +@@ -876,6 +1071,11 @@ end if; end; ' language plpgsql; @@ -232671,7 +232497,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * Describe the backside of a patchfield slot -- ************************************************************ -@@ -919,6 +1185,9 @@ +@@ -919,6 +1119,9 @@ return rec.backlink; end; ' language plpgsql; @@ -232681,7 +232507,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * Describe the front of a patchfield slot -- ************************************************************ -@@ -953,54 +1222,83 @@ +@@ -953,54 +1156,83 @@ return psrec.slotlink; end; ' language plpgsql; @@ -232710,9 +232536,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab end if; - if rec.slotlink = '''' then - return ''-''; -+ if psrec.slotlink = '' then -+ return '-'; - end if; +- end if; - sltype := substr(rec.slotlink, 1, 2); - if sltype = ''PH'' then - select into rec * from PHone where slotname = rec.slotlink; @@ -232723,7 +232547,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab - retval := retval || '')''; - end if; - return retval; -- end if; ++ if psrec.slotlink = '' then ++ return '-'; + end if; - if sltype = ''IF'' then - declare - syrow System%RowType; @@ -232805,7 +232631,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ************************************************************ -- * View of a patchfield describing backside and patches -- ************************************************************ -@@ -1008,6 +1306,8 @@ +@@ -1008,6 +1240,8 @@ pslot_backlink_view(PF.slotname) as backside, pslot_slotlink_view(PF.slotname) as patch from PSlot PF; @@ -232814,7 +232640,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- First we build the house - so we create the rooms -- -@@ -1146,8 +1446,8 @@ +@@ -1146,8 +1380,8 @@ select * from WSlot where roomno = '001' order by slotname; slotname | roomno | slotlink | backlink ----------------------+----------+----------------------+---------------------- @@ -232825,7 +232651,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.2a | 001 | | WS.001.2b | 001 | | WS.001.3a | 001 | | -@@ -1169,9 +1469,9 @@ +@@ -1169,9 +1403,9 @@ select * from WSlot where roomno = '001' order by slotname; slotname | roomno | slotlink | backlink ----------------------+----------+----------------------+---------------------- @@ -232837,7 +232663,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.2b | 001 | | WS.001.3a | 001 | | WS.001.3b | 001 | | -@@ -1192,9 +1492,9 @@ +@@ -1192,9 +1426,9 @@ select * from WSlot where roomno = '001' order by slotname; slotname | roomno | slotlink | backlink ----------------------+----------+----------------------+---------------------- @@ -232850,7 +232676,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.2b | 001 | | WS.001.3a | 001 | | WS.001.3b | 001 | | -@@ -1221,9 +1521,9 @@ +@@ -1221,9 +1455,9 @@ select * from WSlot where roomno = '001' order by slotname; slotname | roomno | slotlink | backlink ----------------------+----------+----------------------+---------------------- @@ -232863,7 +232689,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.2b | 001 | | PS.base.a4 WS.001.3a | 001 | | PS.base.a6 WS.001.3b | 001 | | -@@ -1235,20 +1535,20 @@ +@@ -1235,20 +1469,20 @@ PS.base.a1 | PF0_1 | | WS.001.1a PS.base.a2 | PF0_1 | | WS.001.1b PS.base.a3 | PF0_1 | | WS.001.2a @@ -232890,7 +232716,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.3b | 001 | | PS.base.a6 (6 rows) -@@ -1258,18 +1558,18 @@ +@@ -1258,18 +1492,18 @@ PS.base.a1 | PF0_1 | | WS.001.1a PS.base.a2 | PF0_1 | | WS.001.1b PS.base.a3 | PF0_1 | | WS.001.2a @@ -232914,7 +232740,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab WS.001.2b | 001 | | PS.base.a4 WS.001.3a | 001 | | PS.base.a5 WS.001.3b | 001 | | PS.base.a6 -@@ -1281,9 +1581,9 @@ +@@ -1281,9 +1515,9 @@ PS.base.a1 | PF0_1 | | WS.001.1a PS.base.a2 | PF0_1 | | WS.001.1b PS.base.a3 | PF0_1 | | WS.001.2a @@ -232927,7 +232753,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (6 rows) insert into PField values ('PF1_2', 'Phonelines first floor'); -@@ -1309,9 +1609,9 @@ +@@ -1309,9 +1543,9 @@ PS.base.a1 | PF0_1 | | WS.001.1a PS.base.a2 | PF0_1 | | WS.001.1b PS.base.a3 | PF0_1 | | WS.001.2a @@ -232940,7 +232766,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab PS.base.b1 | PF0_1 | | WS.002.1a PS.base.b2 | PF0_1 | | WS.002.1b PS.base.b3 | PF0_1 | | WS.002.2a -@@ -1324,18 +1624,18 @@ +@@ -1324,18 +1558,18 @@ PS.base.c4 | PF0_1 | | WS.003.2b PS.base.c5 | PF0_1 | | WS.003.3a PS.base.c6 | PF0_1 | | WS.003.3b @@ -232971,7 +232797,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab PS.first.a1 | PF1_1 | | WS.101.1a PS.first.a2 | PF1_1 | | WS.101.1b PS.first.a3 | PF1_1 | | WS.101.2a -@@ -1377,48 +1677,48 @@ +@@ -1377,48 +1611,48 @@ select * from WSlot order by slotname; slotname | roomno | slotlink | backlink ----------------------+----------+----------------------+---------------------- @@ -233059,7 +232885,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (42 rows) -- -@@ -1471,82 +1771,22 @@ +@@ -1471,82 +1705,22 @@ -- Now we take a look at the patchfield -- select * from PField_v1 where pfname = 'PF0_1' order by slotname; @@ -233144,7 +232970,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- The following tests are unrelated to the scenario outlined above; -- they merely exercise specific parts of PL/pgSQL -@@ -1564,12 +1804,9 @@ +@@ -1564,12 +1738,9 @@ END IF; RETURN rslt; END;' LANGUAGE plpgsql; @@ -233159,48 +232985,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test the FOUND magic variable -- -@@ -1609,22 +1846,44 @@ +@@ -1609,22 +1780,13 @@ end if; return true; end;' language plpgsql; --select test_found(); ++ERROR: column "found" does not exist + select test_found(); - test_found ------------- - t -(1 row) -+ERROR: at or near "i": syntax error: unimplemented: this syntax -+DETAIL: source SQL: -+declare -+ begin -+ insert into found_test_tbl values (1); -+ if FOUND then -+ insert into found_test_tbl values (2); -+ end if; - -+ update found_test_tbl set a = 100 where a = 1; -+ if FOUND then -+ insert into found_test_tbl values (3); -+ end if; -+ -+ delete from found_test_tbl where a = 9999; -- matches no rows -+ if not FOUND then -+ insert into found_test_tbl values (4); -+ end if; -+ -+ for i in 1 .. 10 loop -+ ^ -+HINT: You have attempted to use a feature that is not yet implemented. -+ -+Please check the public issue tracker to check whether this problem is -+already tracked. If you cannot find it there, please report the error -+with details by creating a new issue. -+ -+If you would rather not post publicly, please contact us directly -+using the support form. -+ -+We appreciate your feedback. -+ -+select test_found(); +- +ERROR: unknown function: test_found() select * from found_test_tbl; - a @@ -233218,7 +233013,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test set-returning functions for PL/pgSQL -@@ -1638,17 +1897,11 @@ +@@ -1638,17 +1800,11 @@ END LOOP; RETURN; END;' language plpgsql; @@ -233240,7 +233035,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function test_table_func_row() returns setof found_test_tbl as ' DECLARE row found_test_tbl%ROWTYPE; -@@ -1658,17 +1911,11 @@ +@@ -1658,17 +1814,11 @@ END LOOP; RETURN; END;' language plpgsql; @@ -233262,7 +233057,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function test_ret_set_scalar(int,int) returns setof int as ' DECLARE i int; -@@ -1678,21 +1925,11 @@ +@@ -1678,21 +1828,11 @@ END LOOP; RETURN; END;' language plpgsql; @@ -233288,7 +233083,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function test_ret_set_rec_dyn(int) returns setof record as ' DECLARE retval RECORD; -@@ -1708,20 +1945,21 @@ +@@ -1708,20 +1848,21 @@ END IF; RETURN; END;' language plpgsql; @@ -233322,7 +233117,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function test_ret_rec_dyn(int) returns record as ' DECLARE retval RECORD; -@@ -1734,18 +1972,21 @@ +@@ -1734,18 +1875,21 @@ RETURN retval; END IF; END;' language plpgsql; @@ -233354,7 +233149,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test some simple polymorphism cases. -- -@@ -1753,31 +1994,37 @@ +@@ -1753,31 +1897,37 @@ begin return x + 1; end$$ language plpgsql; @@ -233365,10 +233160,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -(1 row) +ERROR: ambiguous binary operator: + +HINT: candidates are: +++(int, int) -> int ++(inet, int) -> inet -++(date, int) -> date ++(decimal, int) -> decimal -++(int, int) -> int +++(date, int) -> date +select f1(42) as int, f1(4.5) as num; +ERROR: unknown function: f1() @@ -233396,10 +233191,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -(1 row) +ERROR: ambiguous binary operator: + +HINT: candidates are: +++(int, int) -> int ++(inet, int) -> inet -++(date, int) -> date ++(decimal, int) -> decimal -++(int, int) -> int +++(date, int) -> date +select f1(42) as int, f1(4.5) as num; +ERROR: unknown function: f1() @@ -233408,7 +233203,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function f1(x anyarray) returns anyelement as $$ begin return x[1]; -@@ -1789,7 +2036,10 @@ +@@ -1789,7 +1939,10 @@ (1 row) select f1(stavalues1) from pg_statistic; -- fail, can't infer element type @@ -233420,7 +233215,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop function f1(x anyarray); create function f1(x anyarray) returns anyarray as $$ begin -@@ -1802,72 +2052,61 @@ +@@ -1802,72 +1955,61 @@ (1 row) select f1(stavalues1) from pg_statistic; -- fail, can't infer element type @@ -233512,7 +233307,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function f1(a anyelement, b anyarray, c anycompatible, d anycompatible, OUT x anyarray, OUT y anycompatiblearray) -@@ -1876,35 +2115,30 @@ +@@ -1876,35 +2018,30 @@ x := a || b; y := array[c, d]; end$$ language plpgsql; @@ -233562,7 +233357,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test handling of OUT parameters, including polymorphic cases. -- Note that RETURN is optional with OUT params; we try both ways. -@@ -1915,8 +2149,6 @@ +@@ -1915,8 +2052,6 @@ return i+1; end$$ language plpgsql; ERROR: RETURN cannot have a parameter in function with OUT parameters @@ -233571,7 +233366,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function f1(in i int, out j int) as $$ begin j := i+1; -@@ -1959,14 +2191,27 @@ +@@ -1959,14 +2094,27 @@ return next; return; end$$ language plpgsql; @@ -233605,7 +233400,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function f1(in i int, out j int, out k text) as $$ begin j := i; -@@ -1995,14 +2240,28 @@ +@@ -1995,14 +2143,28 @@ k := 'foot'; return next; end$$ language plpgsql; @@ -233623,11 +233418,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + return next; + ^ +HINT: You have attempted to use a feature that is not yet implemented. -+ + +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. - ++ +If you would rather not post publicly, please contact us directly +using the support form. + @@ -233640,7 +233435,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function duplic(in i anyelement, out j anyelement, out k anyarray) as $$ begin j := i; -@@ -2028,19 +2287,13 @@ +@@ -2028,19 +2190,13 @@ k := array[lower(i),upper(i)]; return; end$$ language plpgsql; @@ -233664,7 +233459,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- test PERFORM -- -@@ -2057,6 +2310,7 @@ +@@ -2057,6 +2213,7 @@ RETURN FALSE; END IF; END;' language plpgsql; @@ -233672,7 +233467,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function perform_test_func() returns void as ' BEGIN IF FOUND then -@@ -2077,19 +2331,32 @@ +@@ -2077,19 +2234,32 @@ RETURN; END;' language plpgsql; @@ -233687,7 +233482,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + IF FOUND then + INSERT INTO perform_test VALUES (100, 100); + END IF; -+ + + PERFORM perform_simple_func(5); + ^ +HINT: You have attempted to use a feature that is not yet implemented. @@ -233695,7 +233490,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. - ++ +If you would rather not post publicly, please contact us directly +using the support form. + @@ -233716,7 +233511,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop table perform_test; -- -@@ -2103,19 +2370,12 @@ +@@ -2103,19 +2273,12 @@ if found then return x; end if; return 0; end$$ language plpgsql stable; @@ -233739,7 +233534,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function sp_add_user(a_login text) returns int as $$ declare my_id_user int; begin -@@ -2130,38 +2390,21 @@ +@@ -2130,38 +2293,21 @@ END IF; RETURN my_id_user; end$$ language plpgsql; @@ -233786,7 +233581,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- tests for refcursors -- -@@ -2185,12 +2428,13 @@ +@@ -2185,12 +2331,13 @@ return x.a; end $$ language plpgsql; @@ -233805,7 +233600,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function return_refcursor(rc refcursor) returns refcursor as $$ begin open rc for select a from rc_test; -@@ -2203,33 +2447,31 @@ +@@ -2203,33 +2350,31 @@ return $1; end $$ language plpgsql; @@ -233859,7 +233654,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab commit; -- should fail fetch next from test1; -@@ -2249,13 +2491,25 @@ +@@ -2249,13 +2394,25 @@ end if; end $$ language plpgsql; @@ -233890,7 +233685,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- should fail create function constant_refcursor() returns refcursor as $$ declare -@@ -2266,8 +2520,11 @@ +@@ -2266,8 +2423,11 @@ end $$ language plpgsql; select constant_refcursor(); @@ -233904,7 +233699,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- but it's okay like this create or replace function constant_refcursor() returns refcursor as $$ declare -@@ -2301,13 +2558,25 @@ +@@ -2301,13 +2461,25 @@ end if; end $$ language plpgsql; @@ -233935,7 +233730,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- mixing named and positional argument notations create function namedparmcursor_test2(int, int) returns boolean as $$ declare -@@ -2324,12 +2593,24 @@ +@@ -2324,12 +2496,24 @@ end if; end $$ language plpgsql; @@ -233965,7 +233760,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- mixing named and positional: param2 is given twice, once in named notation -- and second time in positional notation. Should throw an error at parse time create function namedparmcursor_test3() returns void as $$ -@@ -2339,9 +2620,22 @@ +@@ -2339,9 +2523,22 @@ open c1(param2 := 20, 21); end $$ language plpgsql; @@ -233991,7 +233786,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- mixing named and positional: same as previous test, but param1 is duplicated create function namedparmcursor_test4() returns void as $$ declare -@@ -2350,9 +2644,22 @@ +@@ -2350,9 +2547,22 @@ open c1(20, param1 := 21); end $$ language plpgsql; @@ -234017,7 +233812,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- duplicate named parameter, should throw an error at parse time create function namedparmcursor_test5() returns void as $$ declare -@@ -2362,9 +2669,22 @@ +@@ -2362,9 +2572,22 @@ open c1 (p2 := 77, p2 := 42); end $$ language plpgsql; @@ -234043,7 +233838,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- not enough parameters, should throw an error at parse time create function namedparmcursor_test6() returns void as $$ declare -@@ -2374,9 +2694,22 @@ +@@ -2374,9 +2597,22 @@ open c1 (p2 := 77); end $$ language plpgsql; @@ -234069,7 +233864,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- division by zero runtime error, the context given in the error message -- should be sensible create function namedparmcursor_test7() returns void as $$ -@@ -2386,10 +2719,24 @@ +@@ -2386,10 +2622,24 @@ begin open c1 (p2 := 77, p1 := 42/0); end $$ language plpgsql; @@ -234097,7 +233892,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- check that line comments work correctly within the argument list (there -- is some special handling of this case in the code: the newline after the -- comment must be preserved when the argument-evaluating query is -@@ -2406,12 +2753,24 @@ +@@ -2406,12 +2656,24 @@ fetch c1 into n; return n; end $$ language plpgsql; @@ -234112,14 +233907,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + c1 cursor (p1 int, p2 int) for + ^ +HINT: You have attempted to use a feature that is not yet implemented. -+ + +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. + +If you would rather not post publicly, please contact us directly +using the support form. - ++ +We appreciate your feedback. + +select namedparmcursor_test8(); @@ -234127,7 +233922,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- cursor parameter name can match plpgsql variable or unreserved keyword create function namedparmcursor_test9(p1 int) returns int4 as $$ declare -@@ -2425,12 +2784,24 @@ +@@ -2425,12 +2687,24 @@ fetch c1 into n; return n; end $$ language plpgsql; @@ -234157,7 +233952,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- tests for "raise" processing -- -@@ -2441,28 +2812,22 @@ +@@ -2441,28 +2715,22 @@ end; $$ language plpgsql; ERROR: too many parameters specified for RAISE @@ -234189,7 +233984,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Test re-RAISE inside a nested exception block. This case is allowed -- by Oracle's PL/SQL but was handled differently by PG before 9.1. CREATE FUNCTION reraise_test() RETURNS void AS $$ -@@ -2484,14 +2849,30 @@ +@@ -2484,14 +2752,30 @@ raise notice 'WRONG - exception % caught in outer block', sqlerrm; END; $$ LANGUAGE plpgsql; @@ -234212,14 +234007,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + RAISE; + ^ +HINT: You have attempted to use a feature that is not yet implemented. - ++ +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. + +If you would rather not post publicly, please contact us directly +using the support form. -+ + +We appreciate your feedback. + +SELECT reraise_test(); @@ -234227,7 +234022,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- reject function definitions that contain malformed SQL queries at -- compile-time, where possible -@@ -2504,9 +2885,17 @@ +@@ -2504,9 +2788,17 @@ a := 10; return a; end$$ language plpgsql; @@ -234248,19 +234043,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function bad_sql2() returns int as $$ declare r record; begin -@@ -2515,81 +2904,115 @@ +@@ -2515,81 +2807,115 @@ end loop; return 5; end;$$ language plpgsql; -ERROR: syntax error at or near "the" -LINE 4: for r in select I fought the law, the law won LOOP - ^ -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare r record; +begin + for r in select I fought the law, the law won LOOP -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -234309,10 +234104,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. -+ + +If you would rather not post publicly, please contact us directly +using the support form. - ++ +We appreciate your feedback. + +-- select void_return_expr(); @@ -234406,7 +234201,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- SQLSTATE and SQLERRM test -- -@@ -2597,14 +3020,11 @@ +@@ -2597,14 +2923,11 @@ begin raise notice '% %', sqlstate, sqlerrm; end; $$ language plpgsql; @@ -234423,7 +234218,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function excpt_test2() returns void as $$ begin begin -@@ -2613,13 +3033,10 @@ +@@ -2613,13 +2936,10 @@ end; end; end; $$ language plpgsql; @@ -234439,7 +234234,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function excpt_test3() returns void as $$ begin begin -@@ -2639,31 +3056,61 @@ +@@ -2639,31 +2959,61 @@ raise notice '% %', sqlstate, sqlerrm; end; end; $$ language plpgsql; @@ -234515,7 +234310,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- parameters of raise stmt can be expressions create function raise_exprs() returns void as $$ declare -@@ -2714,13 +3161,11 @@ +@@ -2714,13 +3064,11 @@ insert into foo values(5,6) returning * into x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234533,7 +234328,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2728,10 +3173,11 @@ +@@ -2728,10 +3076,11 @@ insert into foo values(7,8),(9,10) returning * into x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234548,7 +234343,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2739,13 +3185,11 @@ +@@ -2739,13 +3088,11 @@ execute 'insert into foo values(5,6) returning *' into x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234566,7 +234361,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2753,23 +3197,17 @@ +@@ -2753,23 +3100,17 @@ execute 'insert into foo values(7,8),(9,10) returning *' into x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234595,7 +234390,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; -@@ -2778,13 +3216,11 @@ +@@ -2778,13 +3119,11 @@ select * from foo where f1 = 3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234613,7 +234408,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2792,9 +3228,11 @@ +@@ -2792,9 +3131,11 @@ select * from foo where f1 = 0 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234627,7 +234422,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2802,10 +3240,11 @@ +@@ -2802,10 +3143,11 @@ select * from foo where f1 > 3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234642,7 +234437,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2813,13 +3252,11 @@ +@@ -2813,13 +3155,11 @@ execute 'select * from foo where f1 = 3' into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234660,7 +234455,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2827,9 +3264,11 @@ +@@ -2827,9 +3167,11 @@ execute 'select * from foo where f1 = 0' into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234674,7 +234469,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2837,12 +3276,17 @@ +@@ -2837,12 +3179,17 @@ execute 'select * from foo where f1 > 3' into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234694,7 +234489,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; -@@ -2853,10 +3297,11 @@ +@@ -2853,10 +3200,11 @@ select * from foo where f1 = p1 and f1::text = p3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234709,7 +234504,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; -@@ -2867,10 +3312,11 @@ +@@ -2867,10 +3215,11 @@ select * from foo where f1 = p1 and f1::text = p3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234724,7 +234519,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; -@@ -2881,11 +3327,11 @@ +@@ -2881,11 +3230,11 @@ select * from foo where f1 > p1 or f1::text = p3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234740,7 +234535,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2893,10 +3339,11 @@ +@@ -2893,10 +3242,11 @@ select * from foo where f1 > 3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234755,7 +234550,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2904,10 +3351,11 @@ +@@ -2904,10 +3254,11 @@ execute 'select * from foo where f1 = $1 or f1::text = $2' using 0, 'foo' into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234770,7 +234565,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2915,10 +3363,11 @@ +@@ -2915,10 +3266,11 @@ execute 'select * from foo where f1 > $1' using 1 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234785,7 +234580,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ declare x record; begin -@@ -2926,9 +3375,11 @@ +@@ -2926,9 +3278,11 @@ execute 'select * from foo where f1 > 3' into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234799,7 +234594,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stricttest() returns void as $$ -- override the global #print_strict_params off -@@ -2941,10 +3392,12 @@ +@@ -2941,10 +3295,12 @@ select * from foo where f1 > p1 or f1::text = p3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234815,7 +234610,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab reset plpgsql.print_strict_params; create or replace function stricttest() returns void as $$ -- override the global -@@ -2958,11 +3411,12 @@ +@@ -2958,11 +3314,12 @@ select * from foo where f1 > p1 or f1::text = p3 into strict x; raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2; end$$ language plpgsql; @@ -234832,7 +234627,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test warnings and errors set plpgsql.extra_warnings to 'all'; set plpgsql.extra_warnings to 'none'; -@@ -2979,23 +3433,18 @@ +@@ -2979,23 +3336,18 @@ begin end $$ language plpgsql; @@ -234865,7 +234660,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function shadowtest(in1 int) returns table (out1 int) as $$ declare -@@ -3004,18 +3453,17 @@ +@@ -3004,18 +3356,17 @@ begin end $$ language plpgsql; @@ -234893,7 +234688,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- shadowing in a second DECLARE block create or replace function shadowtest() returns void as $$ -@@ -3027,10 +3475,13 @@ +@@ -3027,10 +3378,13 @@ begin end; end$$ language plpgsql; @@ -234910,7 +234705,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- several levels of shadowing create or replace function shadowtest(in1 int) returns void as $$ -@@ -3042,13 +3493,13 @@ +@@ -3042,13 +3396,13 @@ begin end; end$$ language plpgsql; @@ -234930,7 +234725,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- shadowing in cursor definitions create or replace function shadowtest() returns void as $$ -@@ -3057,34 +3508,49 @@ +@@ -3057,34 +3411,49 @@ c1 cursor (f1 int) for select 1; begin end$$ language plpgsql; @@ -234995,7 +234790,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- runtime extra checks set plpgsql.extra_warnings to 'too_many_rows'; do $$ -@@ -3093,8 +3559,10 @@ +@@ -3093,8 +3462,10 @@ select v from generate_series(1,2) g(v) into x; end; $$; @@ -235008,7 +234803,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab set plpgsql.extra_errors to 'too_many_rows'; do $$ declare x int; -@@ -3102,9 +3570,10 @@ +@@ -3102,9 +3473,10 @@ select v from generate_series(1,2) g(v) into x; end; $$; @@ -235022,7 +234817,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab reset plpgsql.extra_errors; reset plpgsql.extra_warnings; set plpgsql.extra_warnings to 'strict_multi_assignment'; -@@ -3118,12 +3587,10 @@ +@@ -3118,12 +3490,10 @@ select 1,2,3 into x, y; end $$; @@ -235039,7 +234834,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab set plpgsql.extra_errors to 'strict_multi_assignment'; do $$ declare -@@ -3135,10 +3602,10 @@ +@@ -3135,10 +3505,10 @@ select 1,2,3 into x, y; end $$; @@ -235054,7 +234849,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create table test_01(a int, b int, c int); alter table test_01 drop column a; -- the check is active only when source table is not empty -@@ -3153,11 +3620,10 @@ +@@ -3153,11 +3523,10 @@ select * from test_01 into x; -- should to fail end; $$; @@ -235070,7 +234865,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare t test_01; -@@ -3167,11 +3633,10 @@ +@@ -3167,11 +3536,10 @@ select 1, 2, 3 into t; -- should fail; end; $$; @@ -235086,7 +234881,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare t test_01; -@@ -3179,10 +3644,10 @@ +@@ -3179,10 +3547,10 @@ select 1 into t; -- should fail; end; $$; @@ -235101,7 +234896,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop table test_01; reset plpgsql.extra_errors; reset plpgsql.extra_warnings; -@@ -3201,16 +3666,11 @@ +@@ -3201,16 +3569,11 @@ close c; end; $$ language plpgsql; @@ -235122,7 +234917,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c no scroll cursor for select f1 from int4_tbl; -@@ -3225,10 +3685,11 @@ +@@ -3225,10 +3588,11 @@ close c; end; $$ language plpgsql; @@ -235137,7 +234932,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c refcursor; -@@ -3243,16 +3704,11 @@ +@@ -3243,16 +3607,11 @@ close c; end; $$ language plpgsql; @@ -235158,7 +234953,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c refcursor; -@@ -3267,14 +3723,11 @@ +@@ -3267,14 +3626,11 @@ close c; end; $$ language plpgsql; @@ -235177,7 +234972,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c refcursor; -@@ -3290,13 +3743,11 @@ +@@ -3290,13 +3646,11 @@ close c; end; $$ language plpgsql; @@ -235195,7 +234990,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c cursor for select * from generate_series(1, 10); -@@ -3316,14 +3767,11 @@ +@@ -3316,14 +3670,11 @@ close c; end; $$ language plpgsql; @@ -235214,7 +235009,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function sc_test() returns setof integer as $$ declare c cursor for select * from generate_series(1, 10); -@@ -3338,13 +3786,13 @@ +@@ -3338,13 +3689,13 @@ close c; end; $$ language plpgsql; @@ -235233,7 +235028,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test qualified variable names create function pl_qual_names (param1 int) returns void as $$ <> -@@ -3362,17 +3810,15 @@ +@@ -3362,17 +3713,15 @@ end; end; $$ language plpgsql; @@ -235258,7 +235053,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- tests for RETURN QUERY create function ret_query1(out int, out int) returns setof record as $$ begin -@@ -3383,24 +3829,13 @@ +@@ -3383,24 +3732,13 @@ return next; end; $$ language plpgsql; @@ -235289,7 +235084,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create type record_type as (x text, y int, z boolean); create or replace function ret_query2(lim int) returns setof record_type as $$ begin -@@ -3408,20 +3843,11 @@ +@@ -3408,20 +3746,11 @@ from generate_series(-8, lim) s (x) where s.x % 2 = 0; end; $$ language plpgsql; @@ -235314,7 +235109,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test EXECUTE USING create function exc_using(int, text) returns int as $$ declare i int; -@@ -3433,19 +3859,27 @@ +@@ -3433,19 +3762,27 @@ return i; end $$ language plpgsql; @@ -235329,12 +235124,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab ------------ - 26 -(1 row) -+ERROR: at or near "i": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare i int; +begin + for i in execute 'select * from generate_series(1,$1)' using $1+1 loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. +Please check the public issue tracker to check whether this problem is @@ -235353,7 +235148,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function exc_using(int) returns void as $$ declare c refcursor; -@@ -3461,19 +3895,29 @@ +@@ -3461,19 +3798,29 @@ return; end; $$ language plpgsql; @@ -235377,7 +235172,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + open c for execute 'select * from generate_series(1,$1)' using $1+1; + ^ +HINT: You have attempted to use a feature that is not yet implemented. - ++ +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. @@ -235386,7 +235181,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +using the support form. + +We appreciate your feedback. -+ + +select exc_using(5); +ERROR: unknown function: exc_using() drop function exc_using(int); @@ -235394,7 +235189,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test FOR-over-cursor create or replace function forc01() returns void as $$ declare -@@ -3513,29 +3957,24 @@ +@@ -3513,29 +3860,24 @@ return; end; $$ language plpgsql; @@ -235430,18 +235225,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. -+ + +If you would rather not post publicly, please contact us directly +using the support form. + +We appreciate your feedback. - ++ +select forc01(); +ERROR: unknown function: forc01() -- try updating the cursor's current row create temp table forc_test as select n as i, n as j from generate_series(1,10) n; -@@ -3549,35 +3988,39 @@ +@@ -3549,35 +3891,39 @@ end loop; end; $$ language plpgsql; @@ -235460,15 +235255,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------- - -(1 row) -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + c cursor for select * from forc_test; +begin + for r in c loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -+ + +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. @@ -235477,7 +235272,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +using the support form. + +We appreciate your feedback. - ++ +select forc01(); +ERROR: unknown function: forc01() select * from forc_test; @@ -235508,7 +235303,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (10 rows) -- same, with a cursor whose portal name doesn't match variable name -@@ -3595,38 +4038,42 @@ +@@ -3595,38 +3941,42 @@ end loop; end; $$ language plpgsql; @@ -235578,7 +235373,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- it's okay to re-use a cursor variable name, even when bound do $$ declare cnt int := 0; -@@ -3642,7 +4089,10 @@ +@@ -3642,7 +3992,10 @@ end loop; raise notice 'cnt = %', cnt; end $$; @@ -235590,20 +235385,20 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- fail because cursor has no query bound to it create or replace function forc_bad() returns void as $$ declare -@@ -3653,9 +4103,24 @@ +@@ -3653,9 +4006,24 @@ end loop; end; $$ language plpgsql; -ERROR: cursor FOR loop must use a bound cursor variable -LINE 5: for r in c loop - ^ -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + c refcursor; +begin + for r in c loop -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -235618,7 +235413,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test RETURN QUERY EXECUTE create or replace function return_dquery() returns setof int as $$ -@@ -3664,16 +4129,13 @@ +@@ -3664,16 +4032,13 @@ return query execute 'select * from (values($1),($2)) f' using 40,50; end; $$ language plpgsql; @@ -235640,7 +235435,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test RETURN QUERY with dropped columns create table tabwithcols(a int, b int, c int, d int); insert into tabwithcols values(10,20,30,40),(50,60,70,80); -@@ -3684,46 +4146,22 @@ +@@ -3684,46 +4049,22 @@ return query execute 'select * from tabwithcols'; end; $$ language plpgsql; @@ -235695,7 +235490,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop table tabwithcols; -- -- Tests for composite-type results -@@ -3753,6 +4191,9 @@ +@@ -3753,6 +4094,9 @@ return v; end; $$ language plpgsql; @@ -235705,7 +235500,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab select compos(); compos ----------- -@@ -3778,9 +4219,11 @@ +@@ -3778,9 +4122,11 @@ end; $$ language plpgsql; select compos(); @@ -235720,7 +235515,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ... but this does create or replace function compos() returns compostype as $$ begin -@@ -3803,12 +4246,11 @@ +@@ -3803,12 +4149,11 @@ return v; end; $$ language plpgsql; @@ -235737,7 +235532,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test: return row expr in return statement. create or replace function composrec() returns record as $$ begin -@@ -3833,26 +4275,22 @@ +@@ -3833,26 +4178,22 @@ return next (2, 'goodbye')::compostype; end; $$ language plpgsql; @@ -235771,7 +235566,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- RETURN variable is a different code path ... create or replace function compos() returns compostype as $$ declare x int := 42; -@@ -3861,8 +4299,7 @@ +@@ -3861,8 +4202,7 @@ end; $$ language plpgsql; select * from compos(); @@ -235781,7 +235576,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop function compos(); -- test: invalid use of composite variable in scalar-returning function create or replace function compos() returns int as $$ -@@ -3874,8 +4311,7 @@ +@@ -3874,8 +4214,7 @@ end; $$ language plpgsql; select compos(); @@ -235791,7 +235586,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test: invalid use of composite expression in scalar-returning function create or replace function compos() returns int as $$ begin -@@ -3883,8 +4319,7 @@ +@@ -3883,8 +4222,7 @@ end; $$ language plpgsql; select compos(); @@ -235801,7 +235596,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop function compos(); drop type compostype; -- -@@ -3904,7 +4339,6 @@ +@@ -3904,7 +4242,6 @@ HINT: some hint ERROR: 1 2 3 DETAIL: some detail info @@ -235809,7 +235604,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Since we can't actually see the thrown SQLSTATE in default psql output, -- test it like this; this also tests re-RAISE create or replace function raise_test() returns void as $$ -@@ -3917,11 +4351,33 @@ +@@ -3917,11 +4254,33 @@ raise; end; $$ language plpgsql; @@ -235846,7 +235641,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise 'check me' -@@ -3932,11 +4388,33 @@ +@@ -3932,11 +4291,33 @@ raise; end; $$ language plpgsql; @@ -235883,7 +235678,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- SQLSTATE specification in WHEN create or replace function raise_test() returns void as $$ begin -@@ -3948,11 +4426,33 @@ +@@ -3948,11 +4329,33 @@ raise; end; $$ language plpgsql; @@ -235920,7 +235715,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise division_by_zero using detail = 'some detail info'; -@@ -3962,11 +4462,32 @@ +@@ -3962,11 +4365,32 @@ raise; end; $$ language plpgsql; @@ -235956,7 +235751,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise division_by_zero; -@@ -3974,7 +4495,6 @@ +@@ -3974,7 +4398,6 @@ $$ language plpgsql; select raise_test(); ERROR: division_by_zero @@ -235964,7 +235759,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise sqlstate '1234F'; -@@ -3982,7 +4502,6 @@ +@@ -3982,7 +4405,6 @@ $$ language plpgsql; select raise_test(); ERROR: 1234F @@ -235972,7 +235767,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise division_by_zero using message = 'custom' || ' message'; -@@ -3990,7 +4509,6 @@ +@@ -3990,7 +4412,6 @@ $$ language plpgsql; select raise_test(); ERROR: custom message @@ -235980,7 +235775,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise using message = 'custom' || ' message', errcode = '22012'; -@@ -3998,34 +4516,48 @@ +@@ -3998,34 +4419,48 @@ $$ language plpgsql; select raise_test(); ERROR: custom message @@ -236036,7 +235831,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test access to exception data create function zero_divide() returns int as $$ declare v int := 0; -@@ -4033,6 +4565,7 @@ +@@ -4033,6 +4468,7 @@ return 10 / v; end; $$ language plpgsql; @@ -236044,7 +235839,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function raise_test() returns void as $$ begin raise exception 'custom exception' -@@ -4055,13 +4588,27 @@ +@@ -4055,13 +4491,27 @@ _sqlstate, _message, replace(_context, E'\n', ' <- '); end; $$ language plpgsql; @@ -236063,11 +235858,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + perform zero_divide(); + ^ +HINT: You have attempted to use a feature that is not yet implemented. -+ + +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. - ++ +If you would rather not post publicly, please contact us directly +using the support form. + @@ -236078,7 +235873,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function stacked_diagnostics_test() returns void as $$ declare _detail text; _hint text; -@@ -4076,13 +4623,27 @@ +@@ -4076,13 +4526,27 @@ raise notice 'message: %, detail: %, hint: %', _message, _detail, _hint; end; $$ language plpgsql; @@ -236112,7 +235907,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- fail, cannot use stacked diagnostics statement outside handler create or replace function stacked_diagnostics_test() returns void as $$ declare _detail text; -@@ -4096,11 +4657,25 @@ +@@ -4096,11 +4560,25 @@ raise notice 'message: %, detail: %, hint: %', _message, _detail, _hint; end; $$ language plpgsql; @@ -236140,7 +235935,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- check cases where implicit SQLSTATE variable could be confused with -- SQLSTATE as a keyword, cf bug #5524 create or replace function raise_test() returns void as $$ -@@ -4112,10 +4687,26 @@ +@@ -4112,10 +4590,26 @@ raise sqlstate '22012' using message = 'substitute message'; end; $$ language plpgsql; @@ -236170,7 +235965,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop function raise_test(); -- test passing column_name, constraint_name, datatype_name, table_name -- and schema_name error fields -@@ -4143,14 +4734,23 @@ +@@ -4143,14 +4637,23 @@ _column_name, _constraint_name, _datatype_name, _table_name, _schema_name; end; $$ language plpgsql; @@ -236200,7 +235995,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- test variadic functions create or replace function vari(variadic int[]) returns void as $$ -@@ -4159,36 +4759,34 @@ +@@ -4159,36 +4662,34 @@ raise notice '%', $1[i]; end loop; end; $$ language plpgsql; @@ -236260,7 +236055,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- coercion test create or replace function pleast(variadic numeric[]) returns numeric as $$ -@@ -4200,30 +4798,20 @@ +@@ -4200,30 +4701,20 @@ return aux; end; $$ language plpgsql immutable strict; @@ -236301,7 +236096,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- in case of conflict, non-variadic version is preferred create or replace function pleast(numeric) returns numeric as $$ -@@ -4232,31 +4820,27 @@ +@@ -4232,31 +4723,27 @@ return $1; end; $$ language plpgsql immutable strict; @@ -236344,7 +236139,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function tftest(a1 int) returns table(a int, b int) as $$ begin a := a1; b := a1 + 1; -@@ -4265,14 +4849,16 @@ +@@ -4265,14 +4752,16 @@ return next; end; $$ language plpgsql immutable strict; @@ -236367,7 +236162,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function rttest() returns setof int as $$ declare rc int; -@@ -4291,19 +4877,11 @@ +@@ -4291,19 +4780,11 @@ raise notice '% %', found, rc; end; $$ language plpgsql; @@ -236391,7 +236186,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- check some error cases, too create or replace function rttest() returns setof int as $$ -@@ -4311,25 +4889,26 @@ +@@ -4311,25 +4792,26 @@ return query select 10 into no_such_table; end; $$ language plpgsql; @@ -236426,7 +236221,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Test for proper cleanup at subtransaction exit. This example -- exposed a bug in PG 8.2. CREATE FUNCTION leaker_1(fail BOOL) RETURNS INTEGER AS $$ -@@ -4344,6 +4923,7 @@ +@@ -4344,6 +4826,7 @@ RETURN 1; END; $$ LANGUAGE plpgsql; @@ -236434,7 +236229,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE FUNCTION leaker_2(fail BOOL, OUT error_code INTEGER, OUT new_id INTEGER) RETURNS RECORD AS $$ BEGIN -@@ -4356,18 +4936,11 @@ +@@ -4356,18 +4839,11 @@ END; $$ LANGUAGE plpgsql; SELECT * FROM leaker_1(false); @@ -236456,7 +236251,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab DROP FUNCTION leaker_2(bool); -- Test for appropriate cleanup of non-simple expression evaluations -- (bug in all versions prior to August 2010) -@@ -4385,13 +4958,27 @@ +@@ -4385,13 +4861,27 @@ RETURN arr; END; $$ LANGUAGE plpgsql; @@ -236489,7 +236284,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE FUNCTION nonsimple_expr_test() RETURNS integer AS $$ declare i integer NOT NULL := 0; -@@ -4405,13 +4992,13 @@ +@@ -4405,13 +4895,13 @@ return i; end; $$ LANGUAGE plpgsql; @@ -236508,7 +236303,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test cases involving recursion and error recovery in simple expressions -- (bugs in all versions before October 2010). The problems are most -@@ -4427,15 +5014,13 @@ +@@ -4427,15 +4917,13 @@ end if; end; $$ language plpgsql; @@ -236527,7 +236322,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function error1(text) returns text language sql as $$ SELECT relname::text FROM pg_class c WHERE c.oid = $1::regclass $$; create function error2(p_name_table text) returns text language plpgsql as $$ -@@ -4446,9 +5031,7 @@ +@@ -4446,9 +4934,7 @@ create table public.stuffs (stuff text); SAVEPOINT a; select error2('nonexistent.stuffs'); @@ -236538,7 +236333,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab ROLLBACK TO a; select error2('public.stuffs'); error2 -@@ -4463,7 +5046,23 @@ +@@ -4463,7 +4949,23 @@ create function sql_to_date(integer) returns date as $$ select $1::text::date $$ language sql immutable strict; @@ -236562,7 +236357,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function cast_invoker(integer) returns date as $$ begin return $1; -@@ -4471,62 +5070,81 @@ +@@ -4471,62 +4973,81 @@ select cast_invoker(20150717); cast_invoker -------------- @@ -236655,7 +236450,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab end; -- Test for consistent reporting of error context create function fail() returns int language plpgsql as $$ -@@ -4534,45 +5152,29 @@ +@@ -4534,45 +5055,29 @@ return 1/0; end $$; @@ -236712,7 +236507,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (1 row) create or replace function strtest() returns text as $$ -@@ -4625,21 +5227,16 @@ +@@ -4625,21 +5130,16 @@ RAISE NOTICE '%, %', r.roomno, r.comment; END LOOP; END$$; @@ -236742,7 +236537,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab DO $$ DECLARE r record; BEGIN -@@ -4648,11 +5245,10 @@ +@@ -4648,11 +5148,10 @@ RAISE NOTICE '%, %', r.roomno, r.comment; END LOOP; END$$; @@ -236758,7 +236553,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Check handling of errors thrown from/into anonymous code blocks. do $outer$ begin -@@ -4672,16 +5268,10 @@ +@@ -4672,16 +5171,10 @@ end loop; end; $outer$; @@ -236779,7 +236574,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Check variable scoping -- a var is not available in its own or prior -- default expressions, but it is available in later ones. do $$ -@@ -4690,11 +5280,10 @@ +@@ -4690,11 +5183,10 @@ raise notice 'x = %', x; end; $$; @@ -236795,7 +236590,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare y int := x + 1; -- error x int := 42; -@@ -4702,11 +5291,10 @@ +@@ -4702,11 +5194,10 @@ raise notice 'x = %, y = %', x, y; end; $$; @@ -236811,7 +236606,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare x int := 42; y int := x + 1; -@@ -4714,7 +5302,10 @@ +@@ -4714,7 +5205,10 @@ raise notice 'x = %, y = %', x, y; end; $$; @@ -236823,7 +236618,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare x int := 42; begin -@@ -4726,7 +5317,10 @@ +@@ -4726,7 +5220,10 @@ end; end; $$; @@ -236835,7 +236630,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Check handling of conflicts between plpgsql vars and table columns. set plpgsql.variable_conflict = error; create function conflict_test() returns setof int8_tbl as $$ -@@ -4738,13 +5332,11 @@ +@@ -4738,13 +5235,11 @@ end loop; end; $$ language plpgsql; @@ -236853,7 +236648,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function conflict_test() returns setof int8_tbl as $$ #variable_conflict use_variable declare r record; -@@ -4755,16 +5347,11 @@ +@@ -4755,16 +5250,11 @@ end loop; end; $$ language plpgsql; @@ -236874,7 +236669,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function conflict_test() returns setof int8_tbl as $$ #variable_conflict use_column declare r record; -@@ -4775,17 +5362,13 @@ +@@ -4775,17 +5265,13 @@ end loop; end; $$ language plpgsql; @@ -236897,7 +236692,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Check that an unreserved keyword can be used as a variable name create function unreserved_test() returns int as $$ declare -@@ -4795,12 +5378,15 @@ +@@ -4795,12 +5281,15 @@ return forward; end $$ language plpgsql; @@ -236918,7 +236713,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function unreserved_test() returns int as $$ declare return int := 42; -@@ -4809,12 +5395,20 @@ +@@ -4809,12 +5298,20 @@ return return; end $$ language plpgsql; @@ -236944,7 +236739,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function unreserved_test() returns int as $$ declare comment int := 21; -@@ -4824,19 +5418,26 @@ +@@ -4824,19 +5321,26 @@ return comment; end $$ language plpgsql; @@ -236981,7 +236776,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test FOREACH over arrays -- -@@ -4850,26 +5451,27 @@ +@@ -4850,26 +5354,27 @@ end loop; end; $$ language plpgsql; @@ -236994,12 +236789,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------------- - -(1 row) -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x int; +begin + foreach x in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select foreach_test(ARRAY[[1,2],[3,4]]); @@ -237017,9 +236812,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + +If you would rather not post publicly, please contact us directly +using the support form. -+ -+We appreciate your feedback. ++We appreciate your feedback. ++ +select foreach_test(ARRAY[1,2,3,4]); +ERROR: unknown function: foreach_test() +select foreach_test(ARRAY[[1,2],[3,4]]); @@ -237027,16 +236822,16 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function foreach_test(anyarray) returns void as $$ declare x int; -@@ -4880,13 +5482,28 @@ +@@ -4880,13 +5385,28 @@ end loop; end; $$ language plpgsql; -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x int; +begin + foreach x slice 1 in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -237060,7 +236855,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function foreach_test(anyarray) returns void as $$ declare x int[]; -@@ -4897,21 +5514,27 @@ +@@ -4897,21 +5417,27 @@ end loop; end; $$ language plpgsql; @@ -237070,12 +236865,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------------- - -(1 row) -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x int[]; +begin + foreach x slice 1 in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select foreach_test(ARRAY[[1,2],[3,4]]); @@ -237088,10 +236883,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +Please check the public issue tracker to check whether this problem is +already tracked. If you cannot find it there, please report the error +with details by creating a new issue. - ++ +If you would rather not post publicly, please contact us directly +using the support form. -+ + +We appreciate your feedback. + +select foreach_test(ARRAY[1,2,3,4]); @@ -237101,16 +236896,16 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- higher level of slicing create or replace function foreach_test(anyarray) returns void as $$ -@@ -4923,26 +5546,31 @@ +@@ -4923,26 +5449,31 @@ end loop; end; $$ language plpgsql; -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x int[]; +begin + foreach x slice 2 in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -237148,7 +236943,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create type xy_tuple AS (x int, y int); -- iteration over array of records create or replace function foreach_test(anyarray) -@@ -4955,25 +5583,27 @@ +@@ -4955,25 +5486,27 @@ end loop; end; $$ language plpgsql; @@ -237160,12 +236955,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------------- - -(1 row) -+ERROR: at or near "r": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare r record; +begin + foreach r in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]); @@ -237193,7 +236988,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function foreach_test(anyarray) returns void as $$ declare x int; y int; -@@ -4984,25 +5614,27 @@ +@@ -4984,25 +5517,27 @@ end loop; end; $$ language plpgsql; @@ -237205,12 +237000,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------------- - -(1 row) -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x int; y int; +begin + foreach x, y in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]); @@ -237228,9 +237023,9 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab + +If you would rather not post publicly, please contact us directly +using the support form. -+ -+We appreciate your feedback. ++We appreciate your feedback. ++ +select foreach_test(ARRAY[(10,20),(40,69),(35,78)]::xy_tuple[]); +ERROR: unknown function: foreach_test() +select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]); @@ -237238,7 +237033,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- slicing over array of composite types create or replace function foreach_test(anyarray) returns void as $$ -@@ -5014,22 +5646,29 @@ +@@ -5014,22 +5549,29 @@ end loop; end; $$ language plpgsql; @@ -237248,12 +237043,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab --------------- - -(1 row) -+ERROR: at or near "x": syntax error: unimplemented: this syntax ++ERROR: at or near "foreach": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare x xy_tuple[]; +begin + foreach x slice 1 in array $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. -select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]); @@ -237281,22 +237076,18 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab drop type xy_tuple; -- -- Assorted tests for array subscript assignment -@@ -5043,28 +5682,34 @@ +@@ -5043,28 +5585,30 @@ r.ar[2] := 'replace'; return r.ar; end$$; -+ERROR: at or near ";": at or near "r": syntax error ++ERROR: at or near "[": syntax error +DETAIL: source SQL: -+r.ar[2] := 'replace' -+^ -+-- -+source SQL: +declare + r record; +begin + r := row(12, '{foo,bar,baz}')::rtype; + r.ar[2] := 'replace'; -+ ^ ++ ^ select arrayassign1(); - arrayassign1 -------------------- @@ -237332,7 +237123,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create function testoa(x1 int, x2 int, x3 int) returns orderedarray language plpgsql as $$ declare res orderedarray; -@@ -5073,26 +5718,19 @@ +@@ -5073,26 +5617,19 @@ res[2] := x3; return res; end$$; @@ -237366,7 +237157,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test handling of expanded arrays -- -@@ -5116,17 +5754,11 @@ +@@ -5116,17 +5653,11 @@ select i, a from (select returns_rw_array(1) as a offset 0) ss, lateral consumes_rw_array(a) i; @@ -237389,7 +237180,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab select i, a from (select returns_rw_array(1) as a offset 0) ss, lateral consumes_rw_array(a) i; -@@ -5137,13 +5769,11 @@ +@@ -5137,13 +5668,11 @@ explain (verbose, costs off) select consumes_rw_array(a), a from returns_rw_array(1) a; @@ -237408,7 +237199,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab select consumes_rw_array(a), a from returns_rw_array(1) a; consumes_rw_array | a -------------------+------- -@@ -5153,12 +5783,11 @@ +@@ -5153,12 +5682,11 @@ explain (verbose, costs off) select consumes_rw_array(a), a from (values (returns_rw_array(1)), (returns_rw_array(2))) v(a); @@ -237426,7 +237217,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab select consumes_rw_array(a), a from (values (returns_rw_array(1)), (returns_rw_array(2))) v(a); consumes_rw_array | a -@@ -5173,7 +5802,10 @@ +@@ -5173,7 +5701,10 @@ a := a || 3; raise notice 'a = %', a; end$$; @@ -237438,7 +237229,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test access to call stack -- -@@ -5190,6 +5822,19 @@ +@@ -5190,6 +5721,19 @@ return 2 * $1; end; $$ language plpgsql; @@ -237458,7 +237249,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function outer_func(int) returns int as $$ declare -@@ -5201,6 +5846,7 @@ +@@ -5201,6 +5745,7 @@ return myresult; end; $$ language plpgsql; @@ -237466,7 +237257,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function outer_outer_func(int) returns int as $$ declare -@@ -5212,44 +5858,18 @@ +@@ -5212,44 +5757,18 @@ return myresult; end; $$ language plpgsql; @@ -237517,7 +237308,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- access to call stack from exception create function inner_func(int) returns int as $$ -@@ -5272,6 +5892,26 @@ +@@ -5272,6 +5791,26 @@ return 2 * $1; end; $$ language plpgsql; @@ -237544,7 +237335,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function outer_func(int) returns int as $$ declare -@@ -5283,6 +5923,7 @@ +@@ -5283,6 +5822,7 @@ return myresult; end; $$ language plpgsql; @@ -237552,7 +237343,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab create or replace function outer_outer_func(int) returns int as $$ declare -@@ -5294,44 +5935,18 @@ +@@ -5294,44 +5834,18 @@ return myresult; end; $$ language plpgsql; @@ -237603,7 +237394,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- Test pg_routine_oid create function current_function(text) returns regprocedure as $$ -@@ -5342,13 +5957,17 @@ +@@ -5342,13 +5856,17 @@ return fn_oid; end; $$ language plpgsql; @@ -237626,7 +237417,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- shouldn't fail in DO, even though there's no useful data do $$ declare -@@ -5358,7 +5977,10 @@ +@@ -5358,7 +5876,10 @@ raise notice 'pg_routine_oid = %', fn_oid; end; $$; @@ -237638,7 +237429,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test ASSERT -- -@@ -5367,20 +5989,28 @@ +@@ -5367,20 +5888,28 @@ assert 1=1; -- should succeed end; $$; @@ -237671,7 +237462,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- check controlling GUC set plpgsql.check_asserts = off; do $$ -@@ -5388,6 +6018,10 @@ +@@ -5388,6 +5917,10 @@ assert 1=0; -- won't be tested end; $$; @@ -237682,7 +237473,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab reset plpgsql.check_asserts; -- test custom message do $$ -@@ -5396,8 +6030,10 @@ +@@ -5396,8 +5929,10 @@ assert 1=0, format('assertion failed, var = "%s"', var); end; $$; @@ -237695,7 +237486,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- ensure assertions are not trapped by 'others' do $$ begin -@@ -5406,32 +6042,52 @@ +@@ -5406,32 +5941,52 @@ null; -- do nothing end; $$; @@ -237752,7 +237543,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab do $$ declare v_test plpgsql_arr_domain; begin -@@ -5439,14 +6095,20 @@ +@@ -5439,14 +5994,20 @@ v_test := v_test || 2; end; $$; @@ -237775,11 +237566,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- test usage of transition tables in AFTER triggers -- -@@ -5472,25 +6134,44 @@ +@@ -5472,25 +6033,40 @@ RETURN new; END; $$; -+ERROR: at or near "l": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +DECLARE + t text; @@ -237787,7 +237578,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +BEGIN + t = ''; + FOR l IN EXECUTE -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -237805,17 +237596,13 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_base_ins_func(); -ERROR: OLD TABLE can only be specified for a DELETE or UPDATE trigger -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_base_ins_func() CREATE TRIGGER transition_table_base_ins_trig AFTER INSERT ON transition_table_base REFERENCING NEW TABLE AS newtable FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_base_ins_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_base_ins_func() INSERT INTO transition_table_base VALUES (1, 'One'), (2, 'Two'); -INFO: Named Tuplestore Scan - Output: id, val @@ -237827,11 +237614,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE OR REPLACE FUNCTION transition_table_base_upd_func() RETURNS trigger LANGUAGE plpgsql -@@ -5512,30 +6193,44 @@ +@@ -5512,30 +6088,42 @@ RETURN new; END; $$; -+ERROR: at or near "l": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +DECLARE + t text; @@ -237839,7 +237626,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab +BEGIN + t = ''; + FOR l IN EXECUTE -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -237856,9 +237643,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab REFERENCING OLD TABLE AS oldtable NEW TABLE AS newtable FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_base_upd_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_base_upd_func() UPDATE transition_table_base SET val = '*' || val || '*' WHERE id BETWEEN 2 AND 3; @@ -237882,7 +237667,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE TABLE transition_table_level2 ( level2_no serial NOT NULL , -@@ -5543,6 +6238,7 @@ +@@ -5543,6 +6131,7 @@ level1_node_name varchar(255), PRIMARY KEY (level2_no) ) WITHOUT OIDS; @@ -237890,7 +237675,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE TABLE transition_table_status ( level int NOT NULL, -@@ -5563,11 +6259,31 @@ +@@ -5563,11 +6152,29 @@ RETURN NULL; END; $$; @@ -237916,23 +237701,30 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab REFERENCING OLD TABLE AS p FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_level1_ri_parent_del_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_level1_ri_parent_del_func() CREATE FUNCTION transition_table_level1_ri_parent_upd_func() RETURNS TRIGGER LANGUAGE plpgsql -@@ -5595,6 +6311,9 @@ +@@ -5595,6 +6202,18 @@ REFERENCING OLD TABLE AS d NEW TABLE AS i FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_level1_ri_parent_upd_func(); -+ERROR: unimplemented: CREATE TRIGGER ++ERROR: unimplemented: CTE usage inside a function definition +HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ ++Please check the public issue tracker to check whether this problem is ++already tracked. If you cannot find it there, please report the error ++with details by creating a new issue. ++ ++If you would rather not post publicly, please contact us directly ++using the support form. ++ ++We appreciate your feedback. ++ CREATE FUNCTION transition_table_level2_ri_child_insupd_func() RETURNS TRIGGER LANGUAGE plpgsql -@@ -5610,16 +6329,41 @@ +@@ -5610,16 +6229,37 @@ RETURN NULL; END; $$; @@ -237960,21 +237752,17 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab REFERENCING NEW TABLE AS i FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_level2_ri_child_insupd_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_level2_ri_child_insupd_func() CREATE TRIGGER transition_table_level2_ri_child_upd_trigger AFTER UPDATE ON transition_table_level2 REFERENCING NEW TABLE AS i FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_level2_ri_child_insupd_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: unknown function: transition_table_level2_ri_child_insupd_func() -- create initial test data INSERT INTO transition_table_level1 (level1_no) SELECT generate_series(1,200); -@@ -5627,6 +6371,7 @@ +@@ -5627,6 +6267,7 @@ INSERT INTO transition_table_level2 (level2_no, parent_no) SELECT level2_no, level2_no / 50 + 1 AS parent_no FROM generate_series(1,9999) level2_no; @@ -237982,13 +237770,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab ANALYZE transition_table_level2; INSERT INTO transition_table_status (level, node_no, status) SELECT 1, level1_no, 0 FROM transition_table_level1; -@@ -5651,30 +6396,25 @@ +@@ -5651,30 +6292,21 @@ REFERENCING OLD TABLE AS dx FOR EACH STATEMENT EXECUTE PROCEDURE transition_table_level2_bad_usage_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "dx" does not exist DELETE FROM transition_table_level2 WHERE level2_no BETWEEN 301 AND 305; -ERROR: relation "dx" cannot be the target of a modifying statement @@ -237996,9 +237782,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -PL/pgSQL function transition_table_level2_bad_usage_func() line 3 at SQL statement DROP TRIGGER transition_table_level2_bad_usage_trigger ON transition_table_level2; -+ERROR: unimplemented: DROP TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: trigger "transition_table_level2_bad_usage_trigger" of relation "transition_table_level2" does not exist -- attempt modifications which would break RI (should all fail) DELETE FROM transition_table_level1 WHERE level1_no = 25; @@ -238019,7 +237803,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- attempt modifications which would not break RI (should all succeed) DELETE FROM transition_table_level1 WHERE level1_no BETWEEN 201 AND 1000; -@@ -5683,7 +6423,7 @@ +@@ -5683,7 +6315,7 @@ SELECT count(*) FROM transition_table_level1; count ------- @@ -238028,7 +237812,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (1 row) DELETE FROM transition_table_level2 -@@ -5691,7 +6431,7 @@ +@@ -5691,7 +6323,7 @@ SELECT count(*) FROM transition_table_level2; count ------- @@ -238037,23 +237821,19 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab (1 row) CREATE TABLE alter_table_under_transition_tables -@@ -5717,36 +6457,36 @@ +@@ -5717,36 +6349,32 @@ REFERENCING OLD TABLE AS d NEW TABLE AS i FOR EACH STATEMENT EXECUTE PROCEDURE alter_table_under_transition_tables_upd_func(); -ERROR: TRUNCATE triggers with transition tables are not supported -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: TRUNCATE triggers cannot specify transition tables -- should work CREATE TRIGGER alter_table_under_transition_tables_upd_trigger AFTER UPDATE ON alter_table_under_transition_tables REFERENCING OLD TABLE AS d NEW TABLE AS i FOR EACH STATEMENT EXECUTE PROCEDURE alter_table_under_transition_tables_upd_func(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "d" does not exist INSERT INTO alter_table_under_transition_tables VALUES (1, '1'), (2, '2'), (3, '3'); UPDATE alter_table_under_transition_tables @@ -238084,13 +237864,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Test multiple reference to a transition table -- -@@ -5764,19 +6504,37 @@ +@@ -5764,19 +6392,35 @@ CREATE TRIGGER my_trigger AFTER UPDATE ON multi_test REFERENCING NEW TABLE AS new_test OLD TABLE as old_test FOR EACH STATEMENT EXECUTE PROCEDURE multi_test_trig(); -+ERROR: unimplemented: CREATE TRIGGER -+HINT: You have attempted to use a feature that is not yet implemented. -+See: https://go.crdb.dev/issue-v/126359/_version_ ++ERROR: relation "new_test" does not exist UPDATE multi_test SET i = i; -NOTICE: count = 1 -NOTICE: count union = 2 @@ -238124,7 +237902,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE OR REPLACE FUNCTION get_from_partitioned_table(partitioned_table.a%type) RETURNS partitioned_table AS $$ DECLARE -@@ -5787,13 +6545,13 @@ +@@ -5787,13 +6431,13 @@ SELECT * INTO result FROM partitioned_table WHERE a = a_val; RETURN result; END; $$ LANGUAGE plpgsql; @@ -238144,7 +237922,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab CREATE OR REPLACE FUNCTION list_partitioned_table() RETURNS SETOF partitioned_table.a%TYPE AS $$ DECLARE -@@ -5806,14 +6564,13 @@ +@@ -5806,14 +6450,13 @@ END LOOP; RETURN; END; $$ LANGUAGE plpgsql; @@ -238165,7 +237943,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/plpgsql.out --lab -- -- Check argument name is used instead of $n in error message -- -@@ -5822,6 +6579,16 @@ +@@ -5822,6 +6465,16 @@ GET DIAGNOSTICS x = ROW_COUNT; RETURN; END; $$ LANGUAGE plpgsql; @@ -239298,14 +239076,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/explain.out --lab return data::jsonb; end; $$; -+ERROR: at or near "ln": syntax error: unimplemented: this syntax ++ERROR: at or near "in": syntax error: unimplemented: this syntax +DETAIL: source SQL: +declare + data text := ''; + ln text; +begin + for ln in execute $1 -+ ^ ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -263577,11 +263355,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label CREATE FUNCTION wait_for_hot_stats() RETURNS void AS $$ DECLARE start_time timestamptz := clock_timestamp(); -@@ -1544,6 +1303,26 @@ +@@ -1544,6 +1303,31 @@ EXTRACT(epoch FROM clock_timestamp() - start_time); END $$ LANGUAGE plpgsql; -+ERROR: at or near "i": syntax error: unimplemented: this syntax ++ERROR: at or near ";": syntax error: unimplemented: this syntax +DETAIL: source SQL: +DECLARE + start_time timestamptz := clock_timestamp(); @@ -263589,7 +263367,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label +BEGIN + -- we don't want to wait forever; loop will exit after 30 seconds + FOR i IN 1 .. 300 LOOP -+ ^ ++ SELECT (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0) INTO updated; ++ EXIT WHEN updated; ++ ++ -- wait a little ++ PERFORM pg_sleep_for('100 milliseconds'); ++ ^ +HINT: You have attempted to use a feature that is not yet implemented. + +Please check the public issue tracker to check whether this problem is @@ -263604,7 +263387,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label UPDATE brin_hot SET val = -3 WHERE id = 42; -- We can't just call wait_for_hot_stats() at this point, because we only -- transmit stats when the session goes idle, and we probably didn't -@@ -1553,19 +1332,12 @@ +@@ -1553,19 +1337,12 @@ -- then send its stats before dying. \c - SELECT wait_for_hot_stats(); @@ -263627,7 +263410,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label -- Test handling of index predicates - updating attributes in precicates -- should not block HOT when summarizing indexes are involved. We update -- a row that was not indexed due to the index predicate, and becomes -@@ -1573,14 +1345,28 @@ +@@ -1573,14 +1350,28 @@ CREATE TABLE brin_hot_2 (a int, b int); INSERT INTO brin_hot_2 VALUES (1, 100); CREATE INDEX ON brin_hot_2 USING brin (b) WHERE a = 2; @@ -263662,7 +263445,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label SELECT COUNT(*) FROM brin_hot_2 WHERE a = 2 AND b = 100; count ------- -@@ -1588,15 +1374,13 @@ +@@ -1588,15 +1379,13 @@ (1 row) SET enable_seqscan = off; @@ -263684,7 +263467,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label SELECT COUNT(*) FROM brin_hot_2 WHERE a = 2 AND b = 100; count ------- -@@ -1608,18 +1392,31 @@ +@@ -1608,18 +1397,31 @@ -- BRIN column. -- https://postgr.es/m/05ebcb44-f383-86e3-4f31-0a97a55634cf@enterprisedb.com CREATE TABLE brin_hot_3 (a int, filler text) WITH (fillfactor = 10); @@ -263724,7 +263507,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/stats.out --label SELECT COUNT(*) FROM brin_hot_3 WHERE a = 2; count ------- -@@ -1628,4 +1425,5 @@ +@@ -1628,4 +1430,5 @@ DROP TABLE brin_hot_3; SET enable_seqscan = on; @@ -264013,7 +263796,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -- non-top-level command create procedure p1() language plpgsql -@@ -143,83 +245,206 @@ +@@ -143,70 +245,167 @@ begin create table event_trigger_fire7 (a int); end $$; @@ -264107,7 +263890,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out alter default privileges for role regress_evt_user revoke delete on tables from regress_evt_user; -NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES -+ERROR: must be a member of regress_evt_user -- alter owner to non-superuser should fail alter event trigger regress_event_trigger owner to regress_evt_user; -ERROR: permission denied to change owner of event trigger "regress_event_trigger" @@ -264159,6 +263941,11 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -DETAIL: owner of event trigger regress_event_trigger3 -owner of user mapping for regress_evt_user on server useless_server -owner of default privileges on new relations belonging to role regress_evt_user ++ERROR: role regress_evt_user cannot be dropped because some objects depend on it ++owner of default privileges on new relations belonging to role regress_evt_user in database root ++privileges for default privileges on new relations belonging to role regress_evt_user in database root ++HINT: USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_evt_user REVOKE ALL ON TABLES FROM regress_evt_user; ++USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_evt_user REVOKE ALL ON TABLES FROM regress_evt_user; -- cleanup before next test -- these are all OK; the second one should emit a NOTICE drop event trigger if exists regress_event_trigger2; @@ -264188,11 +263975,8 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out +HINT: try \h DROP -- test support for dropped objects CREATE SCHEMA schema_one authorization regress_evt_user; -+ERROR: role/user "regress_evt_user" does not exist CREATE SCHEMA schema_two authorization regress_evt_user; -+ERROR: role/user "regress_evt_user" does not exist CREATE SCHEMA audit_tbls authorization regress_evt_user; -+ERROR: role/user "regress_evt_user" does not exist CREATE TEMP TABLE a_temp_tbl (); SET SESSION AUTHORIZATION regress_evt_user; +ERROR: at or near "regress_evt_user": syntax error: unimplemented: this syntax @@ -264202,31 +263986,10 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out +HINT: You have attempted to use a feature that is not yet implemented. +See: https://go.crdb.dev/issue-v/40283/_version_ CREATE TABLE schema_one.table_one(a int); -+ERROR: cannot create "schema_one.table_one" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists CREATE TABLE schema_one."table two"(a int); -+ERROR: cannot create "schema_one.table two" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists CREATE TABLE schema_one.table_three(a int); -+ERROR: cannot create "schema_one.table_three" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists - CREATE TABLE audit_tbls.schema_one_table_two(the_value text); -+ERROR: cannot create "audit_tbls.schema_one_table_two" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists - CREATE TABLE schema_two.table_two(a int); -+ERROR: cannot create "schema_two.table_two" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists - CREATE TABLE schema_two.table_three(a int, b text); -+ERROR: cannot create "schema_two.table_three" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists - CREATE TABLE audit_tbls.schema_two_table_three(the_value text); -+ERROR: cannot create "audit_tbls.schema_two_table_three" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists - CREATE OR REPLACE FUNCTION schema_two.add(int, int) RETURNS int LANGUAGE plpgsql - CALLED ON NULL INPUT +@@ -219,7 +418,18 @@ AS $$ BEGIN RETURN coalesce($1,0) + coalesce($2,0); END; $$; -+ERROR: cannot create "schema_two.add" because the target database or schema does not exist -+HINT: verify that the current database and search_path are valid and/or the target database exists CREATE AGGREGATE schema_two.newton (BASETYPE = int, SFUNC = schema_two.add, STYPE = int); +ERROR: at or near "schema_two": syntax error: unimplemented: this syntax @@ -264244,7 +264007,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out CREATE TABLE undroppable_objs ( object_type text, object_identity text -@@ -253,8 +478,14 @@ +@@ -253,8 +463,14 @@ END LOOP; END; $$; @@ -264259,7 +264022,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out CREATE OR REPLACE FUNCTION test_evtrig_dropped_objects() RETURNS event_trigger LANGUAGE plpgsql AS $$ DECLARE -@@ -273,99 +504,51 @@ +@@ -273,99 +489,55 @@ END LOOP; END $$; @@ -264274,7 +264037,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out + ^ +HINT: try \h CREATE ALTER TABLE schema_one.table_one DROP COLUMN a; -+ERROR: relation "schema_one.table_one" does not exist DROP SCHEMA schema_one, schema_two CASCADE; -NOTICE: drop cascades to 7 other objects -DETAIL: drop cascades to table schema_two.table_two @@ -264290,7 +264052,6 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -CONTEXT: PL/pgSQL function undroppable() line 14 at RAISE -SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three" -PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE -+ERROR: unknown schema "schema_one" DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three'; DROP SCHEMA schema_one, schema_two CASCADE; -NOTICE: drop cascades to 7 other objects @@ -264358,6 +264119,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out DROP OWNED BY regress_evt_user; -NOTICE: schema "audit_tbls" does not exist, skipping ++ERROR: cannot drop desired object(s) because other objects depend on them SELECT * FROM dropped_objects WHERE type = 'schema'; - type | schema | object ---------+--------+------------ @@ -264370,7 +264132,12 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out +(0 rows) DROP ROLE regress_evt_user; -+ERROR: role/user "regress_evt_user" does not exist ++ERROR: role regress_evt_user cannot be dropped because some objects depend on it ++owner of default privileges on new relations belonging to role regress_evt_user in database root ++privileges for default privileges on new relations belonging to role regress_evt_user in database root ++owner of schema root.audit_tbls ++HINT: USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_evt_user REVOKE ALL ON TABLES FROM regress_evt_user; ++USE root; ALTER DEFAULT PRIVILEGES FOR ROLE regress_evt_user REVOKE ALL ON TABLES FROM regress_evt_user; DROP EVENT TRIGGER regress_event_trigger_drop_objects; +ERROR: at or near "event": syntax error +DETAIL: source SQL: @@ -264386,7 +264153,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -- Event triggers on relations. CREATE OR REPLACE FUNCTION event_trigger_report_dropped() RETURNS event_trigger -@@ -383,8 +566,14 @@ +@@ -383,8 +555,14 @@ r.object_identity, r.address_names, r.address_args; END LOOP; END; $$; @@ -264401,7 +264168,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out CREATE OR REPLACE FUNCTION event_trigger_report_end() RETURNS event_trigger LANGUAGE plpgsql -@@ -397,95 +586,105 @@ +@@ -397,95 +575,105 @@ r.command_tag, r.object_type, r.object_identity; END LOOP; END; $$; @@ -264560,7 +264327,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -- test Table Rewrite Event Trigger CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger LANGUAGE plpgsql AS $$ -@@ -493,14 +692,23 @@ +@@ -493,14 +681,23 @@ RAISE EXCEPTION 'rewrites not allowed'; END; $$; @@ -264586,7 +264353,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out alter table rewriteme add column baz int default 0; -- test with more than one reason to rewrite a single table CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger -@@ -511,18 +719,36 @@ +@@ -511,18 +708,36 @@ pg_event_trigger_table_rewrite_reason(); END; $$; @@ -264625,7 +264392,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out begin; set timezone to 'UTC'; alter table rewriteme alter column bar type timestamp; -@@ -530,7 +756,6 @@ +@@ -530,7 +745,6 @@ alter table rewriteme alter column bar type timestamptz; set timezone to 'Europe/London'; alter table rewriteme alter column bar type timestamp; -- does rewrite @@ -264633,7 +264400,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out rollback; -- typed tables are rewritten when their type changes. Don't emit table -- name, because firing order is not stable. -@@ -541,21 +766,52 @@ +@@ -541,21 +755,52 @@ pg_event_trigger_table_rewrite_reason(); END; $$; @@ -264689,7 +264456,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out CREATE TABLE event_trigger_test (a integer, b text); CREATE OR REPLACE FUNCTION start_command() RETURNS event_trigger AS $$ -@@ -563,37 +819,66 @@ +@@ -563,37 +808,66 @@ RAISE NOTICE '% - ddl_command_start', tg_tag; END; $$ LANGUAGE plpgsql; @@ -264765,7 +264532,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/event_trigger.out -- Check the object addresses of all the event triggers. SELECT e.evtname, -@@ -604,13 +889,22 @@ +@@ -604,13 +878,22 @@ LATERAL pg_identify_object_as_address('pg_event_trigger'::regclass, e.oid, 0) as b, LATERAL pg_get_object_address(b.type, b.object_names, b.object_args) as a ORDER BY e.evtname;