Re: error in docs - Mailing list pgsql-bugs

From Joe Conway
Subject Re: error in docs
Date
Msg-id 3F3EE2E0.4060104@joeconway.com
Whole thread Raw
In response to error in docs  (andrea gelmini <andrea.gelmini@linux.it>)
List pgsql-bugs
andrea gelmini wrote:
> test=# SELECT * FROM sal_emp WHERE pay_by_quarter[1:4] *= 10000;
> ERROR:  Unable to identify an operator '*=' for types 'integer[]' and 'integer'
>     You will have to retype this query using an explicit cast

There's nothing wrong with the docs (well, at least not with respect to
your specific problem), you just need to read them again. Here's a quote
from the link you supplied:

"However, this quickly becomes tedious for large arrays, and is not
helpful if the size of the array is unknown. Although it is not part
of the primary PostgreSQL distribution, there is an extension available
that defines new functions and operators for iterating over array
values. Using this, the above query could be:"
<...snip...>
"To install this optional module, look in the contrib/array directory
of the PostgreSQL source distribution."

I have no idea how to install contrib/array using debian's package
manager, but that's what you need to do.

HTH,

Joe

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: error in docs
Next
From: Kevin Houle
Date:
Subject: Re: DBD::Pg 'lo_read' fails on >= 32768 byte large objects