{"action":"created","issue":{"url":"https://api.github.com/repos/mla/pg_sample/issues/5","repository_url":"https://api.github.com/repos/mla/pg_sample","labels_url":"https://api.github.com/repos/mla/pg_sample/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/mla/pg_sample/issues/5/comments","events_url":"https://api.github.com/repos/mla/pg_sample/issues/5/events","html_url":"https://github.com/mla/pg_sample/issues/5","id":138062570,"number":5,"title":"DBD::Pg::db do failed: ERROR:","user":{"login":"lpossamai","id":17607576,"avatar_url":"https://avatars.githubusercontent.com/u/17607576?v=3","gravatar_id":"","url":"https://api.github.com/users/lpossamai","html_url":"https://github.com/lpossamai","followers_url":"https://api.github.com/users/lpossamai/followers","following_url":"https://api.github.com/users/lpossamai/following{/other_user}","gists_url":"https://api.github.com/users/lpossamai/gists{/gist_id}","starred_url":"https://api.github.com/users/lpossamai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpossamai/subscriptions","organizations_url":"https://api.github.com/users/lpossamai/orgs","repos_url":"https://api.github.com/users/lpossamai/repos","events_url":"https://api.github.com/users/lpossamai/events{/privacy}","received_events_url":"https://api.github.com/users/lpossamai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-03-03T03:17:40Z","updated_at":"2016-03-06T06:37:12Z","closed_at":null,"body":"I'm using PostgreSQL 9.2.15-1PGDG.rhel6 on a Centos 6.7 64 Bits.\r\n\r\nWhen executing the command:\r\n`./pg_sample dbname --data-only --file=test.sql --limit=\"ja_admins = 1000\"`\r\n\r\nI got the following error:\r\n```\r\nCreating table \"_pg_sample\".\"pg_catalog_pg_statistic\" DBD::Pg::db do failed: ERROR:  column \"stavalues1\" has pseudo-type \"anyarray\" at ./pg_sample line 296\r\n\tmain::__ANON__('DBD::Pg::db do failed: ERROR:  column \"stavalues1\" has pseudo...', 'DBI::db=HASH(0xfdec08)', undef) called at ./pg_sample line 538\r\nDropping sample schema _pg_sample\r\nDone.\r\n```\r\n\r\n\r\nUsing --trace option:\r\n```\r\n)= undef at pg_sample line 538\r\n    -> HandleError on DBI::db=HASH(0x289b660) via CODE(0x2858218) (undef)\r\nDBD::Pg::db do failed: ERROR:  column \"stavalues1\" has pseudo-type \"anyarray\" at ./pg_sample line 296\r\n\tmain::__ANON__('DBD::Pg::db do failed: ERROR:  column \"stavalues1\" has pseudo...', 'DBI::db=HASH(0x289b738)', undef) called at ./pg_sample line 538\r\n       ERROR: 7 'ERROR:  column \"stavalues1\" has pseudo-type \"anyarray\"' (err#0)\r\n    <- DESTROY(DBI::st=HASH(0x289bb70))= undef at Carp.pm line 45\r\nDropping sample schema _pg_sample\r\n    !! The ERROR '7' was CLEARED by call to do method\r\n    <- do('DROP SCHEMA _pg_sample CASCADE')= '0E0' at pg_sample line 713\r\nDone.\r\n!   <- DESTROY(DBI::db=HASH(0x289b738))= undef at pg_sample line 45 during global destruction\r\n```\r\nWhat can I do to solve this issue?"},"comment":{"url":"https://api.github.com/repos/mla/pg_sample/issues/comments/192814774","html_url":"https://github.com/mla/pg_sample/issues/5#issuecomment-192814774","issue_url":"https://api.github.com/repos/mla/pg_sample/issues/5","id":192814774,"user":{"login":"mla","id":44186,"avatar_url":"https://avatars.githubusercontent.com/u/44186?v=3","gravatar_id":"","url":"https://api.github.com/users/mla","html_url":"https://github.com/mla","followers_url":"https://api.github.com/users/mla/followers","following_url":"https://api.github.com/users/mla/following{/other_user}","gists_url":"https://api.github.com/users/mla/gists{/gist_id}","starred_url":"https://api.github.com/users/mla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mla/subscriptions","organizations_url":"https://api.github.com/users/mla/orgs","repos_url":"https://api.github.com/users/mla/repos","events_url":"https://api.github.com/users/mla/events{/privacy}","received_events_url":"https://api.github.com/users/mla/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T06:37:12Z","updated_at":"2016-03-06T06:37:12Z","body":"@lpossamai try this patch, please:\r\n\r\n```diff\r\n--- a/pg_sample\r\n+++ b/pg_sample\r\n@@ -192,6 +192,8 @@ use Getopt::Long qw/ GetOptions :config no_ignore_case /;\r\n use DBI;\r\n use DBD::Pg 2.0.0;\r\n \r\n+binmode STDOUT, ':utf8';\r\n+\r\n $SIG{TERM} = $SIG{INT} = $SIG{QUIT} = $SIG{HUP} = sub {\r\n   my $signal = shift;\r\n   die \"Received signal '$signal'; cleaning up and terminating.\\n\";\r\n```\r\n\r\nIt's not a real fix, but I'm wondering if we need to explicitly set STDOUT to use UTF8 encoding. Try running it again and see if you still get that \"value too long\" error."}}