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

Commit0e25dd1

Browse files
committed
Improve support of PostgreSQL 12
1 parent8f62247 commit0e25dd1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

‎pg_variables.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ static void initObjectHistory(TransObject *object, TransObjectType type);
8686
/* Hook functions */
8787
staticvoidvariable_ExecutorEnd(QueryDesc*queryDesc);
8888

89+
#ifPG_VERSION_NUM >=120000
90+
#defineCHECK_ARGS_FOR_NULL() \
91+
do { \
92+
if (fcinfo->args[0].isnull) \
93+
ereport(ERROR, \
94+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
95+
errmsg("package name can not be NULL"))); \
96+
if (fcinfo->args[1].isnull) \
97+
ereport(ERROR, \
98+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
99+
errmsg("variable name can not be NULL"))); \
100+
} while(0)
101+
#else/* PG_VERSION_NUM < 120000 */
89102
#defineCHECK_ARGS_FOR_NULL() \
90103
do { \
91104
if (fcinfo->argnull[0]) \
@@ -97,6 +110,7 @@ do { \
97110
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
98111
errmsg("variable name can not be NULL"))); \
99112
} while(0)
113+
#endif/* PG_VERSION_NUM */
100114

101115
staticHTAB*packagesHash=NULL;
102116
staticMemoryContextModuleContext=NULL;

‎pg_variables_record.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ init_record(RecordVar *record, TupleDesc tupdesc, Variable *variable)
137137

138138
oldcxt=MemoryContextSwitchTo(record->hctx);
139139
record->tupdesc=CreateTupleDescCopy(tupdesc);
140+
#ifPG_VERSION_NUM<120000
140141
record->tupdesc->tdhasoid= false;
142+
#endif
141143
record->tupdesc->tdtypeid=RECORDOID;
142144
record->tupdesc->tdtypmod=-1;
143145
record->tupdesc=BlessTupleDesc(record->tupdesc);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp