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

Commit603f601

Browse files
committed
Attached is a patch to contrib/dbmirror that fixes a bug that was
causing the postmaster to crash when the trigger was running on a tablewithout a primary key.I've also updated the docs to explicitly say that tables need primarykeys.Steven Singer
1 parentb2c34e2 commit603f601

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎contrib/dbmirror/README.dbmirror

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Execute the SQL code in AddTrigger.sql once for each table that should
120120
be mirrored. Replace MyTableName with the name of the table that should
121121
be mirrored.
122122

123+
NOTE: DBMirror requires that every table being mirrored have a primary key
124+
defined.
125+
123126
5) Create the slave database.
124127

125128
The DBMirror system keeps the contents of mirrored tables identical on the

‎contrib/dbmirror/pending.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* pending.c
3-
* $Id: pending.c,v 1.4 2002/09/05 00:43:06 tgl Exp $
3+
* $Id: pending.c,v 1.5 2002/09/26 05:24:30 momjian Exp $
44
*
55
* This file contains a trigger for Postgresql-7.x to record changes to tables
66
* to a pending table for mirroring.
@@ -225,6 +225,11 @@ storeKeyInfo(char *cpTableName, HeapTuple tTupleData,
225225

226226
/* pplan = SPI_saveplan(pplan); */
227227
cpKeyData=packageData(tTupleData,tTupleDesc,tpTrigData,PRIMARY);
228+
if (cpKeyData==NULL)
229+
{
230+
elog(ERROR,"Could not determine primary key data");
231+
return-1;
232+
}
228233
#if definedDEBUG_OUTPUT
229234
elog(NOTICE,cpKeyData);
230235
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp