Re: Can't find relation oid

From: ntinos(at)aueb(dot)gr
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can't find relation oid
Date: 2005-01-03 21:18:19
Message-ID: courier.41D9B69B.0000426E@red.servers.aueb.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Martijn van Oosterhout writes:

>
> On Mon, Jan 03, 2005 at 02:32:44PM +0200, ntinos(at)aueb(dot)gr wrote:
>> Hi,
>>
>> I have the following problem:
>>
>> I use libpq inside SRF functions (like in dblink) and I create some tables
>> to store results coming from remotly executed queries. (These tables are
>> not temporary cause I want to use them later as a form of cache.) Then I
>> try to open these tables to get the results. Actually I modify an already
>> available Query to refer to these new tables instead of the correspoding
>> local tables. To do so I need the Oids of theses new tables which I get
>> using the following query:
>>
>> select oid from pg_class where relname='foo'
>
> What language? What version of postgresql?

I'm using C on PostgreSQL 7.4.2

> It's not exactly clear from your description but is there a reason you
> are using libpq and not the SPI interface?
>If you create a connection
> using libpq to the same database then the queries executed through that
> connection will not be able to see the transaction of the SRF you are
> writing. The SPI interface is for executing queries within the same
> transaction.

Now I think I understand what happens. You see, I used libpq to create the
tables and SPI to retrieve the Oids ($%&^#$%&!!). When I tried to also
retrieve the Oid using libp it worked. I suppose using SPI both to create
the tables and retrieve the Oids will be the right solution. I'll try it!

> Hope this helps,

It did help to understand what was going on!
Thanks!!
Ntinos Katsaros

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-01-03 21:56:22 Re: [ANNOUNCE] PostgreSQL 8.0.0 Release Candidate 3
Previous Message Martijn van Oosterhout 2005-01-03 21:05:47 Re: Can't find relation oid

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2005-01-03 21:36:41 Re: TODO item: make world safe for spaces in build/install paths
Previous Message Kris Jurka 2005-01-03 21:17:40 Re: Implementing RESET CONNECTION ...