Re: Container Types

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Container Types
Дата
Msg-id 3e4a42efcb8a42d5fa9ea15adcef78eb466346c4.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Container Types  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, 2023-10-25 at 16:01 -0700, Andres Freund wrote:
> I'd look whether you can generalize that infrastructure.

I had briefly looked at using the record type mechanism before, and it
seemed like a challenge because it doesn't really work when passing
through a function call:

   CREATE TABLE t(a INT, b TEXT);
   INSERT INTO t VALUES(1, 'one');
   CREATE FUNCTION id(RECORD) RETURNS RECORD LANGUAGE plpgsql AS
     $$ BEGIN RETURN $1; END; $$;
   SELECT t.a FROM t; -- 1
   SELECT (id(t)).a FROM t; -- ERROR

But now that I think about it, that's really a type inference
limitation, and that needs to be solved regardless.

After the type inference figures out what the right type is, then I
think you're right that an OID is not required to track it, and however
we do track it should be able to reuse some of the existing
infrastructure for dealing with record types.

Regards,
    Jeff Davis




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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Document aggregate functions better w.r.t. ORDER BY
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Show WAL write and fsync stats in pg_stat_io