Je voudrais utiliser la commande psql “\ copy” pour extraire des données d’un fichier délimité par des tabulations dans Postgres. J’utilise cette commande:
\copy cm_state from 'state.data' with delimiter '\t' null as ;
Mais je reçois cet avertissement (le tableau se charge bien):
WARNING: nonstandard use of escape in a ssortingng literal LINE 1: COPY cm_state FROM STDIN DELIMITER '\t' NULL AS ';' HINT: Use the escape ssortingng syntax for escapes, eg, E'\r\n'.
Comment spécifier un onglet si ‘\ t’ n’est pas correct?
Utilisez E'\t'
pour indiquer à postgresql qu’il peut y avoir des caractères échappés:
\copy cm_state from 'state.data' with delimiter E'\t' null as ;
vous pouvez faire cette copy cm_state from stdin with (format 'text')