Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
Дата
Msg-id 1312830351-sup-2573@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Excerpts from Alexander Korotkov's message of lun ago 08 13:21:17 -0400 2011:
> On Mon, Aug 8, 2011 at 8:27 PM, Alvaro Herrera
> <alvherre@commandprompt.com>wrote:
> 
> > An array of relopt_string?  Isn't that a bit strange?  If I recall
> > correctly, the point of this was to be able to allocate the
> > relopt_string struct and the char array itself as a single palloc unit,
> > in a single call somewhere in the reloptions API (which was convoluted
> > in some points precisely to let the string case work).  I don't have the
> > details of this fresh in my mind though.  It certainly worked with more
> > than one string option when I committed it, IIRC.
> >
> Yes, it seems strange. But it also seems that both were added by your commit
> of table-based parser:
> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ba748f7a11ef884277b61d1708a17a44acfd1736

Oh, you're adding options directly to stringRelOpts?  Hmm, I can't
remember whether I tried to do that; I have memory of testing string
options via add_string_reloption ... and in reflection, it seems obvious
that it would fail.

Perhaps the easiest way to fix it is as you suggest, by declaring the
struct to take a pointer rather than the value directly.  Not sure how
to make both cases work sanely; the add_string_reloption path will need
updates.  I don't have time to work on it right now though.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: fstat vs. lseek
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: WIP fix proposal for bug #6123