473,394 Members | 1,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can connection pointer be obtained from PGresult?

I inherited some C code that works as a series of libraries using
libpq. One of the libraries has an input to it of a PGresult pointer,
but not of a PGconnect pointer. Within the library, the code tries to
determine the host name of the connection by doing the following
trick:

strcpy (host,PQhost(((PGresult*)*pgresult)->xconn));

This worked fine in the past (v. 7.0) despite being warned against in
the documentation since directly accessing the structures in PGresult
seems to be off limits (I suppose in case its structure changes with
PG version).

I'm trying to think of a workaround that would do things right without
having to explicitly pass PGconn pointer into the code. Perhaps this
can't be done, but I thought I'd throw out the question and wait for
the verbal abuse.

-Tony
Nov 23 '05 #1
0 840

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: genetic.error | last post by:
I installed VS.NET 2003 on Windows 2000 Pro SP3. Since doing so, I have no internet connection. Also, I have no access to my home network. I've done everything I can think of to correct the...
2
by: meng | last post by:
is it possible to use a single connection object shared by several tasks where each task is handled by a thread? these tasks call stored procedures that return record sets, no editing, update or...
4
by: Vijai Kalyan | last post by:
I was decomposing a task into different policies. Essentially, there is a general option obtained from a server and user options obtained from configuration variables. The two options are...
4
by: Edward Singleton | last post by:
I am currently developing a web app using WSAD 5.1 and DB2 V7.2.8. I understand there is a myriad of database errors related to obtaining valid connections that are mapped directly to...
6
by: charliewest | last post by:
I have developed an application for WM 2003, which frequently transacts with a sql server ce 2.0 database. I have several procedures which utilize the following code: cn = new...
4
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
11
by: redefined.horizons | last post by:
First, I would thank all of those that took the time to answer my question about creating an array based on a numeric value stored in a variable. I realize after reading the responses and doing...
1
by: Pradeep83 | last post by:
Hi All Problem : I am unable to retrieve the data from the table in postgres database using C application which i have written in solaris os. Query: How to check whether connection is there...
2
by: SYT | last post by:
Hello, I got "Connection to database failed." error from the following C program. Could anyone help me to solve this problem? #include <stdio.h> #include <stdlib.h> #include "libpq-fe.h" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.