Re: Composite types as parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Composite types as parameters
Дата
Msg-id 3013946.1624722123@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Composite types as parameters  (Elijah Stone <elronnd@elronnd.net>)
Ответы Re: Composite types as parameters  (Elijah Stone <elronnd@elronnd.net>)
Список pgsql-hackers
Elijah Stone <elronnd@elronnd.net> writes:
> I want to execute a query like this:

> PQexecParams("insert into sometable values($1, ...);", paramValues[0] = serialize some record, ...)

> However this fails in coerce_record_to_complex(), because it receives a
> node of type Param, but it can only handle RowExpr and Var.

You probably would have better results from specifying the composite
type explicitly in the query:

PQexecParams("insert into sometable values($1::composite, ...);",

I gather from the complaint that you're currently doing something that
causes the Param to be typed as a generic "record", which is problematic
since the record's details are not available from anyplace.  But if you
cast it directly to a named composite type, that should work.

If it still doesn't work, please provide a more concrete example.

            regards, tom lane



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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: Using each rel as both outer and inner for JOIN_ANTI
Следующее
От: Arne Roland
Дата:
Сообщение: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path