Thread: $PGSQL/include/postgres.h

$PGSQL/include/postgres.h

From
Jim Mercer
Date:
did this recently go away?

recently i decided to upgrade some stuff from pgsql 6.x to 7.1.2 and
am trying to build php.

it does not appear that there is a /usr/local/pgsql/include/postgres.h
any more.

according to the ChangeLogs:

 "there are now
  separate files "postgres.h" and "postgres_fe.h", which are meant to
  be the primary include files for backend .c files and frontend .c
  files respectively.  By default, only include files meant for
  frontend use are installed into the installation include directory."

is it my understanding that postgres.h is only supposed to be used by
server/backend code?

if so, this decision could cause a good chunk of existing code to break.

--
[ Jim Mercer        jim@reptiles.org         +1 416 410-5633 ]
[ Now with more and longer words for your reading enjoyment. ]

Re: $PGSQL/include/postgres.h

From
Tom Lane
Date:
Jim Mercer <jim@reptiles.org> writes:
> recently i decided to upgrade some stuff from pgsql 6.x to 7.1.2 and
> am trying to build php.
> it does not appear that there is a /usr/local/pgsql/include/postgres.h
> any more.

There is not, by default.  PHP should never have included it in the
first place (and does not anymore, I understand).

> if so, this decision could cause a good chunk of existing code to break.

Only code that was erroneous to begin with ... clients shouldn't be
pulling in that file, it merely pollutes their namespace.

            regards, tom lane

Re: $PGSQL/include/postgres.h

From
Jim Mercer
Date:
On Wed, May 23, 2001 at 04:05:40PM -0400, Tom Lane wrote:
> Jim Mercer <jim@reptiles.org> writes:
> > recently i decided to upgrade some stuff from pgsql 6.x to 7.1.2 and
> > am trying to build php.
> > it does not appear that there is a /usr/local/pgsql/include/postgres.h
> > any more.
>
> There is not, by default.  PHP should never have included it in the
> first place (and does not anymore, I understand).

ah, this is true.

i was initially puzzled as to why php wasn't finding pgsql, even though i had
--enable-pgsql on the configure line.

i initially suspected (since 7.1.2 was new) that something was missing and
the configure script couldn't find things.  this is when i noticed the missing
postgres.h file.

however, i later discovered that in other installations, i used "--with-pgsql".

i changed "enable" to "with" and, voila, php found pgsql.

(slap forehead)

> > if so, this decision could cause a good chunk of existing code to break.
>
> Only code that was erroneous to begin with ... clients shouldn't be
> pulling in that file, it merely pollutes their namespace.

true enough.  i looked at my own code, and it doesn't include postgres.h.

--
[ Jim Mercer        jim@reptiles.org         +1 416 410-5633 ]
[ Now with more and longer words for your reading enjoyment. ]