DEFINITIONS
Definitions More Info.
Definition ID
898
Title
POSTGRESQL
Category
NOTES
Definition
Postgresql dynamic query in COPY stament with psql command
Definition Description
https://stackoverflow.com/questions/52986216/postgresql-dynamic-query-in-copy-stament-with-psql-command/52987247#52987247
psql -U postgres -c ^
"COPY ( ^
SELECT format('REINDEX TABLE %s.%s', schemaname, relname) ^
FROM pg_stat_all_tables ^
ORDER BY n_dead_tup DESC) ^
TO 'E:\scripts\maintenance\reindex.sql'"
ANCAK TIRNAK ISARETINI DE KOYMAK ISTERSEK ASAGIDAKINI UYGULA
psql -U postgres -c ^
"COPY ( ^
SELECT format('REINDEX TABLE ""%s"".""%s"";', schemaname, relname) ^
FROM pg_stat_all_tables ^
ORDER BY n_dead_tup DESC) ^
TO 'E:\scripts\maintenance\reindex.sql'"
RecordBy
cunay
Record Date
25-10-2018 14:18:45
Düzenle
Kopyala
Sil