The connection to the server was lost. Attempting reset: Failed.

From: Yessica Brinkmann <yessica(dot)brinkmann(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: The connection to the server was lost. Attempting reset: Failed.
Date: 2019-10-10 15:55:43
Message-ID: CABrYqSORdWxb_eV5=CTWAz=LrkF5Fd8xq_EbtpkvbZkfOF-8_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good afternoon,
I am doing a thesis from the University. My thesis is the modification of
the Gurjeet Index Adviser, to add some features.
At the moment I am modifying one of the .c files and adding a function
called get_columnames that returns the names of the columns of a table,
passing it the numbers of the attributes.
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]);
The error appears only to me when entering the cycle:
foreach (cell, candidates) / * foreach cell in candidates * /
more than once, that is, when you have more than one candidate index. If
the cycle is entered only once, the function works correctly.
The error that appears to me is that the connection to the PostgreSQL
server is directly lost. I proved that the error occurs in that statement,
printing some values.
The error that appears to me is the following:
The connection to the server was lost. Attempting reset: Failed.
I attach the source code of the function (function.c) and the log file with
the output of the last executions.
I clarify that the foreach cycle for the c language is defined in #include
"nodes / pg_list.h"
I am using Postgresql 8.3.23.
I clarify that I use that version because it is compatible with the Index
Adviser, which I am modifying for my University thesis.
I was analyzing and researching on the compilation without optimizations,
with symbols and also on the use of gbd. Very interesting everything.
My query is now if all this can be applied the same if a Makefile is used.
Because the Index Adviser comes with a Makefile that runs for compilation.
That is, as I read it is more or less easy to apply all this if I'm going
to compile from the command line but having the Makefile, the truth is that
I don't know how to apply it. I am new with Linux.
The Linux distribution I use is Debian 9.x 64-bit.
And the version of C (gcc) that I use is 6.3.0
I will greatly appreciate an answer please,
I also attach the Index Adviser Makefile.
I would greatly appreciate a help please. I really am not knowing how to
move forward.
As I commented, my function works for the case in which the foreach is
entered only once. But when you enter more than once, it doesn't work. That
is, when you have more than one candidate index, it gives me that error.
This means that, for example, for a simple Select type statement or that
has an AND it works for me. But for the case where the Select statement has
an OR for example, it doesn't work. Because you already have more than one
candidate index and enter the foreach more than once.
I will be very grateful if anyone can help me please.
I already thought a lot why the mistake could happen but I can't really
find a reason.
Best regards,
Yessica Brinkmann

Attachment Content-Type Size
logfile.txt text/plain 4.5 KB
función.c application/octet-stream 4.3 KB
makefile.txt text/plain 853 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-10-10 16:14:18 Re: The connection to the server was lost. Attempting reset: Failed.
Previous Message Igal @ Lucee.org 2019-10-10 15:34:26 Re: Case Insensitive Comparison with Postgres 12