From: Alvaro Herrera on
Tom Lane wrote:

> It turns out that this typedef is needed in two relatively low-level
> .h files: nodes/params.h and utils/plancache.h. My original idea had
> been to define the hook typedef in parser/parse_node.h where struct
> ParseState is defined. But that would have required pulling a boatload
> of parser headers into these two .h files, which seems like a bad idea
> (it might even lead to circular includes). For the moment I've worked
> around this by putting the typedef into nodes/params.h itself, but I
> can't say I find that a pleasing solution. Has anyone got a better
> idea? Should we make a parser/something header that just provides that
> typedef?

Hmm ... if you create the new include file, is that going to avoid
having to include params.h in plancache.h? If not, I don't think
there's much point in having a new file (other than the typedef just not
fitting in params.h).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Alvaro Herrera <alvherre(a)commandprompt.com> writes:
> Tom Lane wrote:
>> ... For the moment I've worked
>> around this by putting the typedef into nodes/params.h itself, but I
>> can't say I find that a pleasing solution. Has anyone got a better
>> idea? Should we make a parser/something header that just provides that
>> typedef?

> Hmm ... if you create the new include file, is that going to avoid
> having to include params.h in plancache.h?

Well, it'd include the new file instead of params.h.

> If not, I don't think there's much point in having a new file (other
> than the typedef just not fitting in params.h).

Yeah, what's bothering me is that it just doesn't fit there --- doesn't
seem to satisfy the POLA. But I guess there are plenty of bigger
issues than that in our code base.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Alvaro Herrera on
Tom Lane wrote:
> Alvaro Herrera <alvherre(a)commandprompt.com> writes:
> > Tom Lane wrote:
> >> ... For the moment I've worked
> >> around this by putting the typedef into nodes/params.h itself, but I
> >> can't say I find that a pleasing solution. Has anyone got a better
> >> idea? Should we make a parser/something header that just provides that
> >> typedef?
>
> > Hmm ... if you create the new include file, is that going to avoid
> > having to include params.h in plancache.h?
>
> Well, it'd include the new file instead of params.h.

It would be a problem if params.h included some other stuff, but since
it's standalone I can't say it's a problem.

> > If not, I don't think there's much point in having a new file (other
> > than the typedef just not fitting in params.h).
>
> Yeah, what's bothering me is that it just doesn't fit there --- doesn't
> seem to satisfy the POLA. But I guess there are plenty of bigger
> issues than that in our code base.

Yeah.

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

 | 
Pages: 1
Prev: Segfault in PL/Python
Next: prog