Re: [pgsql-es-ayuda] Limitar tamaño a tablespace

From: Emanuel Calvo <postgres(dot)arg(at)gmail(dot)com>
To: Alejandro Carrillo <fasterzip(at)yahoo(dot)es>
Cc: Ayuda Postgre SQL <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: [pgsql-es-ayuda] Limitar tamaño a tablespace
Date: 2013-05-28 09:28:31
Message-ID: CAGHEX6ZnDT910uF4Ai8tz=GLwodLSAGTPydU6rzkax9zyWKf9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Como comentó Jaime, te conviene usar quotas desde el sistema operativo.
Para esto tienes que crear puntos de montaje (puedes hacer un punto de
montaje y simular un device con un archivo en el fs, pero honestamente no
sería lo más limpio y recomendable).

Esto impide, que se llene el directorio del data de postgres. De esta
manera, si se llena un tablespace, solo recibirás error que no se pudo
escribir, pero los archivos de transacción y otros de sistema no se verán
afectados:

[root(at)ip-xxxx opt]# pg/bin/psql -p5434 -Upostgres -c 'insert into pp select
* from generate_series(1,500000)' ; du -h space
INSERT 0 500000
12K space/lost+found
67M space/PG_9.2_201204301/12870
67M space/PG_9.2_201204301
67M space
[root(at)ip-xxxx8 opt]# pg/bin/psql -p5434 -Upostgres -c 'insert into pp
select * from generate_series(1,500000)' ; du -h space
ERROR: could not extend file
"pg_tblspc/16384/PG_9.2_201204301/12870/16385": No space left on device
HINT: Check free disk space.
12K space/lost+found
67M space/PG_9.2_201204301/12870
67M space/PG_9.2_201204301
67M space

[root(at)ip-xxxx opt]# ps f -Cpostgres
PID TTY STAT TIME COMMAND
30789 ? S 0:00 /opt/pg/bin/postgres -D pg2
30790 ? Ss 0:00 \_ postgres: logger process
30792 ? Ss 0:00 \_ postgres: checkpointer process
30793 ? Ss 0:00 \_ postgres: writer process
30794 ? Ss 0:00 \_ postgres: wal writer process
30795 ? Ss 0:00 \_ postgres: autovacuum launcher process
30796 ? Ss 0:00 \_ postgres: stats collector process

El 27 de febrero de 2013 20:04, Alejandro Carrillo <fasterzip(at)yahoo(dot)es>escribió:

> Buen día,
>
> Como se puede limitar el espacio en postgresql de un tablespace?
>
> Muchas gracias
>

--
--
Emanuel Calvo

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Rusel Fichi 2013-06-03 00:47:32 Re: Se puede hacer llamado a una funcion desde otra funcion
Previous Message Jaime Casanova 2013-05-28 02:48:39 Re: BDs y su soporte ANSI