Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b59d2fe

Browse files
committed
Add pg_opfamily_is_visible.
We already have similar functions for many other object types, including operator classes, so it seems like we should have this one, too. Extracted from a larger patch by Josh Kupershmidt
1 parent 9473bb9 commit b59d2fe

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

doc/src/sgml/func.sgml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13109,6 +13109,12 @@ SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);
1310913109
<entry><type>boolean</type></entry>
1311013110
<entry>is operator visible in search path</entry>
1311113111
</row>
13112+
<row>
13113+
<entry><literal><function>pg_opfamily_is_visible(<parameter>opclass_oid</parameter>)</function></literal>
13114+
</entry>
13115+
<entry><type>boolean</type></entry>
13116+
<entry>is operator family visible in search path</entry>
13117+
</row>
1311213118
<row>
1311313119
<entry><literal><function>pg_table_is_visible(<parameter>table_oid</parameter>)</function></literal>
1311413120
</entry>
@@ -13164,6 +13170,9 @@ SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);
1316413170
<indexterm>
1316513171
<primary>pg_operator_is_visible</primary>
1316613172
</indexterm>
13173+
<indexterm>
13174+
<primary>pg_opfamily_is_visible</primary>
13175+
</indexterm>
1316713176
<indexterm>
1316813177
<primary>pg_table_is_visible</primary>
1316913178
</indexterm>

src/backend/catalog/namespace.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Datum pg_type_is_visible(PG_FUNCTION_ARGS);
202202
Datum pg_function_is_visible(PG_FUNCTION_ARGS);
203203
Datum pg_operator_is_visible(PG_FUNCTION_ARGS);
204204
Datum pg_opclass_is_visible(PG_FUNCTION_ARGS);
205+
Datum pg_opfamily_is_visible(PG_FUNCTION_ARGS);
205206
Datum pg_collation_is_visible(PG_FUNCTION_ARGS);
206207
Datum pg_conversion_is_visible(PG_FUNCTION_ARGS);
207208
Datum pg_ts_parser_is_visible(PG_FUNCTION_ARGS);
@@ -3897,6 +3898,17 @@ pg_opclass_is_visible(PG_FUNCTION_ARGS)
38973898
PG_RETURN_BOOL(OpclassIsVisible(oid));
38983899
}
38993900

3901+
Datum
3902+
pg_opfamily_is_visible(PG_FUNCTION_ARGS)
3903+
{
3904+
Oid oid = PG_GETARG_OID(0);
3905+
3906+
if (!SearchSysCacheExists1(OPFAMILYOID, ObjectIdGetDatum(oid)))
3907+
PG_RETURN_NULL();
3908+
3909+
PG_RETURN_BOOL(OpfamilyIsVisible(oid));
3910+
}
3911+
39003912
Datum
39013913
pg_collation_is_visible(PG_FUNCTION_ARGS)
39023914
{

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201107031
56+
#define CATALOG_VERSION_NO 201107171
5757

5858
#endif

src/include/catalog/pg_proc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,6 +2829,8 @@ DATA(insert OID = 2082 ( pg_operator_is_visible PGNSP PGUID 12 1 0 0 0 f f f t
28292829
DESCR("is operator visible in search path?");
28302830
DATA(insert OID = 2083 ( pg_opclass_is_visible PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opclass_is_visible _null_ _null_ _null_ ));
28312831
DESCR("is opclass visible in search path?");
2832+
DATA(insert OID = 3829 ( pg_opfamily_is_visible PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opfamily_is_visible _null_ _null_ _null_ ));
2833+
DESCR("is opfamily visible in search path?");
28322834
DATA(insert OID = 2093 ( pg_conversion_is_visible PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_conversion_is_visible _null_ _null_ _null_ ));
28332835
DESCR("is conversion visible in search path?");
28342836
DATA(insert OID = 3756 ( pg_ts_parser_is_visible PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_parser_is_visible _null_ _null_ _null_ ));

0 commit comments

Comments
 (0)