Re: Can't find relation oid

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: ntinos(at)aueb(dot)gr
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can't find relation oid
Date: 2005-01-03 21:05:47
Message-ID: 20050103210543.GC11443@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


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?

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.

http://www.postgresql.org/docs/current/static/spi.html

If this doesn't help maybe you should post an example (with code) of
what your problem actually is.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ntinos 2005-01-03 21:18:19 Re: Can't find relation oid
Previous Message Luis Neves 2005-01-03 21:04:36 Re: Postgresql website issues.

Browse pgsql-hackers by date

  From Date Subject
Next Message Kris Jurka 2005-01-03 21:17:40 Re: Implementing RESET CONNECTION ...
Previous Message Merlin Moncure 2005-01-03 20:32:28 possible bug in case comparison on index scan.