[postmodern-devel] one-way array/record/coercion support

Marijn Haverbeke marijnh at gmail.com
Sun Mar 7 08:13:18 UTC 2010


> Then S-SQL could contain a method TO-SQL-STRING specializing on vectors
> and lists, much the same way as it now contains a specialization on
> symbols (see s-sql.lisp, lines 263-264).

Actually, there should probably be a separate method on the s-sql
side, which calls to-sql-string on types it's not specialised on, and
has its own specialisations for symbol. I'll look into this.

> Could you elaborate on how you are getting this error?  I don't seem
> to have problems when passing arrays to prepared statements in this
> way:
>
> weekword=# prepare testme(int[]) as select array_lower($1, 1) as lo,
> array_upper($1, 1) as hi;
> PREPARE
> weekword=# execute testme(array[1,2,3]);

That's the client-side parser helping you out. What I did was prepare
the query in Postmodern, and then trying to execute it with a vector
as one of the arguments. This will cause cl-postgres to call
to-sql-string on the parameter values before stuffing them into the
socket. Apparently, at that level, only the {} syntax is supported.




More information about the postmodern-devel mailing list