Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08da528

Browse files
committed
Bring plpgsql into line with header inclusion policy.
We have a project policy that every .c file should start by includingpostgres.h, postgres_fe.h, or c.h as appropriate; and then there is noneed for any .h file to explicitly include any of these. (The corereason for this policy is to make it easy to verify that pg_config_os.his included before any system headers such as <stdio.h>; without that,we have portability issues on some platforms due to variation in largefileoptions across different modules in the backend. Also, if .h files wereresponsible for choosing which of these key headers to include, .h filesthat need to be includable in either frontend or backend compiles would bein trouble.)plpgsql was blithely ignoring this policy, so whack it upside the headuntil it complies. I also chose to standardize on including plpgsql'sown .h files after all core-system headers that it pulls in. Thatcould've been done either way, but this way seems saner.Discussion:https://postgr.es/m/CAEepm=2zCoeq3QxVwhS5DFeUh=yU6z81pbWMgfOB8OzyiBwxzw@mail.gmail.comDiscussion:https://postgr.es/m/11634.1488932128@sss.pgh.pa.us
1 parentd6b059e commit08da528

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

‎src/pl/plpgsql/src/pl_comp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include<ctype.h>
1919

@@ -33,6 +33,8 @@
3333
#include"utils/rel.h"
3434
#include"utils/syscache.h"
3535

36+
#include"plpgsql.h"
37+
3638

3739
/* ----------
3840
* Our own local and global variables

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include<ctype.h>
1919

@@ -41,6 +41,8 @@
4141
#include"utils/snapmgr.h"
4242
#include"utils/typcache.h"
4343

44+
#include"plpgsql.h"
45+
4446

4547
typedefstruct
4648
{

‎src/pl/plpgsql/src/pl_funcs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include"utils/memutils.h"
1919

20+
#include"plpgsql.h"
21+
2022

2123
/* ----------
2224
* Local variables for namespace handling

‎src/pl/plpgsql/src/pl_gram.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include"catalog/namespace.h"
1919
#include"catalog/pg_type.h"
@@ -23,6 +23,8 @@
2323
#include"parser/scansup.h"
2424
#include"utils/builtins.h"
2525

26+
#include"plpgsql.h"
27+
2628

2729
/* Location tracking support --- simpler than bison's default*/
2830
#defineYYLLOC_DEFAULT(Current, Rhs, N) \

‎src/pl/plpgsql/src/pl_handler.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include"access/htup_details.h"
1919
#include"catalog/pg_proc.h"
@@ -26,6 +26,8 @@
2626
#include"utils/syscache.h"
2727
#include"utils/varlena.h"
2828

29+
#include"plpgsql.h"
30+
2931

3032
staticboolplpgsql_extra_checks_check_hook(char**newvalue,void**extra,GucSourcesource);
3133
staticvoidplpgsql_extra_warnings_assign_hook(constchar*newvalue,void*extra);

‎src/pl/plpgsql/src/pl_scanner.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
16-
#include"plpgsql.h"
16+
#include"postgres.h"
1717

1818
#include"mb/pg_wchar.h"
1919
#include"parser/scanner.h"
2020

21+
#include"plpgsql.h"
2122
#include"pl_gram.h"/* must be after parser/scanner.h */
2223

24+
2325
#definePG_KEYWORD(a,b,c) {a,b,c},
2426

2527

‎src/pl/plpgsql/src/plpgsql.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#ifndefPLPGSQL_H
1717
#definePLPGSQL_H
1818

19-
#include"postgres.h"
20-
2119
#include"access/xact.h"
2220
#include"commands/event_trigger.h"
2321
#include"commands/trigger.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp