Re: [GENERAL] Passing arrays to stored procedures

2007-04-20 Thread William Garrison
Yeah, I meant bytea[]. It still doesn't work. Same error: ERROR: cannot cast type character varying to bytea[] Not that this is not the same as doing select '{1, 2, 3}'::int[]. This is the equivalent of doing SELECT ('{1, 1, 1, 1}'::varchar(255))::int[]; I can

Re: [GENERAL] Passing arrays to stored procedures

2007-04-20 Thread Jorge Godoy
William Garrison <[EMAIL PROTECTED]> 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: > E

Re: [GENERAL] Passing arrays to stored procedures

2007-04-20 Thread William Garrison
Tom Lane wrote: William Garrison <[EMAIL PROTECTED]> writes: I'm using npgsql and C#, and I've realized it doesn't support passing arrays. Barring things like updating npgsql, what form of hackiness would work best here? The customerIDs are GUIDs represented as 16-byte arrays. I can pass t

Re: [GENERAL] Passing arrays to stored procedures

2007-04-20 Thread Tom Lane
William Garrison <[EMAIL PROTECTED]> writes: > I'm using npgsql and C#, and I've realized it doesn't support passing > arrays. Barring things like updating npgsql, what form of hackiness > would work best here? > The customerIDs are GUIDs represented as 16-byte arrays. I can pass > them as en

[GENERAL] Passing arrays to stored procedures

2007-04-20 Thread William Garrison
I have a stored procedure that takes a list of IDs and uses the ANY operator: CREATE OR REPLACE FUNCTION CalculateTotals( customerList bytea[], out total bigint, out most_recent_login_date date) AS $$ BEGIN SELECT SUM(totalsize), MAX(last_login)