@ -4354,42 +4354,45 @@ BackendInitialize(Port *port)
* now instead of wasting cycles on an authentication exchange . ( This also
* now instead of wasting cycles on an authentication exchange . ( This also
* allows a pg_ping utility to be written . )
* allows a pg_ping utility to be written . )
*/
*/
switch ( port - > canAcceptConnections )
if ( status = = STATUS_OK )
{
{
case CAC_STARTUP :
switch ( port - > canAcceptConnections )
ereport ( FATAL ,
{
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
case CAC_STARTUP :
errmsg ( " the database system is starting up " ) ) ) ;
break ;
case CAC_NOTCONSISTENT :
if ( EnableHotStandby )
ereport ( FATAL ,
ereport ( FATAL ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " the database system is not yet accepting connections " ) ,
errmsg ( " the database system is starting up " ) ) ) ;
errdetail ( " Consistent recovery state has not been yet reached. " ) ) ) ;
break ;
else
case CAC_NOTCONSISTENT :
if ( EnableHotStandby )
ereport ( FATAL ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " the database system is not yet accepting connections " ) ,
errdetail ( " Consistent recovery state has not been yet reached. " ) ) ) ;
else
ereport ( FATAL ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " the database system is not accepting connections " ) ,
errdetail ( " Hot standby mode is disabled. " ) ) ) ;
break ;
case CAC_SHUTDOWN :
ereport ( FATAL ,
ereport ( FATAL ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " the database system is not accepting connections " ) ,
errmsg ( " the database system is shutting down " ) ) ) ;
errdetail ( " Hot standby mode is disabled. " ) ) ) ;
break ;
break ;
case CAC_RECOVERY :
case CAC_SHUTDOWN :
ereport ( FATAL ,
ereport ( FATAL ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " the database system is in recovery mode " ) ) ) ;
errmsg ( " the database system is shutting down " ) ) ) ;
break ;
break ;
case CAC_TOOMANY :
case CAC_RECOVERY :
ereport ( FATAL ,
ereport ( FATAL ,
( errcode ( ERRCODE_TOO_MANY_CONNECTIONS ) ,
( errcode ( ERRCODE_CANNOT_CONNECT_NOW ) ,
errmsg ( " sorry, too many clients already " ) ) ) ;
errmsg ( " the database system is in recovery mode " ) ) ) ;
break ;
break ;
case CAC_OK :
case CAC_TOOMANY :
break ;
ereport ( FATAL ,
}
( errcode ( ERRCODE_TOO_MANY_CONNECTIONS ) ,
errmsg ( " sorry, too many clients already " ) ) ) ;
break ;
case CAC_OK :
break ;
}
}
/*
/*