File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ static void init_cancel_handler(void);
29
29
static void on_before_exec (PGconn * conn );
30
30
static void on_after_exec (void );
31
31
static void on_interrupt (void );
32
- static void on_exit (void );
32
+ static void on_cleanup (void );
33
33
static void exit_or_abort (int exitcode );
34
34
const char * get_user_name (const char * progname );
35
35
@@ -150,7 +150,7 @@ pgut_getopt(int argc, char **argv)
150
150
}
151
151
152
152
init_cancel_handler ();
153
- atexit (on_exit );
153
+ atexit (on_cleanup );
154
154
155
155
(void ) (dbname ||
156
156
(dbname = getenv ("PGDATABASE" )) ||
@@ -189,7 +189,12 @@ reconnect(void)
189
189
}
190
190
191
191
if (PQstatus (conn ) == CONNECTION_BAD &&
192
+ #if PG_VERSION_NUM >= 80300
192
193
PQconnectionNeedsPassword (conn ) &&
194
+ #else
195
+ strcmp (PQerrorMessage (conn ), PQnoPasswordSupplied ) == 0 &&
196
+ !feof (stdin ) &&
197
+ #endif
193
198
pwd == NULL )
194
199
{
195
200
PQfinish (conn );
@@ -360,7 +365,7 @@ on_interrupt(void)
360
365
static pqbool in_cleanup = false;
361
366
362
367
static void
363
- on_exit (void )
368
+ on_cleanup (void )
364
369
{
365
370
in_cleanup = true;
366
371
pgut_cleanup (false);
Original file line number Diff line number Diff line change 9
9
*/
10
10
11
11
#include "postgres.h"
12
+
13
+ #include <unistd.h>
14
+
12
15
#include "access/transam.h"
13
16
#include "access/xact.h"
14
17
#include "catalog/dependency.h"
You can’t perform that action at this time.
0 commit comments