Skip to content

Instantly share code, notes, and snippets.

@Dviejopomata
Created June 19, 2018 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dviejopomata/43c89d177af47132bae87fa349f057ae to your computer and use it in GitHub Desktop.
Save Dviejopomata/43c89d177af47132bae87fa349f057ae to your computer and use it in GitHub Desktop.
Copy from postgres with curl and JSON field
nombre { "hello":"world1" }
DAVID {}
JOSE {}
Create table prueba_csv (
id UUID default uuid_generate_v4(),
nombre varchar(30),
data jsonb
);
COPY prueba_csv(nombre, data) FROM PROGRAM 'curl "http://localhost:8080/prueba.csv"' with (format csv , quote '"', delimiter ',');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment