From 66ae2f33a74943d75e6049603fa07eacf46fa1be Mon Sep 17 00:00:00 2001 From: Josh Kupershmidt Date: Thu, 6 Dec 2012 21:05:54 -0700 Subject: [PATCH] Downgrade ERROR to WARNING in the case where a table does not have a primary key or not-null unique key. We want to be able to keep processing further tables if we encounter this problem on one of many --tables. --- bin/pg_repack.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index d2de3d0..5815cde 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -472,10 +472,12 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize) table.pkid = getoid(res, i, c++); table.ckid = getoid(res, i, c++); - if (table.pkid == 0) - ereport(ERROR, - (errcode(E_PG_COMMAND), - errmsg("relation \"%s\" must have a primary key or not-null unique keys", table.target_name))); + if (table.pkid == 0) { + ereport(WARNING, + (errcode(E_PG_COMMAND), + errmsg("relation \"%s\" must have a primary key or not-null unique keys", table.target_name))); + continue; + } table.create_pktype = getstr(res, i, c++); table.create_log = getstr(res, i, c++);