Re: [HACKERS] Re: varchar() troubles (fwd)

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Re: varchar() troubles (fwd)
Дата
Msg-id 199801160549.AAA06799@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: varchar() troubles (fwd)  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
>
> > OK, here is a temporary fix to the problem.  It does the heap_open(),
> > then replaces the attrs for VARCHAR with attlen of -1.  You can't just
> > change the field, because the data is in a cache and you are just
> > returned a pointer.
> >
> > Can I add an 'attdeflen' for "attributed defined length" field to
> > pg_attribute, and change the attlen references needed to the new field?
> > This is the only proper way to fix it.
>
> Bruce, does your "temporary fix" seem to repair all known problems with varchar()? If so, would you be interested in
> holding off on a "proper fix" and coming back to it after v6.3 is released? At that time, we can try solving the
general
> problem of retaining column-specific attributes, such as your max len for varchar, declared dimensions for arrays,
and
> numeric() and decimal() types. Or, if you have time to try a solution now _and_ come back to it later...
>
>                                                       - Tom
>
>

In fact, I am inclined to leave attlen unchanged, and add atttyplen that
is a copy of the length of the type.  That way, the attlen for varchar()
really contains the defined length, and atttyplen is used for disk
references, and it is very clear what it means.


--
Bruce Momjian
maillist@candle.pha.pa.us

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

Предыдущее
От: "Darrell A. Escola"
Дата:
Сообщение: Re: [HACKERS] Cannot build recent snapshot
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: varchar() troubles (fwd)