pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: aleksey.vitaliev@transas.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10014: Does not work PQfn in libpq with array
Date: Mon, 14 Apr 2014 08:42:48 +0000
Message-ID: <20140414084248.15390.12810@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      10014
Logged by:          Vitalyev Aleksey
Email address:      aleksey.vitaliev@transas.com
PostgreSQL version: 9.2.4
Operating system:   Windows 7
Description:        

I have a store procedure __a(INT[] args). I try execute this procedure with
libpq and call PQfn function. How should I transmit array of int from c++
code?
I get only this message "number of array dimensions (16777216) exceeds the
maximum allowed (6)"

This is my code:
      int result_buf = 0;
      int result_len = 0;
      int result_is_int = 0;

      PQArgBlock args[1];
      int iFrom[] = {1,2};
      args[0].len = sizeof(iFrom) * 2;
      args[0].isint = 0;
      args[0].u.ptr = reinterpret_cast<int*> ( iFrom );

      PGresult* res = PQfn( m_conn, 1447769, &result_buf, &result_len,
result_is_int, args, 1 );
      if ( PQresultStatus(res) != PGRES_COMMAND_OK )
      {
         ::OutputDebugStringA( m_stringUtil.FormatEx("ExecFunc
failed!\n%s\n", PQresultErrorMessage(res))  );

         ReleaseResult( res );
         return false;
      }
      ReleaseResult( res );
      return true;


This is store procedure:
CREATE OR REPLACE FUNCTION ___a(oldUniqId INT[]) RETURNS BOOLEAN AS
$$
BEGIN
  RETURN TRUE;
  
END
$$ LANGUAGE plpgsql VOLATILE STRICT;  
ALTER FUNCTION ___a(INT[])
  OWNER TO postgres;


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)  latest in thread

Message-ID: <20140414084248.15390.12810@wrigleys.postgresql.org>
Permalink:  ../20140414084248.15390.12810@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140414084248.15390.12810@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: aleksey.vitaliev@transas.com
  Subject: Re: BUG #10014: Does not work PQfn in libpq with array
  In-Reply-To: <20140414084248.15390.12810@wrigleys.postgresql.org>
  References: <20140414084248.15390.12810@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox