Re: Extract numeric filed in JSONB more effectively

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: Extract numeric filed in JSONB more effectively
Дата
Msg-id CAKU4AWpnFXYXtfOQp_QdQ7RwCD-d+qzyZKdNygc+9DY8bveVYQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Extract numeric filed in JSONB more effectively  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Extract numeric filed in JSONB more effectively  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers


On Sat, Aug 19, 2023 at 3:09 AM Chapman Flack <chap@anastigmatix.net> wrote:
On 2023-08-18 14:50, Chapman Flack wrote:
> Now, my guess is EXPLAIN is complaining when it sees the Const
> of type internal, and doesn't know how to show that value.
> Perhaps makeRelabelType is the answer there, too: what if the
> Const has Oid type, so EXPLAIN can show it, and what's inserted
> as the function argument is a relabel node saying it's internal?
 
Simply changing the Const to be of type Oid makes EXPLAIN happy,
and nothing ever says "hey, why are you passing this oid for an
arg that wants internal?". This is without adding any relabel
nodes anywhere.


Highlighting the user case of makeRelableType is interesting! But using 
the Oid directly looks more promising for this question IMO, it looks like:
"you said we can put anything in this arg,  so I put an OID const here",
seems nothing is wrong.  Compared with the makeRelableType method,
I think the current method is more straightforward.  Compared with 
anyelement, it avoids the creation of makeDummyConst which I'm not 
sure the implementation is alway correct.  So I am pretty inclined to this way!

v10 attached. 

--
Best Regards
Andy Fan
Вложения

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

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: PostgreSQL 16 RC1 + GA release dates
Следующее
От: Masahiro Ikeda
Дата:
Сообщение: Re: Rethink the wait event names for postgres_fdw, dblink and etc