Re: Is it really such a great idea for spi.h to include the world?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is it really such a great idea for spi.h to include the world?
Date: 2009-01-06 19:05:47
Message-ID: 20090106190547.GD27789@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
> > executor/spi.h includes far more than it needs, starting with postgres.h
> > which as a general rule we don't expect any other header file to
> > include. I think the argument for this was to keep things simple for
> > SPI-using loadable modules, but I doubt that it's really improving their
> > lives much. A quick look through the existing files that include spi.h
> > shows that most of them have to include a pile of other stuff anyway.
> >
> > I propose changing spi.h to follow the same include-only-what-you-must
> > rule as every other backend header file. Thoughts?
>
> I don't think we ever cleaned out spi.h in the past because we were
> worried about 3rd party code using it (I am fine with a cleanup).

I've wondered about spi.h lately too while looking at header cleanup,
and I agree with the proposed solution. The worst that can happen is
that somebody needs to add extra includes in their programs in order for
them to compile with 8.4. We do enough other changes that this one is
really minor. Better late than never anyway.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-06 19:06:03 Re: Warning about the 8.4 release
Previous Message Martin Pihlak 2009-01-06 19:04:11 Re: dblink vs SQL/MED - security and implementation details