Skip to content

Commit 370e572

Browse files
schmiddydvarrazzo
authored andcommitted
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.
1 parent 2226f20 commit 370e572

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

bin/pg_reorg.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,13 @@ const char *PROGRAM_EMAIL = "reorg-general@lists.pgfoundry.org";
2626
*/
2727
#define APPLY_COUNT 1000
2828

29-
#define SQL_XID_SNAPSHOT_80300 \
29+
#define SQL_XID_SNAPSHOT \
3030
"SELECT reorg.array_accum(virtualtransaction) FROM pg_locks"\
3131
" WHERE locktype = 'virtualxid' AND pid <> pg_backend_pid()"
32-
#define SQL_XID_SNAPSHOT_80200 \
33-
"SELECT reorg.array_accum(transactionid) FROM pg_locks"\
34-
" WHERE locktype = 'transactionid' AND pid <> pg_backend_pid()"
3532

36-
#define SQL_XID_ALIVE_80300 \
33+
#define SQL_XID_ALIVE \
3734
"SELECT pid FROM pg_locks WHERE locktype = 'virtualxid'"\
3835
" AND pid <> pg_backend_pid() AND virtualtransaction = ANY($1)"
39-
#define SQL_XID_ALIVE_80200 \
40-
"SELECT pid FROM pg_locks WHERE locktype = 'transactionid'"\
41-
" AND pid <> pg_backend_pid() AND transactionid = ANY($1)"
42-
43-
#define SQL_XID_SNAPSHOT \
44-
(PQserverVersion(connection) >= 80300 \
45-
? SQL_XID_SNAPSHOT_80300 \
46-
: SQL_XID_SNAPSHOT_80200)
47-
48-
#define SQL_XID_ALIVE \
49-
(PQserverVersion(connection) >= 80300 \
50-
? SQL_XID_ALIVE_80300 \
51-
: SQL_XID_ALIVE_80200)
5236

5337
/*
5438
* per-table information
@@ -452,7 +436,7 @@ reorg_one_table(const reorg_table *table, const char *orderby)
452436
command("BEGIN ISOLATION LEVEL SERIALIZABLE", 0, NULL);
453437
/* SET work_mem = maintenance_work_mem */
454438
command("SELECT set_config('work_mem', current_setting('maintenance_work_mem'), true)", 0, NULL);
455-
if (PQserverVersion(connection) >= 80300 && orderby && !orderby[0])
439+
if (orderby && !orderby[0])
456440
command("SET LOCAL synchronize_seqscans = off", 0, NULL);
457441
res = execute(SQL_XID_SNAPSHOT, 0, NULL);
458442
vxid = strdup(PQgetvalue(res, 0, 0));

bin/pgut/pgut.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,6 @@ prompt_for_password(void)
389389
return simple_prompt("Password: ", 100, false);
390390
}
391391

392-
#if PG_VERSION_NUM < 80300
393-
static bool
394-
PQconnectionNeedsPassword(PGconn *conn)
395-
{
396-
return strcmp(PQerrorMessage(conn), PQnoPasswordSupplied) == 0 && !feof(stdin);
397-
}
398-
#endif
399392

400393
PGconn *
401394
pgut_connect(const char *info, YesNo prompt, int elevel)

0 commit comments

Comments
 (0)