ajout d'infos pour utilisation de la commande COPY
This commit is contained in:
parent
b08c0cf0fe
commit
c2e8e011ac
|
@ -1398,4 +1398,22 @@ Activé topology :
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
foo=# CREATE EXTENSION IF NOT EXISTS postgis_topology;
|
foo=# CREATE EXTENSION IF NOT EXISTS postgis_topology;
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
### Commande COPY
|
||||||
|
|
||||||
|
<https://docs.postgresql.fr/current/sql-copy.html>
|
||||||
|
|
||||||
|
Voici comment extraire des lignes d'une table et les réinjecter avec la commande COPY.
|
||||||
|
|
||||||
|
On se connecte avec l'utilisateur `postgres` :
|
||||||
|
|
||||||
|
~~~
|
||||||
|
# sudo -u postgres psql
|
||||||
|
|
||||||
|
=# COPY (SELECT * FROM TABLE1 WHERE id > 42) TO '/var/lib/postgresql/TABLE1-42.copy';
|
||||||
|
|
||||||
|
=# COPY TABLE2 FROM '/var/lib/postgresql/TABLE1-42.copy';
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue