Thread: Array Parameters on protocol 3.0

Array Parameters on protocol 3.0

From
Carlos Guzman Alvarez
Date:
Hello:

I'm trying to give support to array parameters for sql commands in my 
.net data provider for postgres 7.4, i'm sending the same data as i need 
for read array field values but i get always the error :
insufficient data left in message

I'm sending this for array parameters (in binary format):
* the number of dimensions.
* flags (always 0).
* base type of the array elements (oid).
* lengths and lower bounds.
* array values.        * value size.
    * value.


Is this correct ??



-- 
Best regards

Carlos Guzmán Álvarez
Vigo-Spain



Re: Array Parameters on protocol 3.0

From
Tom Lane
Date:
Carlos Guzman Alvarez <carlosga@telefonica.net> writes:
> I'm sending this for array parameters (in binary format):
>     * the number of dimensions.
>     * flags (always 0).
>     * base type of the array elements (oid).
>     * lengths and lower bounds.
>     * array values.
>         * value size.
>         * value.

> Is this correct ??

Looks right to me.  Either you have some small typo in your code, or the
backend does ... let me know which ...

Note that "insufficient data left in message" could arise from
misformatting of an individual array element with respect to its
individual value size, not only from a mistake at the whole-array level.
        regards, tom lane


Re: Array Parameters on protocol 3.0

From
Carlos Guzman Alvarez
Date:
Hello:

> Looks right to me.  Either you have some small typo in your code, or the
> backend does ... let me know which ...
> 
> Note that "insufficient data left in message" could arise from
> misformatting of an individual array element with respect to its
> individual value size, not only from a mistake at the whole-array level.

I think I have it fixed yet :) i was not sending the length of the whole 
array parameter :)


Thanks very much.





-- 
Best regards

Carlos Guzmán Álvarez
Vigo-Spain



Re: Array Parameters on protocol 3.0

From
Carlos Guzman Alvarez
Date:
Hello:

> Looks right to me.  Either you have some small typo in your code, or the
> backend does ... let me know which ...
> 
> Note that "insufficient data left in message" could arise from
> misformatting of an individual array element with respect to its
> individual value size, not only from a mistake at the whole-array level.

Seems that i have it working now :), i was not sending the length of the 
whole array information :)


Thanks very much.



-- 
Best regards

Carlos Guzmán Álvarez
Vigo-Spain