Import txt to postgresql

0

I've created the following txt file:

'Granada', current_timestamp
'Grecia', current_timestamp
'Guatemala', current_timestamp
'Guiana', current_timestamp
'Guine', current_timestamp
'Guine Esquatorial', current_timestamp
'Guine Bissau', current_timestamp
'Haiti', current_timestamp
'Honduras', current_timestamp
'Hungria', current_timestamp
'Lemen', current_timestamp
'Ilhas Marechal', current_timestamp
'India', current_timestamp
'Indonesia', current_timestamp
'Irao', current_timestamp
'Iraque', current_timestamp
'Irlanda', current_timestamp
'Islandia', current_timestamp
'Israel', current_timestamp
'Italia', current_timestamp
'Jamaica', current_timestamp
'Japao', current_timestamp
'Jibuti', current_timestamp
'Jordania', current_timestamp
'Laus', current_timestamp
'Lesoto', current_timestamp
'Letonia', current_timestamp
'Libano', current_timestamp
'Liberia', current_timestamp
'Libia', current_timestamp
'Listenstaine', current_timestamp
'Lituania', current_timestamp

To update the country table, I use the following command in pgAdmin4:

COPY pais (pais, ultima_atualizacao)
FROM 'C:\Users\magno\Documents\arquivo_paises.txt'
DELIMITER ',';

But this command results in the following error:

ERROR:  date/time value "current" is no longer supported
CONTEXT:  COPY pais, line 1, column ultima_atualizacao: " current_timestamp"
********** Error **********

ERROR: date/time value "current" is no longer supported
SQL state: 0A000
Context: COPY pais, line 1, column ultima_atualizacao: " current_timestamp"
    
asked by anonymous 28.07.2017 / 00:46

1 answer

0

Replace the word current_timestamp with now () with your text file:

'Granada', now()
'Grecia', now()
'Guatemala', now()
'Guiana', now()
'Guine', now()
'Guine Esquatorial', now()
'Guine Bissau', now()
'Haiti', now()
'Honduras', now()
'Hungria', now()
'Lemen', now()
'Ilhas Marechal', now()
'India', now()
'Indonesia', now()
'Irao', now()
'Iraque', now()
'Irlanda', now()
'Islandia', now()
'Israel', now()
'Italia', now()
'Jamaica', now()
'Japao', now()
'Jibuti', now()
'Jordania', now()
'Laus', now()
'Lesoto', now()
'Letonia', now()
'Libano', now()
'Liberia', now()
'Libia', now()
'Listenstaine', now()
'Lituania', now()
    
29.07.2017 / 19:41