Unix Technical Forum

Re:

This is a discussion on Re: within the pgsql Hackers forums, part of the PostgreSQL category; --> ipig wrote: > 2.1) How do I efficiently access information in tables from the backend code? > Since heap_open ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 02:36 AM
Alvaro Herrera
 
Posts: n/a
Default Re:

ipig wrote:

> 2.1) How do I efficiently access information in tables from the backend code?
> Since heap_open function needs the oid of the relation, how can I get
> those parameters for heap_open?
>
> Suppose that at the beginning, I only know the name of the relation,
> which functions I need to call?


You can create a RangeVar using makeRangeVar and call heap_openrv().

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 02:36 AM
Bruce Momjian
 
Posts: n/a
Default Re:

Alvaro Herrera wrote:
> ipig wrote:
>
> > 2.1) How do I efficiently access information in tables from the backend code?
> > Since heap_open function needs the oid of the relation, how can I get
> > those parameters for heap_open?
> >
> > Suppose that at the beginning, I only know the name of the relation,
> > which functions I need to call?

>
> You can create a RangeVar using makeRangeVar and call heap_openrv().


Or just look in the code to see how other code is calling heap_open().

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:36 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com