Rationalizing Query.withCheckOptions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Rationalizing Query.withCheckOptions
Дата
Msg-id 17291.1451495663@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Rationalizing Query.withCheckOptions  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
The RLS patch added this to struct Query:
   List      *withCheckOptions;        /* a list of WithCheckOption's, which                                        *
areonly added during rewrite and                                        * therefore are not written out as
                         * part of Query. */
 

As per the comment, this field is ignored by outfuncs.c and readfuncs.c.
That's pretty horrid, because:

1. Omitting the field from the output of pprint() seriously impedes
debugging.  I could probably have wasted significantly fewer hours
yesterday before figuring out fd195257 if pprint() hadn't been lying
to me about what was in the query data structures.

2. At some point, this will break parallel queries, or perhaps just
cause them to silently fail to enforce RLS, because we depend on
outfuncs/readfuncs to transfer node trees to parallel workers.
(I think there's no live bug today because we only transfer Plans
not Queries, but surely this is a loaded foot-gun.)

3. A node type as fundamental as Query ought not have weird gotchas
like this.

Furthermore, as far as I can see there's actually no point at all to the
special exception.  As the comment says, the list does not get populated
until rewrite time, which means that if outfuncs/readfuncs just process it
normally, it would always be NIL in stored views anyway.

It's too late to change this in 9.5, but I think we should do so
in HEAD.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Shay Rojansky
Дата:
Сообщение: Re: Some 9.5beta2 backend processes not terminating properly?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Some 9.5beta2 backend processes not terminating properly?