Skip to content

Commit

Permalink
sql: add missing obj_description case
Browse files Browse the repository at this point in the history
Found with the following query:

```sql
COMMENT ON SCHEMA public IS 'hello';

SELECT obj_description(oid, 'pg_namespace')
FROM pg_namespace WHERE nspname = 'public';
```

Release note (sql change): The PostgreSQL compatibility
function `obj_description` now supports retrieving
comments on schemas.
  • Loading branch information
knz committed Sep 17, 2022
1 parent 5051c83 commit d2a7bb0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sql/sem/builtins/pg_builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,8 @@ func getCatalogOidForComments(catalogName string) (id int, ok bool) {
return catconstants.PgCatalogDescriptionTableID, true
case "pg_constraint":
return catconstants.PgCatalogConstraintTableID, true
case "pg_namespace":
return catconstants.PgCatalogNamespaceTableID, true
default:
// We currently only support comments on pg_class objects
// (columns, tables) in this context.
Expand Down

0 comments on commit d2a7bb0

Please sign in to comment.