From: | Lana ABADIE <clipperDB(at)gmx(dot)fr> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: printing PGresult content with gdb |
Date: | 2024-07-04 16:11:40 |
Message-ID: | trinity-ad245337-3615-4511-ae0f-293359d4eef9-1720109500405@3c-app-mailcom-bs07 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Envoyé:</b> mercredi 3 juillet 2024 à 17:55<br/>
<b>De:</b> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us><br/>
<b>À:</b> clipperDB(at)gmx(dot)fr<br/>
<b>Cc:</b> pgsql-general(at)lists(dot)postgresql(dot)org<br/>
<b>Objet:</b> Re: printing PGresult content with gdb</div>
<div name="quoted-content">clipperDB(at)gmx(dot)fr writes:<br/>
> I don't know if it is the right mailing list, but i was<br/>
> wondering if one could introspect via gdb the content of PGresult.<br/>
<br/>
You might have better luck with that if you install the debuginfo<br/>
RPM corresponding to your libpq RPM. PGresult's innards are not<br/>
exposed to applications by libpq-fe.h, so your own app's debug<br/>
data is not going to contain the details of the struct. But I think<br/>
it would be available to gdb if libpq's debug symbols were installed.<br/>
<br/>
regards, tom lane</div>
<div name="quoted-content"> </div>
<div name="quoted-content">thanks Tom</div>
<div name="quoted-content">Indeed installing the debuginfo rpm on my system solves the issue, i could print the content</div>
<div name="quoted-content">see trace below</div>
<div name="quoted-content">
<pre>(gdb) p *res
$2 = {ntups = 0, numAttributes = 0, attDescs = 0x0, tuples = 0x0, tupArrSize = 0, numParameters = 0, paramDescs = 0x0, resultStatus = PGRES_FATAL_ERROR,
cmdStatus = "\000ELECT 3\000\061", '\000' <repeats 53 times>, binary = 0, noticeHooks = {noticeRec = 0x7f0731f40770 <defaultNoticeReceiver>, noticeRecArg = 0x0,
noticeProc = 0x7f0731f40500 <defaultNoticeProcessor>, noticeProcArg = 0x0}, events = 0x0, nEvents = 0, client_encoding = 6,
errMsg = 0x7f07180076e8 "server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n",
errFields = 0x0, errQuery = 0x0, null_field = "", curBlock = 0x7f07180076e0, curOffset = 146, spaceLeft = 1902, memorySize = 2264}</pre>
</div>
</div>
</div>
</div></div></body></html>
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/html | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Shenavai, Manuel | 2024-07-04 17:24:37 | RE: Configure autovacuum |
Previous Message | Adrian Klaver | 2024-07-04 15:42:50 | Re: Configure autovacuum |