dbTalk Databases Forums  

Re: [BUGS] error in docs

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] error in docs in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stephan Szabo
 
Posts: n/a

Default Re: [BUGS] error in docs - 08-16-2003 , 09:10 PM







On Sun, 17 Aug 2003, andrea gelmini wrote:

Quote:
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
I see from those docs:

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:

SELECT * FROM sal_emp WHERE pay_by_quarter[1:4] *= 10000;

---
This is talking about an extension that's not part of the primary
distribution as described in the paragraph before the example.
I believe it's refering to contrib/array.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #2  
Old   
Joe Conway
 
Posts: n/a

Default Re: [BUGS] error in docs - 08-16-2003 , 09:11 PM






andrea gelmini wrote:
Quote:
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


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.