summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg')
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c6
-rw-r--r--src/interfaces/ecpg/ecpglib/error.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 6574216a60..4b7683633b 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.16 2003/08/08 13:16:20 petere Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.17 2003/08/24 18:36:38 petere Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -158,8 +158,8 @@ ECPGsetconn(int lineno, const char *connection_name)
static void
ECPGnoticeReceiver(void *arg, const PGresult *result)
{
- char *sqlstate = PQresultErrorField(result, 'C');
- char *message = PQresultErrorField(result, 'M');
+ char *sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE);
+ char *message = PQresultErrorField(result, PG_DIAG_MESSAGE_PRIMARY);
struct sqlca_t *sqlca = ECPGget_sqlca();
int sqlcode;
diff --git a/src/interfaces/ecpg/ecpglib/error.c b/src/interfaces/ecpg/ecpglib/error.c
index 82f2ccca36..48b879d546 100644
--- a/src/interfaces/ecpg/ecpglib/error.c
+++ b/src/interfaces/ecpg/ecpglib/error.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.7 2003/08/08 13:16:20 petere Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.8 2003/08/24 18:36:38 petere Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -164,10 +164,10 @@ ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat)
if (result)
{
- sqlstate = PQresultErrorField(result, 'C');
+ sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE);
if (sqlstate == NULL)
sqlstate = ECPG_SQLSTATE_ECPG_INTERNAL_ERROR;
- message = PQresultErrorField(result, 'M');
+ message = PQresultErrorField(result, PG_DIAG_MESSAGE_PRIMARY);
}
else
{