pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rotten@windfish.net
To: pgsql-bugs@postgresql.org
Subject: BUG #14048: copy issues with jsonb
Date: Sun, 27 Mar 2016 15:04:42 +0000
Message-ID: <20160327150442.2901.36148@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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.

Next I tried BINARY mode.  That worked ok for the rows I was moving last
week, but this week (for a different piece of the table) I'm getting the
following when I try to read it back in:

# copy (select * from pixels.pixel_requests where server_timestamp >
'2016-03-26 00:00') to '/home/rotten/pixels27Mar2016.bin' binary;

# copy pixels.pixel_requests_tmp_2 from '/home/rotten/pixels27Mar2016.bin'
binary;

ERROR:  unsupported jsonb version number 63
CONTEXT:  COPY pixel_requests_tmp_2, line 1, column parameters

The new tmp table has the same ddl as the original table.  Both tables are
UTF-8 enabled.  Both are the same version of PostgreSQL running on the same
version of Ubuntu. 

I'm willing to share the copy output (313M - 288,000 rows) with someone who
is able to help troubleshoot the issue, but I don't want to post the data in
a public forum.

I'm not sure which row and column is causing the copy command to fail. 
(There is already a  to-do that may help with that.)

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...





-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <20160327150442.2901.36148@wrigleys.postgresql.org>
Permalink:  ../20160327150442.2901.36148@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160327150442.2901.36148@wrigleys.postgresql.org

 · 

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
  Subject: Re: BUG #14048: copy issues with jsonb
  In-Reply-To: <20160327150442.2901.36148@wrigleys.postgresql.org>
  References: <20160327150442.2901.36148@wrigleys.postgresql.org>

* 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