Markus Neteler neteler at itc.it
Thu Nov 28 09:51:46 EST 2002

On Thu, Nov 28, 2002 at 12:23:42PM +0000, Glynn Clements wrote:
> > Question for Radim and me is if the need both HAVE_POSTGRES and
> > HAVE_POSTGRES_H or not? If not, as configure[.in] now suggests
> > we had to update all the spreaded HAVE_POSTGRES in 5.1 code to
> > HAVE_POSTGRES_H. No problem of course, but we are not sure what's
> > correct.
> I suspect that both are necessary.
> HAVE_POSTGRES_H indicates that the header file <postgres.h> was found;
> older versions of PostgreSQL have <postgres_fe.h> instead (although
> config.h.in doesn't include an entry for HAVE_POSTGRES_FE_H).
> Note that GRASS probably shouldn't be using either of these headers;
> they concern server internals and, AFAICT, are only meant for use by
> extensions to the server. Clients should normally only need
> <libpq-fe.h>. In 5.0.0, those headers are only used by g.column.pg to
> obtain the value of VARHDRSZ (and that dependendency has been removed
> from the CVS head).

A quick search shows that 5.1 only uses the libpq-fe.h.

find . -type f -name "*.[ch]" -exec grep -l postgres {} \;
 --> not relevant
find . -type f -name "*.[ch]" -exec grep -l libpq-fe.h {} \;

-> 5.1 is fine.

> Presumably HAVE_POSTGRES was meant to reflect whether PostgreSQL
> support was enabled (i.e. --with-postgres, which is the default). In
> which case, I appear to have overlooked it when I updated
> configure[.in].

Thanks for the update.


More information about the grass-dev mailing list