[go: up one dir, main page]

0% found this document useful (0 votes)
2 views16 pages

Tablespace Log

The document details a series of commands executed by a user logged in as 'root' and then switching to the 'postgres' user to manage a PostgreSQL database. Multiple attempts to reload and restart the PostgreSQL server were made, but errors related to configuration and authentication methods prevented successful operation. Eventually, after editing the configuration file, the server started successfully, allowing for database connections and queries.

Uploaded by

Kirhn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views16 pages

Tablespace Log

The document details a series of commands executed by a user logged in as 'root' and then switching to the 'postgres' user to manage a PostgreSQL database. Multiple attempts to reload and restart the PostgreSQL server were made, but errors related to configuration and authentication methods prevented successful operation. Eventually, after editing the configuration file, the server started successfully, allowing for database connections and queries.

Uploaded by

Kirhn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 16

login as: root

root@192.168.181.147's password:
Last login: Sun Aug 17 06:57:48 2025
[root@localhost ~]# su - postgres
Last login: Sun Aug 17 01:24:12 PDT 2025 on pts/2
[postgres@localhost ~]$ ps -ef | grep postgres
root 8930 8887 0 06:59 pts/1 00:00:00 su - postgres
postgres 8932 8930 0 06:59 pts/1 00:00:00 -bash
postgres 8973 8932 0 06:59 pts/1 00:00:00 ps -ef
postgres 8974 8932 0 06:59 pts/1 00:00:00 grep --color=auto postgres
[postgres@localhost ~]$ /usr/pgsql-11/bin/pg_ctl -D /home/postgres/app03 reload
pg_ctl: could not send reload signal (PID: 10410): No such process
[postgres@localhost ~]$ /usr/pgsql-11/bin/pg_ctl -D /home/postgres/app03 restart
pg_ctl: old server process (PID: 10410) seems to be gone
starting server anyway
waiting for server to start....2025-08-17 06:59:31.077 PDT [8985] LOG: listening
on IPv4 address "0.0.0.0", port 9999
2025-08-17 06:59:31.077 PDT [8985] LOG: listening on IPv6 address "::", port 9999
2025-08-17 06:59:31.079 PDT [8985] LOG: listening on Unix socket
"/var/run/postgresql/.s.PGSQL.9999"
2025-08-17 06:59:31.082 PDT [8985] LOG: listening on Unix socket
"/tmp/.s.PGSQL.9999"
2025-08-17 06:59:31.129 PDT [8985] LOG: redirecting log output to logging
collector process
2025-08-17 06:59:31.129 PDT [8985] HINT: Future log output will appear in
directory "log".
stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@localhost ~]$ ps -ef | grep postgres
root 8930 8887 0 06:59 pts/1 00:00:00 su - postgres
postgres 8932 8930 0 06:59 pts/1 00:00:00 -bash
postgres 9074 8932 0 07:01 pts/1 00:00:00 ps -ef
postgres 9075 8932 0 07:01 pts/1 00:00:00 grep --color=auto postgres
[postgres@localhost ~]$ /usr/pgsql-11/bin/pg_ctl -D /home/postgres/app03 start
waiting for server to start....2025-08-17 07:01:11.380 PDT [9079] LOG: listening
on IPv4 address "0.0.0.0", port 9999
2025-08-17 07:01:11.380 PDT [9079] LOG: listening on IPv6 address "::", port 9999
2025-08-17 07:01:11.381 PDT [9079] LOG: listening on Unix socket
"/var/run/postgresql/.s.PGSQL.9999"
2025-08-17 07:01:11.383 PDT [9079] LOG: listening on Unix socket
"/tmp/.s.PGSQL.9999"
2025-08-17 07:01:11.400 PDT [9079] LOG: redirecting log output to logging
collector process
2025-08-17 07:01:11.400 PDT [9079] HINT: Future log output will appear in
directory "log".
stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@localhost ~]$ ps -ef | grep postgres
root 8930 8887 0 06:59 pts/1 00:00:00 su - postgres
postgres 8932 8930 0 06:59 pts/1 00:00:00 -bash
postgres 9120 8932 0 07:01 pts/1 00:00:00 ps -ef
postgres 9121 8932 0 07:01 pts/1 00:00:00 grep --color=auto postgres
[postgres@localhost ~]$ /usr/pgsql-11/bin/pg_ctl -D /home/postgres/app03 start
waiting for server to start....2025-08-17 07:01:52.559 PDT [9126] LOG: listening
on IPv4 address "0.0.0.0", port 9999
2025-08-17 07:01:52.559 PDT [9126] LOG: listening on IPv6 address "::", port 9999
2025-08-17 07:01:52.561 PDT [9126] LOG: listening on Unix socket
"/var/run/postgresql/.s.PGSQL.9999"
2025-08-17 07:01:52.563 PDT [9126] LOG: listening on Unix socket
"/tmp/.s.PGSQL.9999"
2025-08-17 07:01:52.579 PDT [9126] LOG: redirecting log output to logging
collector process
2025-08-17 07:01:52.579 PDT [9126] HINT: Future log output will appear in
directory "log".
stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@localhost ~]$ cd /home/postgres/app03
[postgres@localhost app03]$ cd log
[postgres@localhost log]$ ls -ltr
total 56
-rw-------. 1 postgres postgres 722 Jul 1 09:23 postgresql-Sat.log
-rw-------. 1 postgres postgres 6313 Aug 7 07:24 postgresql-Thu.log
-rw-------. 1 postgres postgres 952 Aug 11 18:50 postgresql-Mon.log
-rw-------. 1 postgres postgres 13327 Aug 14 05:20 postgresql-Tue.log
-rw-------. 1 postgres postgres 8590 Aug 17 01:46 postgresql-Wed.log
-rw-------. 1 postgres postgres 4110 Aug 17 02:17 postgresql-Fri.log
-rw-------. 1 postgres postgres 3863 Aug 17 07:01 postgresql-Sun.log
[postgres@localhost log]$ more postgresql-Sun.log
2025-07-01 09:24:00.330 PDT [16776] ERROR: unrecognized configuration parameter
"idle_session_timeout"
2025-07-01 09:24:00.330 PDT [16776] STATEMENT: show idle_session_timeout;
2025-07-01 09:24:16.882 PDT [16776] ERROR: syntax error at or near "show" at
character 27
2025-07-01 09:24:16.882 PDT [16776] STATEMENT: show idle_session_timeout
show archive_mode;
2025-07-01 09:24:41.206 PDT [16776] ERROR: unrecognized configuration parameter
"idle_session_timeout"
2025-07-01 09:24:41.206 PDT [16776] STATEMENT: show idle_session_timeout;
2025-07-20 20:50:51.627 PDT [8937] LOG: database system was interrupted; last
known up at 2025-07-17 06:16:59 PDT
2025-07-20 20:50:51.717 PDT [8937] LOG: database system was not properly shut
down; automatic recovery in progress
2025-07-20 20:50:51.718 PDT [8937] LOG: redo starts at 0/1C5D4CE0
2025-07-20 20:50:51.718 PDT [8937] LOG: invalid record length at 0/1C5D4DC0:
wanted 24, got 0
2025-07-20 20:50:51.718 PDT [8937] LOG: redo done at 0/1C5D4D88
2025-07-20 20:50:51.720 PDT [8937] LOG: checkpoint starting: end-of-recovery
immediate
2025-07-20 20:50:51.722 PDT [8937] LOG: checkpoint complete: wrote 0 buffers
(0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.000 s, sync=0.000 s,
total=0.0
02 s; sync files=0, longest=0.000 s, average=0.000 s; distance=0 kB, estimate=0 kB
2025-07-20 20:50:51.726 PDT [8935] LOG: database system is ready to accept
connections
2025-07-20 21:00:51.884 PDT [8938] LOG: checkpoint starting: time
2025-07-20 21:00:54.250 PDT [8938] LOG: checkpoint complete: wrote 23 buffers
(0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.343 s, sync=0.005 s,
total=2.
366 s; sync files=19, longest=0.002 s, average=0.000 s; distance=105 kB,
estimate=105 kB
2025-07-20 21:01:01.381 PDT [9248] ERROR: syntax error at or near "brien" at
character 39
2025-07-20 21:01:01.381 PDT [9248] STATEMENT: Insert into staff
values('cornell','o'brien',9090,'o'brien@gmail.com');
2025-07-20 21:01:01.698 PDT [9248] ERROR: syntax error at or near "neille" at
character 36
2025-07-20 21:01:01.698 PDT [9248] STATEMENT: Insert into staff
values('holm','t'neille',16840,'t'neille@gmail.com');
2025-07-20 21:01:01.698 PDT [9248] ERROR: syntax error at or near "nisha" at
character 38
2025-07-20 21:01:01.698 PDT [9248] STATEMENT: Insert into staff
values('holmar','t'nisha',16850,'t'nisha@gmail.com');
2025-07-20 21:02:29.063 PDT [9248] ERROR: syntax error at or near "vaccume" at
character 1
2025-07-20 21:02:29.063 PDT [9248] STATEMENT: vaccume staff;
2025-07-20 21:05:51.348 PDT [8938] LOG: checkpoint starting: time
2025-07-20 21:05:55.933 PDT [8938] LOG: checkpoint complete: wrote 45 buffers
(0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.568 s, sync=0.003 s,
total=4.
585 s; sync files=22, longest=0.002 s, average=0.000 s; distance=330 kB,
estimate=330 kB
2025-08-17 06:59:31.132 PDT [8985] LOG: invalid authentication method "map=ansar1"
2025-08-17 06:59:31.132 PDT [8985] CONTEXT: line 95 of configuration file
"/home/postgres/app03/pg_hba.conf"
2025-08-17 06:59:31.132 PDT [8985] FATAL: could not load pg_hba.conf
2025-08-17 06:59:31.134 PDT [8985] LOG: database system is shut down
2025-08-17 07:01:11.402 PDT [9079] LOG: invalid authentication method "map=ansar1"
2025-08-17 07:01:11.402 PDT [9079] CONTEXT: line 95 of configuration file
"/home/postgres/app03/pg_hba.conf"
2025-08-17 07:01:11.402 PDT [9079] FATAL: could not load pg_hba.conf
2025-08-17 07:01:11.402 PDT [9079] LOG: database system is shut down
2025-08-17 07:01:52.580 PDT [9126] LOG: invalid authentication method "map=ansar1"
2025-08-17 07:01:52.580 PDT [9126] CONTEXT: line 95 of configuration file
"/home/postgres/app03/pg_hba.conf"
2025-08-17 07:01:52.580 PDT [9126] FATAL: could not load pg_hba.conf
2025-08-17 07:01:52.581 PDT [9126] LOG: database system is shut down
[postgres@localhost log]$ vi "/home/postgres/app03/pg_hba.conf"
[postgres@localhost log]$ /usr/pgsql-11/bin/pg_ctl -D /home/postgres/app03 start
waiting for server to start....2025-08-17 07:02:52.574 PDT [9163] LOG: listening
on IPv4 address "0.0.0.0", port 9999
2025-08-17 07:02:52.574 PDT [9163] LOG: listening on IPv6 address "::", port 9999
2025-08-17 07:02:52.577 PDT [9163] LOG: listening on Unix socket
"/var/run/postgresql/.s.PGSQL.9999"
2025-08-17 07:02:52.592 PDT [9163] LOG: listening on Unix socket
"/tmp/.s.PGSQL.9999"
2025-08-17 07:02:52.718 PDT [9163] LOG: redirecting log output to logging
collector process
2025-08-17 07:02:52.718 PDT [9163] HINT: Future log output will appear in
directory "log".
. done
server started
[postgres@localhost log]$ psql -p 999
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.999"?
[postgres@localhost log]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# select pg_relation_filepath('test');


ERROR: relation "test" does not exist
LINE 1: select pg_relation_filepath('test');
^
postgres=# \c ansar9
You are now connected to database "ansar9" as user "postgres".
ansar9=# select pg_relation_filepath('test');
pg_relation_filepath
---------------------------------------------
pg_tblspc/66205/PG_11_201809051/66207/66208
(1 row)

ansar9=#
ansar9=# \q
[postgres@localhost log]$ more pg_tblspc/66205/PG_11_201809051/66207/66208
pg_tblspc/66205/PG_11_201809051/66207/66208: No such file or directory
[postgres@localhost log]$ cd ..
[postgres@localhost app03]$ cd pg_tblspc
[postgres@localhost pg_tblspc]$ ls -ltr
total 0
lrwxrwxrwx. 1 postgres postgres 20 Aug 14 05:52 66205 -> /home/postgres/app06
lrwxrwxrwx. 1 postgres postgres 20 Aug 17 02:11 66215 -> /home/postgres/app07
[postgres@localhost pg_tblspc]$ cd /home/postgres/app06
[postgres@localhost app06]$ ls -ltr
total 0
drwx------. 5 postgres postgres 45 Aug 17 02:07 PG_11_201809051
[postgres@localhost app06]$ cd PG_11_201809051
[postgres@localhost PG_11_201809051]$ ls -ltr
total 36
drwx------. 2 postgres postgres 8192 Aug 17 07:02 66214
drwx------. 2 postgres postgres 8192 Aug 17 07:02 66206
drwx------. 2 postgres postgres 8192 Aug 17 07:03 66207
[postgres@localhost PG_11_201809051]$ cd 66207
[postgres@localhost 66207]$ ls -ltr
total 7992
-rw-------. 1 postgres postgres 622592 Aug 17 01:46 1255
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 1255_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 1247_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 1249_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2604
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 1259_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2611
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2606
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2610
-rw-------. 1 postgres postgres 122880 Aug 17 01:46 2617
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2617_fsm
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2753
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2753_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2616
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2616_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2601
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2601_fsm
-rw-------. 1 postgres postgres 57344 Aug 17 01:46 2602
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2602_fsm
-rw-------. 1 postgres postgres 32768 Aug 17 01:46 2603
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2603_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2612_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2612
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2995
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2613
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2600
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2600_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3381
-rw-------. 1 postgres postgres 139264 Aug 17 01:46 2619
-rw-------. 1 postgres postgres 98304 Aug 17 01:46 2618
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3466
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2620
-rw-------. 1 postgres postgres 327680 Aug 17 01:46 2609
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2605
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2605_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3501
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2615
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2615_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2607
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3602
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3602_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3603_fsm
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3603
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3600
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3600_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3601
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3601_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3764
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3764_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3079
-rw-------. 1 postgres postgres 0 Aug 17 01:46 826
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3256
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3118
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2328
-rw-------. 1 postgres postgres 0 Aug 17 01:46 1418
-rw-------. 1 postgres postgres 0 Aug 17 01:46 1417
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3596
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3394
-rw-------. 1 postgres postgres 393216 Aug 17 01:46 3456
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3456_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3350
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3541_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3541
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6106
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6104
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6102
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3576
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2831
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2830
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2224
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2610_fsm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2832
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2834
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2833
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2836
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2835
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2837
-rw-------. 1 postgres postgres 417792 Aug 17 01:46 2838
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2839
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3598
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3599
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2840
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3439
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2841
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3440
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2336
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2337
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2650
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2651
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2652
-rw-------. 1 postgres postgres 40960 Aug 17 01:46 2653
-rw-------. 1 postgres postgres 40960 Aug 17 01:46 2654
-rw-------. 1 postgres postgres 32768 Aug 17 01:46 2756
-rw-------. 1 postgres postgres 32768 Aug 17 01:46 2655
-rw-------. 1 postgres postgres 32768 Aug 17 01:46 2757
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2656
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2657
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2660
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2661
-rw-------. 1 postgres postgres 90112 Aug 17 01:46 3164
-rw-------. 1 postgres postgres 57344 Aug 17 01:46 3085
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2665
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2664
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2666
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2667
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2668
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2579
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2669
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2670
-rw-------. 1 postgres postgres 188416 Aug 17 01:46 2675
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3502
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3503
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3534
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2678
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2679
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3395
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2680
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2187
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2681
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2682
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2683
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3380
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2996
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3997
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3379
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2684
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2685
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2686
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2687
-rw-------. 1 postgres postgres 40960 Aug 17 01:46 2688
-rw-------. 1 postgres postgres 49152 Aug 17 01:46 2689
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2754
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2755
-rw-------. 1 postgres postgres 81920 Aug 17 01:46 2690
-rw-------. 1 postgres postgres 270336 Aug 17 01:46 2691
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2692
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2693
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 5002
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 2696
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3574
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3575
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2699
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2701
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2702
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3467
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3468
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3608
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3712
-rw-------. 1 postgres postgres 32768 Aug 17 01:46 3609
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3604
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3606
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3605
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3607
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3766
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3767
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 112
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 548
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 113
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 549
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 174
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 175
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3119
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 827
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 828
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3597
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3080
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3542
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3257
-rw-------. 1 postgres postgres 16384 Aug 17 01:46 3081
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3258
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 6111
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 6110
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3351
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 6112
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 6113
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 6117
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6106_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6104_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 6102_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3541_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3350_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3256_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 826_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3596_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3118_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3079_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2328_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 1418_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 1417_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 1247_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3764_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3601_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3600_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3603_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3602_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3576_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3466_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2620_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2619_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2224_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2618_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 1255_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2753_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2617_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2616_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3381_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2995_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2615_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2613_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2612_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3394_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2611_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3501_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2610_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2609_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2607_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2606_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 3456_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2605_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2604_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2603_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2602_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2601_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3439_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2600_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2336_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 3598_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2840_vm
-rw-------. 1 postgres postgres 3 Aug 17 01:46 PG_VERSION
-rw-------. 1 postgres postgres 512 Aug 17 01:46 pg_filenode.map
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 2838_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2836_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2834_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2832_vm
-rw-------. 1 postgres postgres 0 Aug 17 01:46 2830_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2838_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2618_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2609_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2607_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3394_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13720
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13718
-rw-------. 1 postgres postgres 57344 Aug 17 01:46 13716
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13725
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13723
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13721
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13726
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13730
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13728
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13733
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13731
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13738
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13736
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13735
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13743
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13741
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13740
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13748
-rw-------. 1 postgres postgres 0 Aug 17 01:46 13746
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13745
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13750
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13716_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2619_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2840_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 3079_fsm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 2606_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13721_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13716_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13721_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13726_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13726_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13731_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13731_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13736_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13736_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 13741_vm
-rw-------. 1 postgres postgres 24576 Aug 17 01:46 13741_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:46 66199
-rw-------. 1 postgres postgres 73728 Aug 17 01:56 1247
-rw-------. 1 postgres postgres 8192 Aug 17 01:56 1249_vm
-rw-------. 1 postgres postgres 8192 Aug 17 01:56 1259_vm
-rw-------. 1 postgres postgres 458752 Aug 17 01:56 2608
-rw-------. 1 postgres postgres 24576 Aug 17 01:56 2608_fsm
-rw-------. 1 postgres postgres 8192 Aug 17 01:56 2608_vm
-rw-------. 1 postgres postgres 114688 Aug 17 01:56 2658
-rw-------. 1 postgres postgres 81920 Aug 17 01:56 2659
-rw-------. 1 postgres postgres 32768 Aug 17 01:56 2662
-rw-------. 1 postgres postgres 49152 Aug 17 01:56 2663
-rw-------. 1 postgres postgres 327680 Aug 17 01:56 2673
-rw-------. 1 postgres postgres 376832 Aug 17 01:56 2674
-rw-------. 1 postgres postgres 16384 Aug 17 01:56 2703
-rw-------. 1 postgres postgres 40960 Aug 17 01:56 2704
-rw-------. 1 postgres postgres 40960 Aug 17 01:56 3455
-rw-------. 1 postgres postgres 401408 Aug 17 02:01 1249
-rw-------. 1 postgres postgres 98304 Aug 17 02:01 1259
-rw-------. 1 postgres postgres 8192 Aug 17 02:07 66211
-rw-------. 1 postgres postgres 8192 Aug 17 02:07 66208
-rw-------. 1 postgres postgres 143516 Aug 17 07:03 pg_internal.init
[postgres@localhost 66207]$
login as: root
root@192.168.181.147's password:
Last login: Sun Aug 17 06:58:49 2025 from 192.168.181.1
[root@localhost ~]# su - postgres
Last login: Sun Aug 17 06:59:04 PDT 2025 on pts/1
[postgres@localhost ~]$ ps -ef | grep postgres
root 8930 8887 0 07:21 pts/1 00:00:00 su - postgres
postgres 8932 8930 0 07:21 pts/1 00:00:00 -bash
postgres 9163 1 0 07:25 pts/1 00:00:00 /usr/pgsql-11/bin/postgres -D
/home/postgres/app03
postgres 9164 9163 0 07:25 ? 00:00:00 postgres: logger
postgres 9166 9163 0 07:25 ? 00:00:00 postgres: checkpointer
postgres 9167 9163 0 07:25 ? 00:00:00 postgres: background writer
postgres 9168 9163 0 07:25 ? 00:00:00 postgres: walwriter
postgres 9169 9163 0 07:25 ? 00:00:00 postgres: autovacuum launcher
postgres 9170 9163 0 07:25 ? 00:00:00 postgres: stats collector
postgres 9171 9163 0 07:25 ? 00:00:00 postgres: logical replication
launcher
root 11240 11192 0 08:27 pts/2 00:00:00 su - postgres
postgres 11241 11240 0 08:27 pts/2 00:00:00 -bash
postgres 11295 11241 0 08:27 pts/2 00:00:00 ps -ef
postgres 11296 11241 0 08:27 pts/2 00:00:00 grep --color=auto postgres
[postgres@localhost ~]$ psql -p 9999
psql (11.7)
Type "help" for help.
postgres=# exit
[postgres@localhost ~]$ mkdir app10
[postgres@localhost ~]$ cd app10
[postgres@localhost app10]$ pwd
/home/postgres/app10
[postgres@localhost app10]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# create tablespace sunday loction '/home/postgres/app10';


ERROR: syntax error at or near "loction"
LINE 1: create tablespace sunday loction '/home/postgres/app10';
^
postgres=# create tablespace sunday location '/home/postgres/app10';
CREATE TABLESPACE
postgres=# exit
[postgres@localhost app10]$ cd /home/postgres/app10
[postgres@localhost app10]$ ls -ltr
total 0
drwx------. 2 postgres postgres 6 Aug 17 08:31 PG_11_201809051
[postgres@localhost app10]$ cd PG_11_201809051
[postgres@localhost PG_11_201809051]$ ls -ltr
total 0
[postgres@localhost PG_11_201809051]$ pwd
/home/postgres/app10/PG_11_201809051
[postgres@localhost PG_11_201809051]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# create table sunday(id int, name varchar2, movie varchar2);


ERROR: type "varchar2" does not exist
LINE 1: create table sunday(id int, name varchar2, movie varchar2);
^
postgres=# create table sunday(id int, name varchar(20), movie varchar(20));
CREATE TABLE
postgres=# drop table sunday
postgres-# ;
DROP TABLE
postgres=# create table sunday(id int, name varchar(20), movie varchar(20))
tablesapce sunday;
ERROR: syntax error at or near "tablesapce"
LINE 1: ...nday(id int, name varchar(20), movie varchar(20)) tablesapce...
^
postgres=# create table sunday(id int, name varchar(20), movie varchar(20))
tablespace sunday;
CREATE TABLE
postgres=# select pg_relation_filepath('sunday');
pg_relation_filepath
---------------------------------------------
pg_tblspc/74389/PG_11_201809051/13881/74393
(1 row)

postgres=# exit
[postgres@localhost PG_11_201809051]$ pwd
/home/postgres/app10/PG_11_201809051
[postgres@localhost PG_11_201809051]$ ls -ltr
total 0
drwx------. 2 postgres postgres 19 Aug 17 08:34 13881
[postgres@localhost PG_11_201809051]$ cd 13881
[postgres@localhost 13881]$ ls -ltr
total 0
-rw-------. 1 postgres postgres 0 Aug 17 08:34 74393
[postgres@localhost 13881]$ du -sh 74393
0 74393
[postgres@localhost 13881]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# insert into sunday values(1,ansar,ansar);


ERROR: column "ansar" does not exist
LINE 1: insert into sunday values(1,ansar,ansar);
^
postgres=# insert into sunday values(1,'ansar','ansar');
INSERT 0 1
postgres=# select * from sunday;
id | name | movie
----+-------+-------
1 | ansar | ansar
(1 row)

postgres=# exit
[postgres@localhost 13881]$ du -sh 74393
8.0K 74393
[postgres@localhost 13881]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# select pg_relation_filepath('sunday');


pg_relation_filepath
---------------------------------------------
pg_tblspc/74389/PG_11_201809051/13881/74393
(1 row)

postgres=# exit
[postgres@localhost 13881]$ ps -ef | grep postgres
root 8930 8887 0 07:21 pts/1 00:00:00 su - postgres
postgres 8932 8930 0 07:21 pts/1 00:00:00 -bash
postgres 9163 1 0 07:25 pts/1 00:00:00 /usr/pgsql-11/bin/postgres -D
/home/postgres/app03
postgres 9164 9163 0 07:25 ? 00:00:00 postgres: logger
postgres 9166 9163 0 07:25 ? 00:00:00 postgres: checkpointer
postgres 9167 9163 0 07:25 ? 00:00:00 postgres: background writer
postgres 9168 9163 0 07:25 ? 00:00:00 postgres: walwriter
postgres 9169 9163 0 07:25 ? 00:00:00 postgres: autovacuum launcher
postgres 9170 9163 0 07:25 ? 00:00:00 postgres: stats collector
postgres 9171 9163 0 07:25 ? 00:00:00 postgres: logical replication
launcher
root 11240 11192 0 08:27 pts/2 00:00:00 su - postgres
postgres 11241 11240 0 08:27 pts/2 00:00:00 -bash
postgres 11609 11241 0 08:38 pts/2 00:00:00 ps -ef
postgres 11610 11241 0 08:38 pts/2 00:00:00 grep --color=auto postgres
[postgres@localhost 13881]$ cd /home/postgres/app03
[postgres@localhost app03]$ ls -ltr
total 64
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_twophase
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_snapshots
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_serial
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_replslot
drwx------. 4 postgres postgres 36 Jun 17 10:07 pg_multixact
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_dynshmem
drwx------. 2 postgres postgres 6 Jun 17 10:07 pg_commit_ts
-rw-------. 1 postgres postgres 3 Jun 17 10:07 PG_VERSION
drwx------. 2 postgres postgres 18 Jun 17 10:07 pg_xact
drwx------. 2 postgres postgres 18 Jun 17 10:07 pg_subtrans
-rw-------. 1 postgres postgres 1018 Jun 17 10:10 logfile
drwx------. 3 postgres postgres 92 Jul 2 08:13 pg_wal_bkp
lrwxrwxrwx. 1 postgres postgres 30 Jul 2 09:14 pg_wal ->
/home/postgres/app04/wal_files
drwx------. 2 postgres postgres 188 Jul 14 06:10 log
-rw-------. 1 postgres postgres 24008 Aug 12 18:35 postgresql.conf
-rw-------. 1 postgres postgres 177 Aug 12 19:02 postgresql.auto.conf
drwx------. 2 postgres postgres 6 Aug 12 19:02 pg_stat
-rw-------. 1 postgres postgres 1685 Aug 12 19:10 pg_ident.conf
drwx------. 18 postgres postgres 214 Aug 14 05:35 base
-rw-------. 1 postgres postgres 4663 Aug 17 07:02 pg_hba.conf
drwx------. 2 postgres postgres 18 Aug 17 07:02 pg_notify
-rw-------. 1 postgres postgres 55 Aug 17 07:02 postmaster.opts
-rw-------. 1 postgres postgres 30 Aug 17 07:02 current_logfiles
-rw-------. 1 postgres postgres 93 Aug 17 07:02 postmaster.pid
drwx------. 2 postgres postgres 4096 Aug 17 07:03 global
drwx------. 2 postgres postgres 45 Aug 17 08:31 pg_tblspc
drwx------. 4 postgres postgres 68 Aug 17 08:35 pg_logical
drwx------. 2 postgres postgres 84 Aug 17 08:37 pg_stat_tmp
[postgres@localhost app03]$ cd pg_tblspc
[postgres@localhost pg_tblspc]$ ls -ltr
total 0
lrwxrwxrwx. 1 postgres postgres 20 Aug 14 05:52 66205 -> /home/postgres/app06
lrwxrwxrwx. 1 postgres postgres 20 Aug 17 02:11 66215 -> /home/postgres/app07
lrwxrwxrwx. 1 postgres postgres 20 Aug 17 08:31 74389 -> /home/postgres/app10
[postgres@localhost pg_tblspc]$
[postgres@localhost pg_tblspc]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# select * from pg_tablespace;


spcname | spcowner | spcacl | spcoptions
------------+----------+--------+------------
pg_default | 10 | |
pg_global | 10 | |
ansar | 10 | |
ansar1 | 10 | |
sunday | 10 | |
(5 rows)

postgres=# SELECT spcname AS tablespace_name,


postgres-# pg_tablespace_location(oid) AS location
postgres-# FROM pg_tablespace;
tablespace_name | location
-----------------+----------------------
pg_default |
pg_global |
ansar | /home/postgres/app06
ansar1 | /home/postgres/app07
sunday | /home/postgres/app10
(5 rows)
postgres=# select * from sunday;
id | name | movie
----+-------+-------
1 | ansar | ansar
(1 row)

postgres=#
postgres=#
postgres=# show temp_tablespaces;
temp_tablespaces
------------------

(1 row)

postgres=# exit
[postgres@localhost pg_tblspc]$ cd
[postgres@localhost ~]$ mkdir app11
[postgres@localhost ~]$ cd app11
[postgres@localhost app11]$ pwd
/home/postgres/app11
[postgres@localhost app11]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# set temp_tablespaces=ansar1;


SET
postgres=# show temp_tablespaces;
temp_tablespaces
------------------
ansar1
(1 row)

postgres=# create table best (no int) tablespace ansar1;


CREATE TABLE
postgres=# insert into best values(1);
INSERT 0 1
postgres=# insert into best values(3);
INSERT 0 1
postgres=# insert into best values(3333);
INSERT 0 1
postgres=# select * from best;
no
------
1
3
3333
(3 rows)

postgres=# select pg_relation_filepath('best');


pg_relation_filepath
---------------------------------------------
pg_tblspc/66215/PG_11_201809051/13881/74396
(1 row)

postgres=# exit
[postgres@localhost app11]$ psql -p 9999
psql (11.7)
Type "help" for help.
postgres=# select * from best;
no
------
1
3
3333
(3 rows)

postgres=# select pg_relation_filepath('best');


pg_relation_filepath
---------------------------------------------
pg_tblspc/66215/PG_11_201809051/13881/74396
(1 row)

postgres=# create temp table best1(id int) tablespace ansar1;


CREATE TABLE
postgres=# insert into best1 values(1);
INSERT 0 1
postgres=# insert into best1 values(12);
INSERT 0 1
postgres=# insert into best1 values(123);
INSERT 0 1
postgres=# select * from best1;
id
-----
1
12
123
(3 rows)

postgres=# select pg_relation_filepath('best1');


pg_relation_filepath
------------------------------------------------
pg_tblspc/66215/PG_11_201809051/13881/t3_74401
(1 row)

postgres=# exit
[postgres@localhost app11]$ psql -p 9999
psql (11.7)
Type "help" for help.

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------
+-----------------------
abcd | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
abcde | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
+
| | | | |
postgres=CTc/postgres+
| | | | | ansar1=c/postgres
ansar2 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar3 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar4 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar5 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar6 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar7 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ansar9 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
dvdrental | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
kkkkk | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
+
| | | | |
postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
+
| | | | |
postgres=CTc/postgres
test | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
xyz | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
(18 rows)

postgres=# \l+
List of
databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
| Size | Tablespace | Description
-----------+----------+----------+-------------+-------------
+-----------------------+---------+------------
+--------------------------------------------
abcd | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default | testing
abcde | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default | test
ansar | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default |
ansar1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
+| 7809 kB | pg_default |
| | | | |
postgres=CTc/postgres+| | |
| | | | | ansar1=c/postgres
| | |
ansar2 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default |
ansar3 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default |
ansar4 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7817 kB | pg_default |
ansar5 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7817 kB | pg_default |
ansar6 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7817 kB | pg_default |
ansar7 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7817 kB | ansar |
ansar9 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7981 kB | ansar |
dvdrental | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 15 MB | pg_default |
kkkkk | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7809 kB | pg_default |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 106 MB | pg_default | default administrative connection database
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
+| 7809 kB | pg_default | unmodifiable empty database
| | | | |
postgres=CTc/postgres | | |
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
+| 7817 kB | pg_default | default template for new databases
| | | | |
postgres=CTc/postgres | | |
test | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 15 MB | pg_default |
xyz | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
| 7817 kB | ansar |
(18 rows)

postgres=# \c ansar7
You are now connected to database "ansar7" as user "postgres".
ansar7=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------+-------+----------
public | ansar | table | postgres
(1 row)

ansar7=# select pg_relation_filepath('ansar');


pg_relation_filepath
---------------------------------------------
pg_tblspc/66205/PG_11_201809051/66206/66199
(1 row)

ansar7=# alter database ansar7 tablespace sunday;


ERROR: cannot change the tablespace of the currently open database
ansar7=# \c postgres
You are now connected to database "postgres" as user "postgres".
postgres=# alter database ansar7 tablespace sunday;
ALTER DATABASE
postgres=# \c ansar7
You are now connected to database "ansar7" as user "postgres".
ansar7=# select pg_relation_filepath('ansar');
pg_relation_filepath
---------------------------------------------
pg_tblspc/74389/PG_11_201809051/66206/66199
(1 row)

ansar7=#

You might also like