typmod is always -1

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема typmod is always -1
Дата
Msg-id 56EA3507.6090701@anastigmatix.net
обсуждение исходный текст
Ответ на Re: typmod is always -1  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: typmod is always -1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
nothing like resurrecting a really old thread ...

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> I have a problem - every call of mvarcharin is with typmod = -1.

2009/3/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Also, there are a bunch of scenarios where we rely on a cast function to
> apply the typmod rather than passing it to the input function initially.
> I'm not sure if the particular case you're checking here falls into that
> category,

Is it possible to name any case that *does not* fall into that category?

I'm in the same boat ... I have an input function I want to test, and so
far I have failed to think of *any* sql construct that causes it to be
invoked with other than -1 for the typmod.

> but you definitely should have a "length conversion cast"
> function in pg_cast if you expect to do anything useful with typmod.

Ok, that's good to know (and I didn't until now). But back to the
input and recv functions, which are both documented to have 3-arg
forms that get typmods ... how would one test them?  Is there any
sql syntax that can be written to make them get passed a typmod?

If I just write them with assert(typmod == -1), will anyone ever
see a failure?

-Chap



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

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: Re: WIP: Upper planner pathification
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types