Composite types as parameters

Поиск
Список
Период
Сортировка
От Elijah Stone
Тема Composite types as parameters
Дата
Msg-id 63c1207e-5537-3815-aa9c-47507943b083@elronnd.net
обсуждение исходный текст
Ответы Re: Composite types as parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello all,

I am trying to add support for composite types to my ORM, which uses libpq 
and the binary format.

Given a schema like this one:

create type composite as (...);
create table sometable (field composite, ...);

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.  There is a 
comment suggesting that this is not a fundamental limitation, but (not 
being familiar with postgres codebase) I'm not sure how to go about fixing 
it.  I assume there is a mapping somewhere from param ids to objects, but 
am unable to find it.

Does anyone have any pointers or suggestions?  Am I going about this in 
entirely the wrong way?

  -E



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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: seawasp failing, maybe in glibc allocator
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: seawasp failing, maybe in glibc allocator