Skip to content

Commit

Permalink
Get rid of support for PG versions 8.2 and earlier. These have been u…
Browse files Browse the repository at this point in the history
…nsupported for some time, and the #defines do clutter up the codebase.
  • Loading branch information
schmiddy authored and dvarrazzo committed Sep 22, 2012
1 parent 2226f20 commit 370e572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
22 changes: 3 additions & 19 deletions bin/pg_reorg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
#define SQL_XID_ALIVE \
"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)

/*
* per-table information
Expand Down Expand Up @@ -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));
Expand Down
7 changes: 0 additions & 7 deletions bin/pgut/pgut.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 370e572

Please sign in to comment.