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: 2007-04-21 00:46:08
Message-ID: 87odlio8q7.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message judexhuang 2007-04-21 03:38:14 can't start tsearch2 in 8.2.4
Previous Message William Garrison 2007-04-21 00:38:23 Re: Passing arrays to stored procedures