@ -120,9 +120,7 @@ static int ldapServiceLookup(const char *purl, PQconninfoOption *options,
* by environment variables
* by environment variables
*/
*/
# define DefaultHost "localhost"
# define DefaultHost "localhost"
# define DefaultTty ""
# define DefaultOption ""
# define DefaultOption ""
# define DefaultAuthtype ""
# ifdef USE_SSL
# ifdef USE_SSL
# define DefaultChannelBinding "prefer"
# define DefaultChannelBinding "prefer"
# else
# else
@ -192,14 +190,6 @@ typedef struct _internalPQconninfoOption
} internalPQconninfoOption ;
} internalPQconninfoOption ;
static const internalPQconninfoOption PQconninfoOptions [ ] = {
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 ,
{ " service " , " PGSERVICE " , NULL , NULL ,
" Database-Service " , " " , 20 , - 1 } ,
" Database-Service " , " " , 20 , - 1 } ,
@ -243,14 +233,6 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
" Client-Encoding " , " " , 10 ,
" Client-Encoding " , " " , 10 ,
offsetof ( struct pg_conn , client_encoding_initial ) } ,
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 ,
{ " options " , " PGOPTIONS " , DefaultOption , NULL ,
" Backend-Options " , " " , 40 ,
" Backend-Options " , " " , 40 ,
offsetof ( struct pg_conn , pgoptions ) } ,
offsetof ( struct pg_conn , pgoptions ) } ,
@ -1581,15 +1563,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
goto oom_error ;
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 ( login & & login [ 0 ] ! = ' \0 ' )
{
{
if ( conn - > pguser )
if ( conn - > pguser )
@ -4031,8 +4004,6 @@ freePGconn(PGconn *conn)
free ( conn - > pghostaddr ) ;
free ( conn - > pghostaddr ) ;
if ( conn - > pgport )
if ( conn - > pgport )
free ( conn - > pgport ) ;
free ( conn - > pgport ) ;
if ( conn - > pgtty )
free ( conn - > pgtty ) ;
if ( conn - > connect_timeout )
if ( conn - > connect_timeout )
free ( conn - > connect_timeout ) ;
free ( conn - > connect_timeout ) ;
if ( conn - > pgtcp_user_timeout )
if ( conn - > pgtcp_user_timeout )
@ -6633,12 +6604,16 @@ PQport(const PGconn *conn)
return " " ;
return " " ;
}
}
/*
* No longer does anything , but the function remains for API backwards
* compatibility .
*/
char *
char *
PQtty ( const PGconn * conn )
PQtty ( const PGconn * conn )
{
{
if ( ! conn )
if ( ! conn )
return NULL ;
return NULL ;
return conn - > pgtty ;
return " " ;
}
}
char *
char *