Search Postgresql Archives

Re: How can I pass an array to SPI_execute_with_args()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Boszormenyi Zoltan <zb@xxxxxxxxxxx> writes:
> I would like to execute the code below.

Since you're apparently deconstructing and reconstructing the array
anyway, why don't you do the insertion at the C-array stage, and
do just one construct_array() that yields the final result?

> If the above marked line sets oids[1] = INT8OID, I get this error:

> ERROR:  function array_append(anyarray, bigint) does not exist
> LINE 1: UPDATE product.t_product_inv SET ids = array_append($1, $2) ...
>                                                ^

You'd need to use the types int8[] and int8, explicitly.  No ANYARRAY.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux