1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add PQresStatus() function to avoid direct access to pgresStatus[] array,

making life easier for Windoids...
This commit is contained in:
Tom Lane
1999-02-07 22:08:54 +00:00
parent f280266985
commit fa0f24165c
5 changed files with 23 additions and 11 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.72 1999/02/03 20:19:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.73 1999/02/07 22:08:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1518,6 +1518,15 @@ PQresultStatus(PGresult *res)
return res->resultStatus;
}
const char *
PQresStatus(ExecStatusType status)
{
if (((int) status) < 0 ||
((int) status) >= (sizeof(pgresStatus) / sizeof(pgresStatus[0])))
return "Invalid ExecStatusType code";
return pgresStatus[status];
}
const char *
PQresultErrorMessage(PGresult *res)
{