Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Passing arrays to stored procedures


  • From: Jorge Godoy <jgodoy(at)gmail(dot)com>
  • To: William Garrison <postgres(at)mobydisk(dot)com>
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: Passing arrays to stored procedures
  • Date: Fri, 20 Apr 2007 21:46:08 -0300
  • Message-id: <87odlio8q7(dot)fsf(at)gmail(dot)com>

William Garrison <postgres(at)mobydisk(dot)com> writes:

>     WHERE customerid = ANY($1);
> Results in the error:
>     ERROR: op ANY/ALL (array) requires array on right side
>
> I tried casting the character string to an array afterward:
>
>     WHERE customerid = ANY($1::bytea);
> which results in:
>     ERROR: cannot cast type character varying to bytea

You meant array or bytea?


neo=# select '{1, 2, 3}'::int[];
  int4   
---------
 {1,2,3}
(1 record)

neo=# 


-- 
Jorge Godoy      <jgodoy(at)gmail(dot)com>



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group