Обсуждение: csv vs json?

Поиск
Список
Период
Сортировка

csv vs json?

От
Rich Pixley
Дата:
I'm downloading a table in csv using pgAdmin.  Some tables work just 
fine.  Others have JSON fields in the table and these aren't.  What I 
get instead is a string with multiple unquoted double quotes that are, 
correctly I think, complained about by my csv reader.

Is there a way to get these quoted properly?  Am I doing something 
stupid?  Is this a bug?





Re: csv vs json?

От
Samed YILDIRIM
Дата:
Hi Rich,

It is hard to say what the problem is you encountered and offer any solution. Can you share the error message you got and example lines from your csv file?

I only can recommend you to check the document on the link below. CSV format of file might not match with default settings of PostgreSQL. You can adjust via parameters, such as delimiter, quote, and escape.


Best regards.
Samed YILDIRIM


On Wed, 4 Jan 2023 at 19:10, Rich Pixley <rich.pixley@hayden.ai> wrote:
I'm downloading a table in csv using pgAdmin.  Some tables work just
fine.  Others have JSON fields in the table and these aren't.  What I
get instead is a string with multiple unquoted double quotes that are,
correctly I think, complained about by my csv reader.

Is there a way to get these quoted properly?  Am I doing something
stupid?  Is this a bug?




Re: csv vs json?

От
Rich Pixley
Дата:

No error message.

And there was no quoting.  That's the bug.

On 1/9/23 3:55 PM, Samed YILDIRIM wrote:
Hi Rich,

It is hard to say what the problem is you encountered and offer any solution. Can you share the error message you got and example lines from your csv file?

I only can recommend you to check the document on the link below. CSV format of file might not match with default settings of PostgreSQL. You can adjust via parameters, such as delimiter, quote, and escape.


Best regards.
Samed YILDIRIM


On Wed, 4 Jan 2023 at 19:10, Rich Pixley <rich.pixley@hayden.ai> wrote:
I'm downloading a table in csv using pgAdmin.  Some tables work just
fine.  Others have JSON fields in the table and these aren't.  What I
get instead is a string with multiple unquoted double quotes that are,
correctly I think, complained about by my csv reader.

Is there a way to get these quoted properly?  Am I doing something
stupid?  Is this a bug?




Re: csv vs json?

От
"David G. Johnston"
Дата:
On Mon, Jan 9, 2023 at 3:33 PM Rich Pixley <rich.pixley@hayden.ai> wrote:

No error message.

And there was no quoting.  That's the bug.


You may wish to report this to the separate pgAdmin project, this list is for core PostgreSQL but your complaint doesn't seem to be with it.

But I'm suspecting this is more a problem with your expectations rather than the system producing invalid content.  But as you haven't provided a self-contained example, including output, it is impossible to say definitely where you are confused, or not, if indeed there is a bug.

You may wish to remove pgAdmin from the equation entirely and use the core PostgreSQL program psql.  It is usually easier to produce a self-contained script if you don't involve a GUI program into the process flow.

David J.