pgresStatus undefined in interfaces/libpgtcl/libpgtcl.a

From: Brook Milligan <brook(at)trillium(dot)NMSU(dot)Edu>
To: hackers(at)postgreSQL(dot)org
Subject: pgresStatus undefined in interfaces/libpgtcl/libpgtcl.a
Date: 1998-02-23 21:30:36
Message-ID: 199802232130.OAA14957@trillium.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Based on today's snapshot, the symbol _pgresStatus is still undefined
in interfaces/libpgtcl/libpgtcl.a (actually from pgtclCmds.o). The
offending statement in pgtclCmds.c is:

if (strcmp(opt, "-status") == 0)
{
Tcl_AppendResult(interp, pgresStatus[PQresultStatus(result)], 0);
return TCL_OK;
}

It seems like this symbol should refer to an array that is defined in
interfaces/libpq/fe-exec.c (the symbol is declared extern in
interfaces/libpq/libpq-fe.h which is included by pgtclCmds.c):

/* keep this in same order as ExecStatusType in pgtclCmds.h */
const char *pgresStatus[] = {
"PGRES_EMPTY_QUERY",
"PGRES_COMMAND_OK",
"PGRES_TUPLES_OK",
"PGRES_BAD_RESPONSE",
"PGRES_NONFATAL_ERROR",
"PGRES_FATAL_ERROR"
};

One solution is to place this segment of fe-exec.c into a distinct *.c
file that is included by both interfaces/libpq/fe-exec.c and
interfaces/libpgtcl/pgtclCmds.c. Then the symbol would be included in
the libraries as intended.

However, the comment preceding the array definition suggests that
perhaps something should be taken from pgtclCmds.h and the whole thing
organized for sharing between the two directories.

Other solutions may be obvious to those more enlightened on matters of
the organization of this code. As it stands, pgaccess is unusable
because of the undefined symbol.

Can anyone comment on the correct way to solve this problem? I'll
make the patch if that would help.

Cheers,
Brook

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 1998-02-23 21:53:57 Re: [HACKERS] Here it is - view permissions
Previous Message Brett McCormick 1998-02-23 21:22:30 Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru