Composite types as parameters - Mailing list pgsql-hackers

From Elijah Stone
Subject Composite types as parameters
Date
Msg-id 63c1207e-5537-3815-aa9c-47507943b083@elronnd.net
Whole thread Raw
Responses Re: Composite types as parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: seawasp failing, maybe in glibc allocator
Next
From: Fabien COELHO
Date:
Subject: Re: seawasp failing, maybe in glibc allocator