Это должно работать:
int main(void){
int a[] = {1,2,3,4,5,6,7,8,9,0};
int k = 3;
int n = 7;
int i;
for(i=k; i<=n-k; i++){
int buff = a[i];
a[i] = a[n-i+k];
a[n-i+k] = buff;
}
}
Я выполняю пост-ГРЭС (9.5) в контейнере докера (на CentOS, как это происходит), и как Skippy le Grand Gourou упоминания в комментарии выше, файлы расположены в /var/lib/postgresql/data/
.
$ docker exec -it my-postgres-db-container bash
root@c7d61efe2a5d:/# cd /var/lib/postgresql/data/
root@c7d61efe2a5d:/var/lib/postgresql/data# ls -lh
total 56K
drwx------. 7 postgres postgres 71 Apr 5 2018 base
drwx------. 2 postgres postgres 4.0K Nov 2 02:42 global
drwx------. 2 postgres postgres 18 Dec 27 2017 pg_clog
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_commit_ts
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_dynshmem
-rw-------. 1 postgres postgres 4.4K Dec 27 2017 pg_hba.conf
-rw-------. 1 postgres postgres 1.6K Dec 27 2017 pg_ident.conf
drwx------. 4 postgres postgres 39 Dec 27 2017 pg_logical
drwx------. 4 postgres postgres 36 Dec 27 2017 pg_multixact
drwx------. 2 postgres postgres 18 Nov 2 02:42 pg_notify
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_replslot
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_serial
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_snapshots
drwx------. 2 postgres postgres 6 Sep 16 21:15 pg_stat
drwx------. 2 postgres postgres 63 Nov 8 02:41 pg_stat_tmp
drwx------. 2 postgres postgres 18 Oct 24 2018 pg_subtrans
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_tblspc
drwx------. 2 postgres postgres 6 Dec 27 2017 pg_twophase
-rw-------. 1 postgres postgres 4 Dec 27 2017 PG_VERSION
drwx------. 3 postgres postgres 92 Dec 20 2018 pg_xlog
-rw-------. 1 postgres postgres 88 Dec 27 2017 postgresql.auto.conf
-rw-------. 1 postgres postgres 21K Dec 27 2017 postgresql.conf
-rw-------. 1 postgres postgres 37 Nov 2 02:42 postmaster.opts
-rw-------. 1 postgres postgres 85 Nov 2 02:42 postmaster.pid
В моей установке Linux он находится здесь: /var/lib/postgresql/8.x/
Вы можете изменить его с помощью initdb -D "c: / mydb / "
Расположение определенных таблиц / индексов можно настроить с помощью TABLESPACEs:
CREATE TABLESPACE dbspace LOCATION '/data/dbs';
CREATE TABLE something (......) TABLESPACE dbspace;
CREATE TABLE otherthing (......) TABLESPACE dbspace;
В Windows каталог PGDATA, описанный в документации PostgresSQL , находится где-то вроде C: \ Program Files \ PostgreSQL \ 8.1 \ data
. Данные для конкретной базы данных находятся в (например) C: \ Program Files \ PostgreSQL \ 8.1 \ data \ base \ 100929
, где я предполагаю, что 100929 - это номер базы данных.