Обсуждение: Arrays, JDBC and Postgresql Functions

Поиск
Список
Период
Сортировка

Arrays, JDBC and Postgresql Functions

От
Hadley Willan
Дата:
Hello All,
   I was just reading the docs. And it's possible to have an array of
data-type in Postgresql, that's all good. However, I was wondering if,
1) I can pass an array into a function?
2) easily iterate through it's elements?
3) Using JDBC and the Postgresql driver pass a Vector of say, BIGINTs to
the function?

Why do I want to do this? Because I could the database perform a
majority some work server side, with a small network request.

Like, an order is consigned to a customer, however, the units on the
order are variable and once approved, I could call the function like,
fn_unit_consign_for_order( BIGINT, BIGINT[] ) where the $1 is the order
Id and BIGINT[] is the units from that order to consign.

Can anybody help thanks.

Hadley