No title

Started by ipigover 19 years ago3 messages
#1ipig
ipig@ercist.iscas.ac.cn

Hi,

I am now studying PostgreSQL.

in your web site:
Developer's Frequently Asked Questions (FAQ) for PostgreSQL
Technical Questions
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?

Best regards.

#2Alvaro Herrera
alvherre@commandprompt.com
In reply to: ipig (#1)
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.

#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Alvaro Herrera (#2)
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. +