• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: COPY command do not export json format properly

Resolved: COPY command do not export json format properly

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am trying to export a column type jsonb using the copy command as follow:
The output gives me quoted text which is not a correct json format:
How can I get a correct json format ?

Answer:

You’ve chosen CSV output format, which escapes quotes that way. COPY does not produce JSON.
Do not use COPY to get the output, rather see store postgresql result in bash variable or How to return a value from psql to bash and use it?:

If you have better answer, please add a comment about this, thank you!

postgresql
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: navigate and redirect not redirecting to path in react router

24/03/2023

Resolved: Time Complexity: Find the number of people who know a secret leetcode 2327

24/03/2023

Resolved: Best way to create 3d matrix of variables in PULP

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.