pg_get_partkeydef: return NULL for non-partitions
Stephen Frost <sfrost@snowman.net>
pg_get_partkeydef: return NULL for non-partitions Our general rule for pg_get_X(oid) functions is to simply return NULL when passed an invalid or inappropriate OID. Teach pg_get_partkeydef to do this also, making it easier for users to use this function when querying against tables with both partitions and non-partitions (such as pg_class). As a concrete example, this makes pg_dump's life a little easier. Author: Amit Langote
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/ruleutils.c | modified | +14 −6 |
| src/test/regress/expected/rules.out | modified | +6 −0 |
| src/test/regress/sql/rules.sql | modified | +1 −0 |