pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rick Otten <rotten@windfish.net>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14048: copy issues with jsonb
Date: Mon, 28 Mar 2016 05:54:14 -0400
Message-ID: <344e1a258e7d77d25f4d81546f261e66@www.windfish.net> (raw)
In-Reply-To: <CAKFQuwbrtd5CFwELg=9MaNyvQRUPCyUFL8F_3QW1RsB1TGg8Fg@mail.gmail.com>
References: <20160327150442.2901.36148@wrigleys.postgresql.org>
	<CAKFQuwbrtd5CFwELg=9MaNyvQRUPCyUFL8F_3QW1RsB1TGg8Fg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

 

Ok. There are 288K rows in the file that was failing yesterday. I'll
play with date ranges until I can narrow it down to a few rows and send
it along. 

I wasn't able to get to trying pgdump yesterday, I'll give it a try
today and let you know. 

What I'm doing manually is exactly what I posted. 

On 2016-03-27 22:25, David G. Johnston wrote: 

> On Sun, Mar 27, 2016 at 8:04 AM, <rotten@windfish.net> wrote: 
> 
>> The following bug has been logged on the website:
>> 
>> Bug reference: 14048
>> Logged by: Rick Otten
>> Email address: rotten@windfish.net
>> PostgreSQL version: 9.5.1
>> Operating system: Ubuntu 14.04
>> Description:
>> 
>> I have a few jsonb columns in a table and I've run into several issues with
>> COPY with that column type. I didn't see anything specific about it in the
>> to-do list, and Google didn't turn up anyone else specifically complaining,
>> so I'm filing it here. I apologize if this is a known issue.
>> 
>> The table is the backend for a web pixel (tracking) service. It has 4 jsonb
>> columns which contain variable data about the browser and session. (parsed
>> user agent, list of cookies, query parameters, etc...)
>> 
>> I wanted to copy a section of the table from one 9.5.1 database to another.
>> 
>> For some reason the CSV and TEXT format exports do not quote/escape the
>> nested JSON very well - after several tries, I gave up on that approach.
>> The "copy to" output appears to be too mangled. It was not obvious, at
>> first glance, where it is getting confused.
> 
>> ​[...]
> 
>> Meanwhile, I'll use pg_dump to get the rows I need. Hopefully that will be
>> able to extract and reload the jsonb data ok. pg_dump hasn't been a problem
>> in the past anyway...
> 
> ​I'm reasonably certain pg_dump/pg_restore makes use of "COPY" to perform its work - at least for custom format and plain non-inserts mode​ - so if that works but whatever you are doing manually does not there is some degree of suspicion that what you are doing may be incorrect. 
> 
> We really need a sample record and a self-contained script that you can make reproduce this behavior. 
> 
> David J.

 

view thread (6+ messages)  latest in thread

Message-ID: <344e1a258e7d77d25f4d81546f261e66@www.windfish.net>
Permalink:  ../344e1a258e7d77d25f4d81546f261e66@www.windfish.net/
Also on:    postgresql.org/message-id/344e1a258e7d77d25f4d81546f261e66@www.windfish.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rotten@windfish.net, david.g.johnston@gmail.com
  Subject: Re: BUG #14048: copy issues with jsonb
  In-Reply-To: <344e1a258e7d77d25f4d81546f261e66@www.windfish.net>
  References: <20160327150442.2901.36148@wrigleys.postgresql.org> <CAKFQuwbrtd5CFwELg=9MaNyvQRUPCyUFL8F_3QW1RsB1TGg8Fg@mail.gmail.com> <344e1a258e7d77d25f4d81546f261e66@www.windfish.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox