Get rid of support for PG versions 8.2 and earlier. These have been unsupported for some time, and the #defines do clutter up the codebase.

This commit is contained in:
Josh Kupershmidt 2012-09-19 17:04:42 -07:00 committed by Daniele Varrazzo
parent 2226f2011d
commit 370e572cfc
2 changed files with 4 additions and 27 deletions

View File

@ -26,29 +26,13 @@ const char *PROGRAM_EMAIL = "reorg-general@lists.pgfoundry.org";
*/
#define APPLY_COUNT 1000
#define SQL_XID_SNAPSHOT_80300 \
#define SQL_XID_SNAPSHOT \
"SELECT reorg.array_accum(virtualtransaction) FROM pg_locks"\
" WHERE locktype = 'virtualxid' AND pid <> pg_backend_pid()"
#define SQL_XID_SNAPSHOT_80200 \
"SELECT reorg.array_accum(transactionid) FROM pg_locks"\
" WHERE locktype = 'transactionid' AND pid <> pg_backend_pid()"
#define SQL_XID_ALIVE_80300 \
"SELECT pid FROM pg_locks WHERE locktype = 'virtualxid'"\
" AND pid <> pg_backend_pid() AND virtualtransaction = ANY($1)"
#define SQL_XID_ALIVE_80200 \
"SELECT pid FROM pg_locks WHERE locktype = 'transactionid'"\
" AND pid <> pg_backend_pid() AND transactionid = ANY($1)"
#define SQL_XID_SNAPSHOT \
(PQserverVersion(connection) >= 80300 \
? SQL_XID_SNAPSHOT_80300 \
: SQL_XID_SNAPSHOT_80200)
#define SQL_XID_ALIVE \
(PQserverVersion(connection) >= 80300 \
? SQL_XID_ALIVE_80300 \
: SQL_XID_ALIVE_80200)
"SELECT pid FROM pg_locks WHERE locktype = 'virtualxid'"\
" AND pid <> pg_backend_pid() AND virtualtransaction = ANY($1)"
/*
* per-table information
@ -452,7 +436,7 @@ reorg_one_table(const reorg_table *table, const char *orderby)
command("BEGIN ISOLATION LEVEL SERIALIZABLE", 0, NULL);
/* SET work_mem = maintenance_work_mem */
command("SELECT set_config('work_mem', current_setting('maintenance_work_mem'), true)", 0, NULL);
if (PQserverVersion(connection) >= 80300 && orderby && !orderby[0])
if (orderby && !orderby[0])
command("SET LOCAL synchronize_seqscans = off", 0, NULL);
res = execute(SQL_XID_SNAPSHOT, 0, NULL);
vxid = strdup(PQgetvalue(res, 0, 0));

View File

@ -389,13 +389,6 @@ prompt_for_password(void)
return simple_prompt("Password: ", 100, false);
}
#if PG_VERSION_NUM < 80300
static bool
PQconnectionNeedsPassword(PGconn *conn)
{
return strcmp(PQerrorMessage(conn), PQnoPasswordSupplied) == 0 && !feof(stdin);
}
#endif
PGconn *
pgut_connect(const char *info, YesNo prompt, int elevel)