Fix for large file support

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix for large file support
Date: 2007-04-06 12:45:29
Message-ID: 461640E9.3000707@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Current version of postgres support only 1GB chunks. This limit is
defined in the pg_config_manual.h header file. However this setting
allows to have maximal 2GB chunks. Main problem is that md storage
manager and buffile use "long" data type (32bits) for offset instead
"off_t" defined in <sys/types.h>.

off_t is 32bits long on 32bits OS and 64bits long on 64bits OS or when
application is compiled with large file support.

Attached patch allow to setup bigger chunks than 4GB on OS with large
file support.

I tested it on 7GB table and it works.

Please, look on it and let me know your comments or if I miss something.

TODO/questions:

1) clean/update comments about limitation

2) Is there some doc for update?

3) I would like to add some check compare sizeof(off_t) and chunk size
setting and protect postgres with missconfigured chunk size. Is mdinit()
good place for this check?

4) I'm going to take bigger machine for test with really big table.

with regards Zdenek

Attachment Content-Type Size
largefile.diff text/x-patch 16.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2007-04-06 12:58:39 Re: [PATCHES] pgbench transaction timestamps
Previous Message Paul Lindner 2007-04-06 11:25:24 Re: What X86/X64 OS's do we need coverage for?

Browse pgsql-patches by date

  From Date Subject
Next Message Tatsuo Ishii 2007-04-06 12:58:39 Re: [PATCHES] pgbench transaction timestamps
Previous Message Zeugswetter Andreas ADI SD 2007-04-06 10:47:46 Re: Auto Partitioning