if it had been passed to , and the remaining
parameters are then applied as specified for .
+
+ pgtty is no longer used and any value passed will
+ be ignored.
+
- Returns the debug
TTY of the connection.
- (This is obsolete, since the server no longer pays attention
-
to the TTY setting, but the function remains
- for backward compatibility.)
+ This function no longer does anything, but it remains for backwards
+ compatibility. The function always return an empty string, or
+
NULL if the conn argument is
+ NULL.
char *PQtty(const PGconn *conn);
* by environment variables
*/
#define DefaultHost "localhost"
-#define DefaultTty ""
#define DefaultOption ""
-#define DefaultAuthtype ""
#ifdef USE_SSL
#define DefaultChannelBinding "prefer"
#else
} internalPQconninfoOption;
static const internalPQconninfoOption PQconninfoOptions[] = {
- /*
- * "authtype" is no longer used, so mark it "don't show". We keep it in
- * the array so as not to reject conninfo strings from old apps that might
- * still try to set it.
- */
- {"authtype", "PGAUTHTYPE", DefaultAuthtype, NULL,
- "Database-Authtype", "D", 20, -1},
-
{"service", "PGSERVICE", NULL, NULL,
"Database-Service", "", 20, -1},
"Client-Encoding", "", 10,
offsetof(struct pg_conn, client_encoding_initial)},
- /*
- * "tty" is no longer used either, but keep it present for backwards
- * compatibility.
- */
- {"tty", "PGTTY", DefaultTty, NULL,
- "Backend-Debug-TTY", "D", 40,
- offsetof(struct pg_conn, pgtty)},
-
{"options", "PGOPTIONS", DefaultOption, NULL,
"Backend-Options", "", 40,
offsetof(struct pg_conn, pgoptions)},
goto oom_error;
}
- if (pgtty && pgtty[0] != '\0')
- {
- if (conn->pgtty)
- free(conn->pgtty);
- conn->pgtty = strdup(pgtty);
- if (!conn->pgtty)
- goto oom_error;
- }
-
if (login && login[0] != '\0')
{
if (conn->pguser)
free(conn->pghostaddr);
if (conn->pgport)
free(conn->pgport);
- if (conn->pgtty)
- free(conn->pgtty);
if (conn->connect_timeout)
free(conn->connect_timeout);
if (conn->pgtcp_user_timeout)
return "";
}
+/*
+ * No longer does anything, but the function remains for API backwards
+ * compatibility.
+ */
char *
PQtty(const PGconn *conn)
{
if (!conn)
return NULL;
- return conn->pgtty;
+ return "";
}
char *
* precedence over pghost. */
char *pgport; /* the server's communication port number, or
* a comma-separated list of ports */
- char *pgtty; /* tty on which the backend messages is
- * displayed (OBSOLETE, NOT USED) */
char *connect_timeout; /* connection timeout (numeric string) */
char *pgtcp_user_timeout; /* tcp user timeout (numeric string) */
char *client_encoding_initial; /* encoding to use */
{
char *pghost,
*pgport,
- *pgoptions,
- *pgtty;
+ *pgoptions;
char *dbName1,
*dbName2;
char *tblName;
pgport = NULL; /* port of the backend */
pgoptions = NULL; /* special options to start up the backend
* server */
- pgtty = NULL; /* debugging tty for the backend */
/* make a connection to the database */
- conn1 = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName1);
+ conn1 = PQsetdb(pghost, pgport, pgoptions, NULL, dbName1);
check_prepare_conn(conn1, dbName1);
- conn2 = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName2);
+ conn2 = PQsetdb(pghost, pgport, pgoptions, NULL, dbName2);
check_prepare_conn(conn2, dbName2);
/* start a transaction block */