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

Implement the compatibility of PostgreSQL system tables #33

Open
9 of 63 tasks
Orion7r opened this issue Aug 13, 2021 · 0 comments
Open
9 of 63 tasks

Implement the compatibility of PostgreSQL system tables #33

Orion7r opened this issue Aug 13, 2021 · 0 comments

Comments

@Orion7r
Copy link
Contributor

Orion7r commented Aug 13, 2021

Development Task

Description

The system library of PostgreSQL is information_ schema and pg_ catalog, which is different from TiDB. These two databases are implemented in TiDB for PostgreSQL, but the implementation of system tables and system views in these two databases is not perfect and needs to be supplemented.

The implementation of system tables and system views is mainly to be compatible with query requests connected from clients, such as PgAdmin and Navicat, so that these clients can connect to TiDB for PostgreSQL using PostgreSQL protocol.

Detailed information about information_schema and pg_catalog can be found in the following two links.
information_schema
pg_catalog

This section mainly covers the InfoSchema and Executor directories. System tables and views are defined in InfoSchema. System table structures can be defined in the tables.go file, and infoschema_reader.go file in Executor, which involves initialization of related system table data.

Currently, we only implement the related system tables for information_schema, but there is no initialization for the data that exists in the system tables, which means that most of the tables are empty, which is definitely not normal. For pg_catalog, instead of implementing information_schema, we use the session module to execute SQL statements to initialize system tables, system views and data in pg_catalog before starting TiDB. This needs to be changed later to the same implementation as information_schema.

Task List

  1. The initial data for the system table in information_schema
  2. Tables and corresponding data in the pg_catalog system library

Methods or modules that need to be implemented:

  • setDataForPgInformationSchemaCatalogName
  • setDataForPgAdministrableRoleAuthorizations
  • setDataForPgApplicableRole
  • setDataForPgAttributes
  • setDataForPgCharacterSets
  • setDataForPgCheckConstraintRoutineUsage
  • setDataForPgCheckConstraints
  • setDataForPgCollations
  • setDataForPgCollationCharacterSetApplicability
  • setDataForPgColumnColumnUsage
  • setDataForPgColumnDomainUsage
  • setDataForPgColumnOptions
  • setDataForPgColumnPrivileges
  • setDataForPgColumnUdtUsage
  • setDataForPgColumns
  • setDataForPgConstraintColumnUsage
  • setDataForPgConstraintTableUsage
  • setDataForPgDataTypePrivileges
  • setDataForPgDomainConstraints
  • setDataForPgDomainUdtUsage
  • setDataForPgDomains
  • setDataForPgElementTypes
  • setDataForPgEnabledRoles
  • setDataForPgForeignDataWrapperOptions
  • setDataForPgForeignDataWrappers
  • setDataForPgForeignServerOptions
  • setDataForPgForeignServers
  • setDataForPgForeignTableOptions
  • setDataForPgForeignTales
  • setDataForPgKeyColumnUsage
  • setDataForPgParameters
  • setDataForPgReferentialConstraints
  • setDataForPgRoleColumnGrants
  • setDataForPgRoleRoutineGrants
  • setDataForPgRoleTableGrants
  • setDataForPgTableConstraints
  • setDataForPgRoleUdtGrants
  • setDataForPgRoleUsageGrants
  • setDataForPgRoutinePrivileges
  • setDataForPgRoutines
  • setDataForPgSchemata
  • setDataForPgSequences
  • setDataForPgSqlFeatures
  • setDataForPgSqlImplementationInfo
  • setDataForPgSqlParts
  • setDataForPgSqlSizing
  • setDataForPgTableConstraints
  • setDataForPgTablePrivileges
  • setDataForPgTables
  • setDataForPgTransforms
  • setDataForPgTriggeredUpdateColumns
  • setDataForPgTriggers
  • setDataForPgUdtPrivileges
  • setDataForPgUsagePrivileges
  • setDataForPgUserDefinedTypes
  • setDataForPgUserMappingOptions
  • setDataForPgUserMappings
  • setDataForPgViewColumnUsage
  • setDataForPgViewRoutineUsage
  • setDataForPgViewTableUsage
  • setDataForPgViews
  • System table implementation in pg_catalog
  • Data for pg_catalog tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant