I think that my data is saved correctly, but when printing again, other data appears

From: Yessica Brinkmann <yessica(dot)brinkmann(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: I think that my data is saved correctly, but when printing again, other data appears
Date: 2019-10-25 11:37:06
Message-ID: CABrYqSOSaFoM+FWNhajxpygVLWZECLt4nvtAwz7a_gunDgfgzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good day,
I am doing a thesis from the University. My thesis is the modification of
the Gurjeet Index Adviser, to add some features.
I have a function called get_columnnames, which runs on a Postgresql server
and returns the names of the columns of a table in a Postgresql database.
In the first foreach, in the statement: idxcd-> varattnames [cont] = data;
column names are saved. Those column names are saved correctly. I could
verify this by printing some values.
But later, in the following foreach, when I reprint the values of the names
of the columns that had been saved in the idxcd-> varattnames [cont] = data
statement; They appear to me with errors.
That is, for example: if a and b were saved, then print me b and b. This
occurs only when foreach is entered more than once, that is, when there is
more than one candidate index. The truth is that I thought a lot why this
can happen but I can't find an answer. I will greatly appreciate an answer
please.
The line with emphasis (* *) is the one that produces the wrong result.
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.
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 attach my source code.
Best regards,
Yessica Brinkmann

Attachment Content-Type Size
funcion.c application/octet-stream 4.4 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-10-25 13:49:45 Re: Quere keep using temporary files
Previous Message Ravi Krishna 2019-10-25 11:31:33 Re: Index