Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: create empty pg_catalog tables that are missing #58001

Closed
rafiss opened this issue Dec 16, 2020 · 0 comments · Fixed by #58519, #59302 or #60758
Closed

sql: create empty pg_catalog tables that are missing #58001

rafiss opened this issue Dec 16, 2020 · 0 comments · Fixed by #58519, #59302 or #60758
Assignees
Labels
A-sql-pgcatalog A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@rafiss
Copy link
Collaborator

rafiss commented Dec 16, 2020

@mnovelodou recently created a test that shows which pg_catalog tables are missing. These tables should be created. Ideally, there would be a way to do this automatically, and not by manually typing out each table definition.

@rafiss rafiss added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-pgcatalog labels Dec 16, 2020
@mnovelodou mnovelodou self-assigned this Jan 27, 2021
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Jan 29, 2021
Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Feb 5, 2021
Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Feb 8, 2021
Previously, added tables and columns existed in postgres but not cockroach db
This was inadequate because this may cause errors at tools that expects these
columns to exists
To address this, this patch contains the result of diff tool to add what is
missing

Release note (sql change): Added missing tables and columns at pg_catalog
New columns in table pg_attribute:
        atthasmissing
New columns in table pg_class:
        relrowsecurity
        relforcerowsecurity
        relispartition
        relispopulated
        relreplident
        relrewrite
New columns in table pg_collation:
        collprovider
        collversion
        collisdeterministic
New columns in table pg_index:
        indnkeyatts
New columns in table pg_proc:
        prokind
        prosupport
New columns in table pg_aggregate:
        aggmfinalmodify
        aggfinalmodify
New Tables:
        pg_replication_origin_roname_index
        pg_config
        pg_largeobject_loid_pn_index
        pg_ts_config
        pg_operator_oid_index
        pg_conversion_oid_index
        pg_depend_depender_index
        pg_stat_user_functions
        pg_index_indrelid_index
        pg_group
        pg_db_role_setting_databaseid_rol_index
        pg_statio_user_tables
        pg_partitioned_table_partrelid_index
        pg_publication_oid_index
        pg_publication
        pg_publication_tables
        pg_stat_xact_user_tables
        pg_ts_config_map_index
        pg_replication_origin_roiident_index
        pg_stat_progress_vacuum
        pg_file_settings
        pg_statio_all_indexes
        pg_shseclabel_object_index
        pg_enum_oid_index
        pg_statistic_relid_att_inh_index
        pg_largeobject_metadata_oid_index
        pg_stat_archiver
        pg_statio_sys_sequences
        pg_collation_oid_index
        pg_subscription
        pg_namespace_oid_index
        pg_amop
        pg_stat_database_conflicts
        pg_tablespace_oid_index
        pg_class_oid_index
        pg_range_rngtypid_index
        pg_description_o_c_o_index
        pg_opclass_oid_index
        pg_sequence_seqrelid_index
        pg_trigger_oid_index
        pg_timezone_abbrevs
        pg_ts_parser_oid_index
        pg_transform
        pg_extension_oid_index
        pg_statio_user_sequences
        pg_shdepend_reference_index
        pg_foreign_data_wrapper_oid_index
        pg_ts_config_oid_index
        pg_ts_dict_oid_index
        pg_init_privs_o_c_o_index
        pg_user_mappings
        pg_default_acl_role_nsp_obj_index
        pg_stat_slru
        pg_constraint_contypid_index
        pg_stat_progress_create_index
        pg_transform_type_lang_index
        pg_authid_oid_index
        pg_shmem_allocations
        pg_statio_sys_tables
        pg_statio_all_sequences
        pg_policy_oid_index
        pg_shdepend_depender_index
        pg_attribute_relid_attnum_index
        pg_event_trigger_oid_index
        pg_amproc
        pg_cast_oid_index
        pg_constraint_conparentid_index
        pg_statio_sys_indexes
        pg_conversion_default_index
        pg_statistic_ext
        pg_shadow
        pg_trigger_tgconstraint_index
        pg_ts_template
        pg_cast_source_target_index
        pg_type_oid_index
        pg_amproc_fam_proc_index
        pg_aggregate_fnoid_index
        pg_stat_progress_basebackup
        pg_default_acl_oid_index
        pg_foreign_server_oid_index
        pg_statistic_ext_data_stxoid_index
        pg_transform_oid_index
        pg_language_oid_index
        pg_db_role_setting
        pg_amop_opr_fam_index
        pg_user_mapping_oid_index
        pg_hba_file_rules
        pg_am_oid_index
        pg_statio_all_tables
        pg_statio_user_indexes
        pg_stat_progress_analyze
        pg_replication_origin
        pg_depend_reference_index
        pg_stat_bgwriter
        pg_attrdef_adrelid_adnum_index
        pg_stat_sys_indexes
        pg_statistic_ext_oid_index
        pg_foreign_table_relid_index
        pg_user_mapping_user_server_index
        pg_seclabel_object_index
        pg_subscription_rel_srrelid_srsubid_index
        pg_publication_rel_prrelid_prpubid_index
        pg_inherits_parent_index
        pg_ts_dict
        pg_stat_user_tables
        pg_stat_progress_cluster
        pg_stat_xact_all_tables
        pg_stat_database
        pg_shdescription_o_c_index
        pg_publication_rel_oid_index
        pg_largeobject
        pg_publication_rel
        pg_rewrite_oid_index
        pg_stat_all_indexes
        pg_amop_fam_strat_index
        pg_proc_oid_index
        pg_database_oid_index
        pg_sequences
        pg_subscription_oid_index
        pg_enum_typid_sortorder_index
        pg_ts_parser
        pg_ts_config_map
        pg_attrdef_oid_index
        pg_timezone_names
        pg_ts_template_oid_index
        pg_statistic_ext_relid_index
        pg_index_indexrelid_index
        pg_amop_oid_index
        pg_amproc_oid_index
        pg_rules
        pg_opfamily
        pg_stat_xact_sys_tables
        pg_policies
        pg_constraint_oid_index
        pg_stat_sys_tables
        pg_stat_xact_user_functions
        pg_available_extension_versions
        pg_stat_all_tables
        pg_auth_members_role_member_index
        pg_auth_members_member_role_index
        pg_inherits_relid_seqno_index
        pg_opfamily_oid_index
        pg_class_tblspc_relfilenode_index
        pg_cursors
        pg_stat_gssapi
        pg_stat_ssl
        pg_stat_user_indexes

Fixes cockroachdb#58001
@craig craig bot closed this as completed in 98f1479 Feb 19, 2021
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Feb 24, 2021
Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes cockroachdb#58001

Release justification: non-production code changes
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Mar 9, 2021
Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes cockroachdb#58001

Release justification: non-production code changes
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Mar 10, 2021
Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes cockroachdb#58001

Release justification: non-production code changes
craig bot pushed a commit that referenced this issue Mar 11, 2021
58519: sql: code generation for missing pg catalog tables r=RichardJCai a=mnovelodou

Previously, programmer had to add missing table manually,
This was inadequate because postgress added a lot of tables and
manual process can lead to coding mistakes or gaps
To address this, diff tool now have the hability to generate the
missing code

Release note: None

Fixes #58001

60695: sql: add catalog.Mutation interface for table mutations r=postamar a=postamar

Previously, catalog.TableDescriptor had a method, GetMutations, which
returned a slice of descpb.DescriptorMutation structs, which in turn
contain descpb.IndexDescriptor and descpb.ColumnDescriptor types. This
is an obstacle to our ongoing effort to virtualize column and index
descriptors.

This commit therefore wraps descpb.DescriptorMutation in an interface
type, catalog.Mutation, and also wraps the remaining mutation descriptor
field types:
    - ConstraintToUpdate,
    - PrimaryKeySwap,
    - ComputedColumnSwap,
    - MaterializedViewRefresh.

Release justification: This commit is safe for this release because it
is a low-risk refactor.

Release note: None

Co-authored-by: MiguelNovelo <miguel.novelo@digitalonus.com>
Co-authored-by: Marius Posta <marius@cockroachlabs.com>
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Mar 23, 2021
Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Apr 1, 2021
Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Apr 16, 2021
Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Apr 21, 2021
Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: cockroachdb#58001
mnovelodou pushed a commit to mnovelodou/cockroach that referenced this issue Apr 21, 2021
Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: cockroachdb#58001
craig bot pushed a commit that referenced this issue Apr 21, 2021
59302: sql: code generation for missing pg_catalog columns  r=RichardJCai a=mnovelodou

Previously, keeping up with postgres by adding the same columns in pg_catalog
was a manual process
This was inadequate because from version to version the list of missing
columns might increase a lot
To address this, this patch closes the gap between postgres and cockroachdb
by adding the missing columns automatically with nil values

Release note: None

Fixes: #58001

Co-authored-by: MiguelNovelo <miguel.novelo@digitalonus.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcatalog A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
2 participants