Re: How can i get record by data block not by sql? - Mailing list pgsql-general

From Craig Ringer
Subject Re: How can i get record by data block not by sql?
Date
Msg-id 4E8A7623.5010207@ringerc.id.au
Whole thread Raw
In response to How can i get record by data block not by sql?  ("姜头" <104186179@qq.com>)
List pgsql-general
On 03/10/11 17:03, 姜头 wrote:
How can i get record by data block not by sql?
 
I want to read and write lots of data by data blocks, so i can form a disk-resident tree by recording the block address. But i don't know  how to implement in postgresql.
Is there system function can do this?

It might be a good idea to take a step or three back and ask: "Why?"

What are you trying to achieve? What is the goal?

Is PostgreSQL the right choice? Have you looked at lower-level databases like Berkeley DB, various raw ISAM engines, etc? For that matter, if you want block-level operation, don't you really just want pread() and pwrite()?

If you want to do something within the PostgreSQL engine using your own custom files to store data, you would have to do it by writing C functions as server-side extensions and calling those via SQL to access and manage your data. These functions would have to use their own separate data; they could **NOT** safely use existing postgresql data files in any way.

--
Craig Ringer

pgsql-general by date:

Previous
From: Rodrigo Gonzalez
Date:
Subject: Re: stored function (possible to access file system or call java program)?
Next
From: Venkat Balaji
Date:
Subject: Re: : PostgreSQL Online Backup