PgSqlArray with PgSqlType.ByteA

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Ralf Jansen
Posts: 3
Joined: Fri 29 Jul 2011 15:12

PgSqlArray with PgSqlType.ByteA

Post by Ralf Jansen » Fri 29 Jul 2011 15:43

Hi,

i'm trying to send an array of bytes[] as PgSqlType.ByteA to a stored function.

Code: Select all

byte[][] positions = new byte[10][];
// filling positions - 2.Dimension is of variable length

using (PgSqlCommand command = CreateCommand(tx))
{
    command.CommandType = CommandType.StoredProcedure;
    command.CommandText = @"MyProc";
    command.Parameters.Add("@param", PgSqlType.Array).Value = new PgSqlArray(positions, PgSqlType.ByteA, 1, positions.Length);
    command.ExecuteNonQuery();
}
I receive an
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
Exception on ExecuteNonQuery(). I have no problem doing the same with Varchar, Int, BigInt etc. Did i hit a limitation of the Array Type or am i doing something wrong?

Ralf

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 02 Aug 2011 15:18

Is DDL of "MyProc" something like this?

Code: Select all

create or replace function "MyProc"(bytea[]) returns...
Please specify the DDL of your "MyProc", the versions of your dotConnect for PostgreSQL (x.xx.xxx) and PostgreSQL server (x.x.x).

Ralf Jansen
Posts: 3
Joined: Fri 29 Jul 2011 15:12

Post by Ralf Jansen » Wed 03 Aug 2011 07:27

MyProc just looks like this

Code: Select all

CREATE OR REPLACE FUNCTION fn_MyProc (cpositions bytea[])
  RETURNS void AS
$BODY$
BEGIN
   -- nop
END $BODY$
  LANGUAGE plpgsql VOLATILE STRICT
  COST 100;
The dotConnect Version is 5.30.196.0 and the PostgreSQL Server is 9.0.4 64bit.

But i have to say that i could not replicate the behaviour this morning. Possibly i had some interference with the same test using varchar instead of bytea. See the other thread where you said you could reproduce the error when using varchar.

Thanks
Ralf

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 03 Aug 2011 14:13


Post Reply