pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yessica Brinkmann <yessica.brinkmann@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: The connection to the server was lost. Attempting reset: Failed.
Date: Thu, 10 Oct 2019 12:14:18 -0400
Message-ID: <3613.1570724058@sss.pgh.pa.us> (raw)
In-Reply-To: <CABrYqSORdWxb_eV5=CTWAz=LrkF5Fd8xq_EbtpkvbZkfOF-8_Q@mail.gmail.com>
References: <CABrYqSORdWxb_eV5=CTWAz=LrkF5Fd8xq_EbtpkvbZkfOF-8_Q@mail.gmail.com>

Yessica Brinkmann <yessica.brinkmann@gmail.com> writes:
> I really thought a lot, but I don't understand why but the function fails
> after the expression is executed:
> appendStringInfo (& cols, "% s a.attnum =% d", (i> 0? "OR": ""), idxcd->
> varattno [i]);

I think you're probably shooting yourself in the foot here:

            /* pfree() the memory allocated for the previous candidate. FIXME: Avoid
            * meddling with the internals of a StringInfo, and try to use an API.
            */
            if( cols.len > 0 )
            {
                pfree( cols.data );
                cols.data = NULL;
            } /*IF col.len>0*/

Don't do that, use resetStringInfo() instead.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <3613.1570724058@sss.pgh.pa.us>
Permalink:  ../3613.1570724058@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3613.1570724058@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, yessica.brinkmann@gmail.com
  Subject: Re: The connection to the server was lost. Attempting reset: Failed.
  In-Reply-To: <3613.1570724058@sss.pgh.pa.us>
  References: <CABrYqSORdWxb_eV5=CTWAz=LrkF5Fd8xq_EbtpkvbZkfOF-8_Q@mail.gmail.com> <3613.1570724058@sss.pgh.pa.us>

* 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