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1BBQ0UiIGJlaGF2aW9yIGlzIHZlcnkgZGlmZmVyZW50IHRoYW4gIiAuLi4g
U0VUCkxPR0dFRCIgd2hpY2ggZmFpbHMgZWFjaCB0aW1lLiANCg0KQ2FuIHNv
bWVvbmUgaGVscCB0cm91Ymxlc2hvb3RpbmcgdGhpcyBpc3N1ZT8gSSBhbSBu
b3Qgc3VyZSB3aGF0ICIgLi4uU0VUCkxPR0dFRCIgaXMgY2hlY2tpbmcuDQoN
CkFueSBoZWxwIG9yIHBvaW50ZXJzIHdvdWxkIGJlIGdyZWF0bHkgYXBwcmVj
aWF0ZWQuIA0KDQp+R2FuZXNoIEthbm5hbg0KDQoNCg0KCgo=

Re: BUG #14168: ALTER TABLE SET LOGGED failing

From
David Gould
Date:
On Wed, 01 Jun 2016 04:57:41 +0000
ganesh.kannan@weatheranalytics.com wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14168
>
> psql:mvTS2.sql:6: ERROR:  could not extend file
> "pg_tblspc/16404/PG_9.5_201510051/16407/61740.1": wrote only 4096 of 8192
> bytes at block 175411
> HINT:  Check free disk space.
> Time: 335539.031 ms
>
> However, there is enough free space available on the volumes to accommodate
> several of the tables, but ALTER TABLE set logged command consistently
> fails,  df -h shows this:
>
> >> df -h  | grep data5
> /dev/mapper/vg_pgdata5-lv_pgdata5  9.8T  9.5T  363G  97% /pg_land_data5

Sometimes the unix error ENOSPC covers more than disk space. For example
you could be out of inodes. What does df -i show?

-dg

--
David Gould              510 282 0869         daveg@sonic.net
If simplicity worked, the world would be overrun with insects.

Re: BUG #14168: ALTER TABLE SET LOGGED failing

From
Ganesh Kannan
Date:
This is a false alarm . The free space error that I get from " alter table =
.. set logged" was not because of lack of space in the volumed used by the =
tablespace, but from the volumes used by the indexes of that table. Given t=
he table was an "unlogged" table, indexes were also "unlogged", and it look=
s like " alter table ...set logged"  also implicitly converts the indexes f=
rom "unlogged" to regular indexes.=20

After clearing enough space " alter table ...set logged" worked fine.  It w=
ould help to mention the implicit index migration in the documentation.=20

Thanks David for the response. I did run the "df -i" command, and this is t=
he result.=20

/dev/mapper/vg_data5-lv_data5 1521588112  9897 1521578215    1% /pg_data5


Thanks
Ganesh Kannan
________________________________________
From: David Gould <daveg@sonic.net>
Sent: Wednesday, June 1, 2016 3:06 AM
To: Ganesh Kannan
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #14168: ALTER TABLE SET LOGGED failing

On Wed, 01 Jun 2016 04:57:41 +0000
ganesh.kannan@weatheranalytics.com wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14168
>
> psql:mvTS2.sql:6: ERROR:  could not extend file
> "pg_tblspc/16404/PG_9.5_201510051/16407/61740.1": wrote only 4096 of 8192
> bytes at block 175411
> HINT:  Check free disk space.
> Time: 335539.031 ms
>
> However, there is enough free space available on the volumes to accommoda=
te
> several of the tables, but ALTER TABLE set logged command consistently
> fails,  df -h shows this:
>
> >> df -h  | grep data5
> /dev/mapper/vg_pgdata5-lv_pgdata5  9.8T  9.5T  363G  97% /pg_data5

Sometimes the unix error ENOSPC covers more than disk space. For example
you could be out of inodes. What does df -i show?

-dg

--
David Gould              510 282 0869         daveg@sonic.net
If simplicity worked, the world would be overrun with insects.