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: populate information_schema.routines and parameters #105944

Merged
merged 5 commits into from Jul 20, 2023

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Jun 30, 2023

fixes #104083


builtins: add nameconcatoid function

This adds the nameconcatoid in order to match PostgreSQL. It is used by
the information_schema to create unique names.

Release note (sql change): Added the nameconcatoid builtin function,
which concatenates a name with an OID.


sql: populate pg_catalog.pg_language

Release note (sql change): The pg_catalog.pg_language table is now
populated with data about languages used to define functions.


sql: implement information_schema.routines view

Release note (sql change): The information_schema.routines view is now
populated with information about functions.


builtins: add pg_get_function_arg_default

Add an implementation for pg_get_function_arg_default to match
PostgreSQL. Since we don't support function defaults, this always
returns NULL.

Release note: None


sql: populate information_schema.parameters

Release note (sql change): The information_schema.parameters table is
now populated with information about function parameters.

@rafiss rafiss requested review from a team as code owners June 30, 2023 22:45
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss force-pushed the add-info-schema-views branch 3 times, most recently from 4503170 to 73ae425 Compare July 9, 2023 04:58
@rafiss rafiss requested a review from a team as a code owner July 9, 2023 04:58
This adds the nameconcatoid in order to match PostgreSQL. It is used by
the information_schema to create unique names.

Release note (sql change): Added the nameconcatoid builtin function,
which concatenates a name with an OID.
Release note (sql change): The pg_catalog.pg_language table is now
populated with data about languages used to define functions.
Release note (sql change): The information_schema.routines view is now
populated with information about functions.
Add an implementation for pg_get_function_arg_default to match
PostgreSQL. Since we don't support function defaults, this always
returns NULL.

Release note: None
Release note (sql change): The information_schema.parameters table is
now populated with information about function parameters.
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, 3 of 3 files at r2, 3 of 3 files at r3, 3 of 3 files at r4, 7 of 7 files at r5, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)

@rafiss
Copy link
Collaborator Author

rafiss commented Jul 20, 2023

ty!

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 20, 2023

Build succeeded:

@yuzefovich
Copy link
Member

Not sure how important this is, but on my laptop I have a different OID for the PLpgSQL language:

yuzefovich=# SHOW server_version;
 server_version  
-----------------
 16.2 (Homebrew)
(1 row)

yuzefovich=# select * from pg_catalog.pg_language;
  oid  | lanname  | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl 
-------+----------+----------+---------+--------------+---------------+-----------+--------------+--------
    12 | internal |       10 | f       | f            |             0 |         0 |         2246 | 
    13 | c        |       10 | f       | f            |             0 |         0 |         2247 | 
    14 | sql      |       10 | f       | t            |             0 |         0 |         2248 | 
 13876 | plpgsql  |       10 | t       | t            |         13873 |     13874 |        13875 | 
(4 rows)

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

Successfully merging this pull request may close these issues.

Populate INFORMATION_SCHEMA.ROUTINES and PARAMETERS
4 participants