Thread: Help on copy function

Help on copy function

From
frederic.germaneau@bull.net
Date:
I'm trying to stress PostgreSQL 8beta3 on AIX5.2 with TPCH 1 Go

I have created and configurated a database on 2 tablespaces : first one for
indexes and second one for tables
First script for database creation:

$ more scrCreateDataBase.sh
psql template1<<!
create tablespace dataTbl location '/postgres_data/TpchDataTableSpace';
create tablespace indexTbl location '/postgres_data/TpchIndexTableSpace';
!
createdb tpch
psql tpch<<!
create schema postgres tablespace dataTbl;
!

An example of table script:
$ more cre_tab_part.sql
CREATE TABLE part(
    p_partkey            bigint NOT NULL,
    p_type               varchar(25) ,
    p_size               integer ,
    p_brand              char(10) ,
    p_name               varchar(55) ,
    p_container          char(10) ,
    p_mfgr               char(25) ,
    p_retailprice        decimal ,
    p_comment            varchar(23)
)
;
ALTER TABLE part ADD CONSTRAINT pk_part PRIMARY KEY(p_partkey) USING INDEX
TABLE
SPACE indexTbl;
\q

I populate my database with a shell script which is launching in parallel
each copy statement:
$ more load.sh
for i in `ls *.loader.psql`
do
psql -f $i tpch &
done

An example of copy statement file:
$ more lineitem.loader.psql
\copy lineitem from lineitem.tbl.psql delimiter '|'

And an error occurs :
psql:lineitem.loader.psql:1: ERROR:  could not extend relation
24342131/24342133
/24342324: There is not enough space in the file system.
HINT:  Check free disk space.
CONTEXT:  COPY lineitem, line 1:
"1996-03-13|1|0.04|21168.23|7706|17|N|155190|O|
0.02|1996-02-12|1996-03-22|TRUCK|1|DELIVER IN PERSON|b..."

but my fileSystem has something like 2Go free when copy fails!

Has anybody an explication? Which error I have done?

Thanks

Frédéric GERMANEAU



Re: Help on copy function

From
Tom Lane
Date:
frederic.germaneau@bull.net writes:
> And an error occurs :
> psql:lineitem.loader.psql:1: ERROR:  could not extend relation
> 24342131/24342133
> /24342324: There is not enough space in the file system.
> HINT:  Check free disk space.

> but my fileSystem has something like 2Go free when copy fails!

Maybe you are running the postmaster under a disk-space-usage limit?
I'm not sure that there's a separate errno for "you can't have any
more space" as opposed to "there isn't any more space".

            regards, tom lane

Re: Help on copy function

From
Doug McNaught
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> frederic.germaneau@bull.net writes:
>> And an error occurs :
>> psql:lineitem.loader.psql:1: ERROR:  could not extend relation
>> 24342131/24342133
>> /24342324: There is not enough space in the file system.
>> HINT:  Check free disk space.
>
>> but my fileSystem has something like 2Go free when copy fails!
>
> Maybe you are running the postmaster under a disk-space-usage limit?
> I'm not sure that there's a separate errno for "you can't have any
> more space" as opposed to "there isn't any more space".

It's also possible that PG is trying to create a new table file and
he's out of inodes...

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

Re: Help on copy function

From
Tom Lane
Date:
Doug McNaught <doug@mcnaught.org> writes:
>>> psql:lineitem.loader.psql:1: ERROR:  could not extend relation
>>> 24342131/24342133
>>> /24342324: There is not enough space in the file system.
>>> HINT:  Check free disk space.
>>
>> Maybe you are running the postmaster under a disk-space-usage limit?
>> I'm not sure that there's a separate errno for "you can't have any
>> more space" as opposed to "there isn't any more space".

> It's also possible that PG is trying to create a new table file and
> he's out of inodes...

Good thought, although I think that this particular error message would
only come out from a seek/write failure and not from an open failure.
In any case it's some sort of externally imposed resource limit ...

            regards, tom lane

Re: Help on copy function

From
Doug McNaught
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Doug McNaught <doug@mcnaught.org> writes:

>> It's also possible that PG is trying to create a new table file and
>> he's out of inodes...
>
> Good thought, although I think that this particular error message would
> only come out from a seek/write failure and not from an open failure.
> In any case it's some sort of externally imposed resource limit ...

Yeah.  My first reaction to "inexplicable ENOSPC" is always "are you
out of inodes?" just because I've been bitten by it several times and
felt like an idiot afterwards.  ;)

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863