1CREATE TABLE test (i int, t text); 2INSERT INTO test VALUES (1, 'one'); 3INSERT INTO test VALUES (2, 'two'); 4INSERT INTO test VALUES (3, 'three'); 5VACUUM test; 6CHECKPOINT; 7SHOW data_directory \gset 8SELECT oid AS datoid FROM pg_database WHERE datname = current_database() \gset 9SELECT relfilenode FROM pg_class WHERE relname = 'test' \gset 10\! rm -f testfile testfile.sh 11\t 12SELECT format('ln -s %s/base/%s/%s testfile', :'data_directory', :'datoid', :'relfilenode') \g testfile.sh 13\! sh testfile.sh 14