mirror of
https://github.com/fruworg/fruworg.github.io.git
synced 2024-11-16 09:27:17 +03:00
Update psql-to-csv.md
This commit is contained in:
parent
45ecaf391b
commit
53c9288161
@ -14,7 +14,7 @@ DECLARE
|
|||||||
r RECORD;
|
r RECORD;
|
||||||
BEGIN
|
BEGIN
|
||||||
FOR r IN (SELECT table_name FROM information_schema.tables WHERE table_schema = 'public') LOOP
|
FOR r IN (SELECT table_name FROM information_schema.tables WHERE table_schema = 'public') LOOP
|
||||||
EXECUTE format('COPY %I TO %L WITH (FORMAT CSV, HEADER)', r.table_name, '/<path-to-csv>/' r.table_name '.csv');
|
EXECUTE format('COPY %I TO %L WITH (FORMAT CSV, HEADER)', r.table_name, '/<path-to-csv>/' || r.table_name || '.csv');
|
||||||
END LOOP;
|
END LOOP;
|
||||||
END $$;
|
END $$;
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user