Issue With PQftable()

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Issue With PQftable()
Date: 2005-12-12 12:05:31
Message-ID: 200512120705.31782.terry@esc1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello List:

I have a situation where I'm doing a select statement of the form:
SELECT column_1, column_2, my_func(column_3) AS "column_3",
column_4... FROM my_table INNER JOIN other_table ON ...

There are several tables involved in the query. Note that "my_func(column_3)"
from above does some formatting of the data. I issue the command with
PQsendQuery(). When loading a widget with data, I have a need of knowing the
table oid from which the data came. I have been using PQftable() to get that
information, but when I added the "my_func(column_3)" to the query, the value
of PQftable() for each of the columns referenced by calls to my_func() comes
back as zero. PQfname() works correctly because I added the AS "column_3" to
the query.

So, is this the expected behavior or is this a bug? If this is the expected
behavior, is there anything I can do to get hold of the table oid as part of
the select statement?

Using the C api with PostgreSQL version:
rnd=# select version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 7.4.6 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
20030502 (Red Hat Linux 3.2.3-49)
(1 row)

TIA

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-12-12 12:20:42 Re: Issue With PQftable()
Previous Message Richard Huxton 2005-12-12 12:02:14 Re: ODBC connection problems!