agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedUser functions and AIX
8+ messages / 4 participants
[nested] [flat]
* User functions and AIX
@ 2001-05-28 15:56 D'Arcy J.M. Cain <darcy@druid.net>
0 siblings, 1 reply; 8+ messages in thread
From: D'Arcy J.M. Cain @ 2001-05-28 15:56 UTC (permalink / raw)
To: pgsql-hackers
IBM is trying to find the answer to this but I thought I would throw
this out here to see if anyone can help me. I am compiling a user
defined type on AIX and it fails when I try to use it. The type is
chkpass and it is in the contrib directory. It fails with a core dump
at line 88 in chkpass.c. The line reads as follows.
result = (chkpass *) palloc(sizeof(chkpass));
The top of the backtrace looks like this.
#0 0x0 in ?? () from (unknown load module)
#1 0xd1087a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
#2 0x10045cf4 in or_clause (clause=0x0) at clauses.c:211
#3 0x10075d68 in int82ge (fcinfo=0x1015cfc8) at int8.c:343
#4 0x1005909c in _readArrayRef () at readfuncs.c:924
#5 0x10059b68 in _readSeqScan () at readfuncs.c:600
It looks like the dynamically loaded object (chkpass.so) can't determine
the address of palloc() from the parent. I assume I need a flag for the
compile either on the main build to export the addresses or on the build
of chkpass to tell it where to look up the addresses. Anyone been
through this that might be able to shed some light?
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: User functions and AIX
@ 2001-05-28 17:21 Tom Lane <tgl@sss.pgh.pa.us>
parent: D'Arcy J.M. Cain <darcy@druid.net>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2001-05-28 17:21 UTC (permalink / raw)
To: D'Arcy J.M. Cain <darcy@druid.net>; +Cc: pgsql-hackers
darcy@druid.net (D'Arcy J.M. Cain) writes:
> The top of the backtrace looks like this.
> #0 0x0 in ?? () from (unknown load module)
> #1 0xd1087a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
> #2 0x10045cf4 in or_clause (clause=0x0) at clauses.c:211
> #3 0x10075d68 in int82ge (fcinfo=0x1015cfc8) at int8.c:343
> #4 0x1005909c in _readArrayRef () at readfuncs.c:924
> #5 0x10059b68 in _readSeqScan () at readfuncs.c:600
I don't believe a word of that backtrace, and neither should you.
The alleged call arcs at levels below #1 do not exist in the code.
Ergo, I doubt the top two levels can be trusted either.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: User functions and AIX
@ 2001-05-28 19:06 D'Arcy J.M. Cain <darcy@druid.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: D'Arcy J.M. Cain @ 2001-05-28 19:06 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers
Thus spake Tom Lane
> darcy@druid.net (D'Arcy J.M. Cain) writes:
> > The top of the backtrace looks like this.
>
> > #0 0x0 in ?? () from (unknown load module)
> > #1 0xd1087a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
> > #2 0x10045cf4 in or_clause (clause=0x0) at clauses.c:211
> > #3 0x10075d68 in int82ge (fcinfo=0x1015cfc8) at int8.c:343
> > #4 0x1005909c in _readArrayRef () at readfuncs.c:924
> > #5 0x10059b68 in _readSeqScan () at readfuncs.c:600
>
> I don't believe a word of that backtrace, and neither should you.
> The alleged call arcs at levels below #1 do not exist in the code.
> Ergo, I doubt the top two levels can be trusted either.
Can you clarify? I see or_clause takes a clause arg and I assumed that
the fcinfo is hidden in the macro. I don't understand how the arg for
chkpass_in can be NULL. I'm also not sure why these functions are involved
in reading the chkpass type.
Hmm. I just rebooted and reran the test (SELECT 'hello'::chkpass) and
it gave me a different stacktrace. It looks like this.
#0 0x0 in ?? () from (unknown load module)
#1 0xd1085a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
#2 0x1004b874 in OidFunctionCall3 (functionId=269952520, arg1=269952532,
arg2=269952540, arg3=269952548) at fmgr.c:1136
#3 0x1007f350 in stringTypeDatum (tp=0x10172694, string=0x101726a0 "pendant",
atttypmod=269952680) at parse_type.c:181
#4 0x10060630 in parser_typecast_constant (expr=0x10172794,
typename=0x101727a0) at parse_expr.c:876
#5 0x10061188 in transformExpr (pstate=0x10172910, expr=0x10172920,
precedence=269953332) at parse_expr.c:118
#6 0x10076f28 in transformTargetEntry (pstate=0x258, node=0x5c,
expr=0x2ff1df70, colname=0x101729f4 "inner", resjunk=16 '\020')
at parse_target.c:56
#7 0x10077198 in transformTargetList (pstate=0x10172ab8,
targetlist=0x10172ac0) at parse_target.c:158
#8 0x10093c10 in transformSelectStmt (pstate=0x10172b80, stmt=0x10172b88)
at analyze.c:1835
#9 0x1009497c in transformStmt (pstate=0x20000890, parseTree=0x2001f43c)
at analyze.c:226
#10 0x10094ca4 in parse_analyze (parseTree=0x100195f8,
parentParseState=0x200008a4) at analyze.c:86
I still can't follow the logic through the code. And chkpass_in is still
being called with a null pointer according to this.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: User functions and AIX
@ 2001-05-28 19:15 Tom Lane <tgl@sss.pgh.pa.us>
parent: D'Arcy J.M. Cain <darcy@druid.net>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2001-05-28 19:15 UTC (permalink / raw)
To: pgsql-hackers
darcy@druid.net (D'Arcy J.M. Cain) writes:
> I'm also not sure why these functions are involved
> in reading the chkpass type.
Precisely my point: they're not. That backtrace is false data.
> Hmm. I just rebooted and reran the test (SELECT 'hello'::chkpass) and
> it gave me a different stacktrace. It looks like this.
> #0 0x0 in ?? () from (unknown load module)
> #1 0xd1085a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
> #2 0x1004b874 in OidFunctionCall3 (functionId=269952520, arg1=269952532,
> arg2=269952540, arg3=269952548) at fmgr.c:1136
> #3 0x1007f350 in stringTypeDatum (tp=0x10172694, string=0x101726a0 "pendant",
> atttypmod=269952680) at parse_type.c:181
> #4 0x10060630 in parser_typecast_constant (expr=0x10172794,
> typename=0x101727a0) at parse_expr.c:876
This one I believe to the extent of the series of function calls, but
it's still giving you wrong info about the passed parameters, which
is pretty common if you compiled at -O2 or higher. Try recompiling with
"-O0 -g" if you need trustworthy parameter info from the backtrace.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: User functions and AIX
@ 2001-05-28 21:04 D'Arcy J.M. Cain <darcy@druid.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 8+ messages in thread
From: D'Arcy J.M. Cain @ 2001-05-28 21:04 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers
Thus spake Tom Lane
> darcy@druid.net (D'Arcy J.M. Cain) writes:
> > I'm also not sure why these functions are involved
> > in reading the chkpass type.
>
> Precisely my point: they're not. That backtrace is false data.
>
> > Hmm. I just rebooted and reran the test (SELECT 'hello'::chkpass) and
> > it gave me a different stacktrace. It looks like this.
>
> > #0 0x0 in ?? () from (unknown load module)
> > #1 0xd1085a60 in chkpass_in (fcinfo=0x0) at chkpass.c:88
> > #2 0x1004b874 in OidFunctionCall3 (functionId=269952520, arg1=269952532,
> > arg2=269952540, arg3=269952548) at fmgr.c:1136
> > #3 0x1007f350 in stringTypeDatum (tp=0x10172694, string=0x101726a0 "pendant",
> > atttypmod=269952680) at parse_type.c:181
> > #4 0x10060630 in parser_typecast_constant (expr=0x10172794,
> > typename=0x101727a0) at parse_expr.c:876
>
> This one I believe to the extent of the series of function calls, but
> it's still giving you wrong info about the passed parameters, which
> is pretty common if you compiled at -O2 or higher. Try recompiling with
> "-O0 -g" if you need trustworthy parameter info from the backtrace.
Is that an AIX thing? I generally get reasonable traces on NetBSD.
Anyway, I took your advice and now I get this.
#0 0x0 in ?? () from (unknown load module)
#1 0xd1085aac in chkpass_in (fcinfo=0x2ff1dcb8) at chkpass.c:88
#2 0x1004b874 in OidFunctionCall3 (functionId=269952520, arg1=269952532,
arg2=269952540, arg3=269952548) at fmgr.c:1136
#3 0x1007f350 in stringTypeDatum (tp=0x10172694, string=0x101726a0 "pendant",
atttypmod=269952680) at parse_type.c:181
#4 0x10060630 in parser_typecast_constant (expr=0x10172794,
typename=0x101727a0) at parse_expr.c:876
#5 0x10061188 in transformExpr (pstate=0x10172910, expr=0x10172920,
precedence=269953332) at parse_expr.c:118
#6 0x10076f28 in transformTargetEntry (pstate=0x258, node=0x5c,
expr=0x2ff1df70, colname=0x101729f4 "inner", resjunk=16 '\020')
at parse_target.c:56
#7 0x10077198 in transformTargetList (pstate=0x10172ab8,
targetlist=0x10172ac0) at parse_target.c:158
#8 0x10093c10 in transformSelectStmt (pstate=0x10172b80, stmt=0x10172b88)
at analyze.c:1835
#9 0x1009497c in transformStmt (pstate=0x20000890, parseTree=0x2001f43c)
at analyze.c:226
#10 0x10094ca4 in parse_analyze (parseTree=0x100195f8,
parentParseState=0x200008a4) at analyze.c:86
Looking better. It still seems to be the same error I saw to start with
though. It seems that the loaded dynamic object can't find the address
for palloc() and so jumps to 0. I'm sure that it is an AIX thing but
even IBM can't seem to find the problem.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 8+ messages in thread
* [PATCH 1/2] Allow switch WAL source midst of record.
@ 2017-09-07 03:14 Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
0 siblings, 0 replies; 8+ messages in thread
From: Kyotaro Horiguchi @ 2017-09-07 03:14 UTC (permalink / raw)
The corrent recovery machinary assumes the whole of a record is
avaiable from single source. This prevents a standby from restarting
under a certain condition. This patch allows source switching during
reading a series of continuation records.
---
src/backend/access/transam/xlog.c | 14 ++++++++++++--
src/backend/access/transam/xlogreader.c | 28 ++++++++++++++++++----------
src/include/access/xlogreader.h | 4 ++++
3 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index dd028a1..0d639ec 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -11647,6 +11647,10 @@ retry:
Assert(reqLen <= readLen);
*readTLI = curFileTLI;
+
+ if (!XLogReaderValidatePageHeader(xlogreader, targetPagePtr, readBuf))
+ goto next_record_is_invalid;
+
return readLen;
next_record_is_invalid:
@@ -11781,12 +11785,18 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
}
else
{
- ptr = tliRecPtr;
+ /*
+ * Trying from the current RecPtr, not from the
+ * beginning of the current record. The record may
+ * be no longer available from the master.
+ */
+ ptr = RecPtr;
tli = tliOfPointInHistory(tliRecPtr, expectedTLEs);
if (curFileTLI > 0 && tli < curFileTLI)
elog(ERROR, "according to history file, WAL location %X/%X belongs to timeline %u, but previous recovered WAL file came from timeline %u",
- (uint32) (ptr >> 32), (uint32) ptr,
+ (uint32) (tliRecPtr >> 32),
+ (uint32) tliRecPtr,
tli, curFileTLI);
}
curFileTLI = tli;
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index b1f9b90..78a721a 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -27,8 +27,6 @@
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
-static bool ValidXLogPageHeader(XLogReaderState *state, XLogRecPtr recptr,
- XLogPageHeader hdr);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
@@ -533,7 +531,6 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
*/
if (targetSegNo != state->readSegNo && targetPageOff != 0)
{
- XLogPageHeader hdr;
XLogRecPtr targetSegmentPtr = pageptr - targetPageOff;
readLen = state->read_page(state, targetSegmentPtr, XLOG_BLCKSZ,
@@ -545,9 +542,8 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
/* we can be sure to have enough WAL available, we scrolled back */
Assert(readLen == XLOG_BLCKSZ);
- hdr = (XLogPageHeader) state->readBuf;
-
- if (!ValidXLogPageHeader(state, targetSegmentPtr, hdr))
+ if (!XLogReaderValidatePageHeader(state, targetSegmentPtr,
+ state->readBuf))
goto err;
}
@@ -584,7 +580,7 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
/*
* Now that we know we have the full header, validate it.
*/
- if (!ValidXLogPageHeader(state, pageptr, hdr))
+ if (!XLogReaderValidatePageHeader(state, pageptr, (char *) hdr))
goto err;
/* update read state information */
@@ -710,14 +706,26 @@ ValidXLogRecord(XLogReaderState *state, XLogRecord *record, XLogRecPtr recptr)
/*
* Validate a page header
+ *
+ * Check if phdr is valid as the XLog page header of the XLog page of the page
+ * pointed by recptr.
+ *
+ * phdr is read as XLogPageHeaderData and check if it has valid magic, has no
+ * usused flag bits set and belongs to correct page pointed by recptr. The
+ * incorrect page address is detected usually when we read a page in a
+ * recycled segment.
+ *
+ * If it is the first page in a segment or detected rewind of state,
+ * additional checks are performed.
*/
-static bool
-ValidXLogPageHeader(XLogReaderState *state, XLogRecPtr recptr,
- XLogPageHeader hdr)
+bool
+XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr,
+ char *phdr)
{
XLogRecPtr recaddr;
XLogSegNo segno;
int32 offset;
+ XLogPageHeader hdr = (XLogPageHeader) phdr;
Assert((recptr % XLOG_BLCKSZ) == 0);
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 3a9ebd4..758d880 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -205,6 +205,10 @@ extern void XLogReaderFree(XLogReaderState *state);
extern struct XLogRecord *XLogReadRecord(XLogReaderState *state,
XLogRecPtr recptr, char **errormsg);
+/* Validate a page */
+extern bool XLogReaderValidatePageHeader(XLogReaderState *state,
+ XLogRecPtr recptr, char *phdr);
+
/* Invalidate read state */
extern void XLogReaderInvalReadState(XLogReaderState *state);
--
2.9.2
----Next_Part(Thu_Oct_26_19_05_51_2017_936)--
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
----Next_Part(Thu_Oct_26_19_05_51_2017_936)----
^ permalink raw reply [nested|flat] 8+ messages in thread
* [PATCH 1/2] Allow switch WAL source midst of record.
@ 2017-09-07 03:14 Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
0 siblings, 0 replies; 8+ messages in thread
From: Kyotaro Horiguchi @ 2017-09-07 03:14 UTC (permalink / raw)
The corrent recovery machinary assumes the whole of a record is
avaiable from single source. This prevents a standby from restarting
under a certain condition. This patch allows source switching during
reading a series of continuation records.
---
src/backend/access/transam/xlog.c | 7 ++++++-
src/backend/access/transam/xlogreader.c | 12 +++++-------
src/include/access/xlogreader.h | 5 +++++
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index df4843f..eef3a97 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -11566,6 +11566,11 @@ retry:
Assert(reqLen <= readLen);
*readTLI = curFileTLI;
+
+ if (!XLogReaderValidatePageHeader(xlogreader, targetPagePtr,
+ (XLogPageHeader) readBuf))
+ goto next_record_is_invalid;
+
return readLen;
next_record_is_invalid:
@@ -11700,7 +11705,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
}
else
{
- ptr = tliRecPtr;
+ ptr = RecPtr;
tli = tliOfPointInHistory(tliRecPtr, expectedTLEs);
if (curFileTLI > 0 && tli < curFileTLI)
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 0781a7b..aa05e3f 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -27,8 +27,6 @@
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
-static bool ValidXLogPageHeader(XLogReaderState *state, XLogRecPtr recptr,
- XLogPageHeader hdr);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
@@ -545,7 +543,7 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
hdr = (XLogPageHeader) state->readBuf;
- if (!ValidXLogPageHeader(state, targetSegmentPtr, hdr))
+ if (!XLogReaderValidatePageHeader(state, targetSegmentPtr, hdr))
goto err;
}
@@ -582,7 +580,7 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
/*
* Now that we know we have the full header, validate it.
*/
- if (!ValidXLogPageHeader(state, pageptr, hdr))
+ if (!XLogReaderValidatePageHeader(state, pageptr, hdr))
goto err;
/* update read state information */
@@ -709,9 +707,9 @@ ValidXLogRecord(XLogReaderState *state, XLogRecord *record, XLogRecPtr recptr)
/*
* Validate a page header
*/
-static bool
-ValidXLogPageHeader(XLogReaderState *state, XLogRecPtr recptr,
- XLogPageHeader hdr)
+bool
+XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr,
+ XLogPageHeader hdr)
{
XLogRecPtr recaddr;
XLogSegNo segno;
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 7671598..11b63e7 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -28,6 +28,7 @@
#include "access/xlogrecord.h"
typedef struct XLogReaderState XLogReaderState;
+typedef struct XLogPageHeaderData *XLogPageHeader;
/* Function type definition for the read_page callback */
typedef int (*XLogPageReadCB) (XLogReaderState *xlogreader,
@@ -199,6 +200,10 @@ extern void XLogReaderFree(XLogReaderState *state);
extern struct XLogRecord *XLogReadRecord(XLogReaderState *state,
XLogRecPtr recptr, char **errormsg);
+/* Validate a page */
+extern bool XLogReaderValidatePageHeader(XLogReaderState *state,
+ XLogRecPtr recptr, XLogPageHeader hdr);
+
/* Invalidate read state */
extern void XLogReaderInvalReadState(XLogReaderState *state);
--
2.9.2
----Next_Part(Thu_Sep_07_12_33_47_2017_696)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="0002-Debug-assistant-code.patch"
^ permalink raw reply [nested|flat] 8+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <alvherre@kurilemu.de>
0 siblings, 0 replies; 8+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2026-03-12 15:09 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-28 15:56 User functions and AIX D'Arcy J.M. Cain <darcy@druid.net>
2001-05-28 17:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-28 19:06 ` D'Arcy J.M. Cain <darcy@druid.net>
2001-05-28 19:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-28 21:04 ` D'Arcy J.M. Cain <darcy@druid.net>
2017-09-07 03:14 [PATCH 1/2] Allow switch WAL source midst of record. Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
2017-09-07 03:14 [PATCH 1/2] Allow switch WAL source midst of record. Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <alvherre@kurilemu.de>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox