Last active
May 4, 2016 13:38
-
-
Save vadv/39c2f663b7153f682b5a2f00abcf233f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# insert into test1 values (42); | |
INSERT 0 1 | |
postgres=# select * from test1 ; | |
i | |
---- | |
42 | |
(1 строка) | |
postgres=# \q | |
(reverse-i-search)`dd': ^C if=/dev/zero of=base/13090/24576 bs=8k count=1 | |
[root@bart /]# psql -U postgres | |
psql (9.4.7) | |
Введите "help", чтобы получить справку. | |
(reverse-i-search)`': ^C | |
postgres=# SELECT pg_relation_filepath(oid), relpages FROM pg_class WHERE relname = 'test1'; | |
pg_relation_filepath | relpages | |
----------------------+---------- | |
base/13090/16384 | 0 | |
(1 строка) | |
postgres=# checkpoint ; | |
CHECKPOINT | |
postgres=# SELECT pg_relation_filepath(oid), relpages FROM pg_class WHERE relname = 'test1'; | |
pg_relation_filepath | relpages | |
----------------------+---------- | |
base/13090/16384 | 0 | |
(1 строка) | |
postgres=# \q | |
[root@bart /]# ls /var/lib/pgsql/ | |
backups/ .bash_profile data_after_kill/ data.back/ .lesshst .viminfo | |
.bash_history data/ data_after_reset/ initdb_postgresql.log .psql_history | |
[root@bart /]# ls /var/lib/pgsql/data/base/13090/16384 | |
/var/lib/pgsql/data/base/13090/16384 | |
[root@bart /]# ls -lah /var/lib/pgsql/data/base/13090/16384 | |
-rw------- 1 postgres postgres 8,0K май 4 16:36 /var/lib/pgsql/data/base/13090/16384 | |
[root@bart /]# systemctl stop postgresql.service | |
[root@bart /]# dd if=/dev/zero of=/var/lib/pgsql/data/base/13090/16384 bs=8k count=1 | |
1+0 записей получено | |
1+0 записей отправлено | |
скопировано 8192 байта (8,2 kB), 0,000173754 c, 47,1 MB/c | |
[root@bart /]# systemctl start postgresql.service | |
[root@bart /]# psql -U postgres | |
psql (9.4.7) | |
Введите "help", чтобы получить справку. | |
postgres=# SELECT pg_relation_filepath(oid), relpages FROM pg_class WHERE relname = 'test1'; | |
pg_relation_filepath | relpages | |
----------------------+---------- | |
base/13090/16384 | 0 | |
(1 строка) | |
postgres=# select * from test1 ; | |
i | |
--- | |
(0 строк) | |
postgres=# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment