Skip to content

Commit 2d774aa

Browse files
committed
Split out pg_operator.h function declarations to new file pg_operator_fn.h.
Commit a2e35b5 added an #include of catalog/objectaddress.h to pg_operator.h, making it impossible for client-side code to #include pg_operator.h. It's not entirely clear whether any client-side code needs to include pg_operator.h, but it seems prudent to assume that there is some such code somewhere. Therefore, split off the function definitions into a new file pg_operator_fn.h, similarly to what we've done for some other catalog header files. Back-patch of part of commit 0dab5ef.
1 parent 69892d5 commit 2d774aa

File tree

4 files changed

+34
-17
lines changed

4 files changed

+34
-17
lines changed

src/backend/catalog/pg_operator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "catalog/objectaccess.h"
2727
#include "catalog/pg_namespace.h"
2828
#include "catalog/pg_operator.h"
29+
#include "catalog/pg_operator_fn.h"
2930
#include "catalog/pg_proc.h"
3031
#include "catalog/pg_type.h"
3132
#include "miscadmin.h"

src/backend/commands/operatorcmds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "catalog/dependency.h"
4040
#include "catalog/indexing.h"
4141
#include "catalog/pg_operator.h"
42+
#include "catalog/pg_operator_fn.h"
4243
#include "catalog/pg_type.h"
4344
#include "commands/alter.h"
4445
#include "commands/defrem.h"

src/include/catalog/pg_operator.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#define PG_OPERATOR_H
2424

2525
#include "catalog/genbki.h"
26-
#include "catalog/objectaddress.h"
27-
#include "nodes/pg_list.h"
2826

2927
/* ----------------
3028
* pg_operator definition. cpp turns this into
@@ -1822,19 +1820,4 @@ DESCR("delete array element");
18221820
DATA(insert OID = 3287 ( "#-" PGNSP PGUID b f f 3802 1009 3802 0 0 jsonb_delete_path - - ));
18231821
DESCR("delete path");
18241822

1825-
/*
1826-
* function prototypes
1827-
*/
1828-
extern ObjectAddress OperatorCreate(const char *operatorName,
1829-
Oid operatorNamespace,
1830-
Oid leftTypeId,
1831-
Oid rightTypeId,
1832-
Oid procedureId,
1833-
List *commutatorName,
1834-
List *negatorName,
1835-
Oid restrictionId,
1836-
Oid joinId,
1837-
bool canMerge,
1838-
bool canHash);
1839-
18401823
#endif /* PG_OPERATOR_H */

src/include/catalog/pg_operator_fn.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* pg_operator_fn.h
4+
* prototypes for functions in catalog/pg_operator.c
5+
*
6+
*
7+
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
8+
* Portions Copyright (c) 1994, Regents of the University of California
9+
*
10+
* src/include/catalog/pg_operator_fn.h
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndef PG_OPERATOR_FN_H
15+
#define PG_OPERATOR_FN_H
16+
17+
#include "catalog/objectaddress.h"
18+
#include "nodes/pg_list.h"
19+
20+
extern ObjectAddress OperatorCreate(const char *operatorName,
21+
Oid operatorNamespace,
22+
Oid leftTypeId,
23+
Oid rightTypeId,
24+
Oid procedureId,
25+
List *commutatorName,
26+
List *negatorName,
27+
Oid restrictionId,
28+
Oid joinId,
29+
bool canMerge,
30+
bool canHash);
31+
32+
#endif /* PG_OPERATOR_FN_H */

0 commit comments

Comments
 (0)