Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ab8jI-0005jj-4x for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2016 15:30:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ab8jH-0002UD-K4 for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2016 15:30:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ab8jH-0002U6-0a for pgsql-hackers@postgresql.org; Wed, 02 Mar 2016 15:30:23 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ab8j9-0001n8-Rk for pgsql-hackers@postgresql.org; Wed, 02 Mar 2016 15:30:21 +0000 Received: by mail-wm0-x233.google.com with SMTP id p65so85226354wmp.1 for ; Wed, 02 Mar 2016 07:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=cBb1wHPTi5n6kE0BqbXYrdPZmxMNW1cGcQJpGtNrD+U=; b=wc4FOakaFm4ZQToivUt2FE7pCsAMajdhsmOIYa83fs6yiIj7sofgraDrcE0y/Iyapj a2OL41GCDtT/6J/LRWbFgY4EtRenN2pGeIdIiAWhML5SaqxszUuhYZgdRRvNS5WJyx+j aA2rA/inbOS8jHoV2vwNj6rMYPVVHhPoW+F//84aV5+z/F9mS/Gyg20qCSzZMv5xA3J+ G3PabRg67Z4b2rhig28mW/b/p0NNnIwh9sFtiF2v6PKQ8rlbcfeX3JZhDjxGz4wtJI77 snEV66xtbj0GwZ5C2FCwidxsZYWFN042Xz+dFcCeIDayI4y8LB3spebbWZfGP7FlYmRc Gdvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cBb1wHPTi5n6kE0BqbXYrdPZmxMNW1cGcQJpGtNrD+U=; b=VLH+wqT+wyTT4+E6FHNc2QR8Pjzi+sL+8hEeTTc6jmH0ULFlh/p3lAAL0ZaIIBGwkl vPajuqnfxeptGpi1Ve+W9+TO+I6XHVDcQ/R5PatCG6PEErQ7JcBCGHIKGICvbcsH3liq vsHUjo4yp/j2ECs9BhCsfA9ZzncDa95w0w7brI0l6JOTR6q3Zhg0XFHlxVBXLF6BQL8S zQ6vE7+HpOPWVJxTVuT83+mP0TKRa8Qx9GQLAcM5Xmvpm9gIg729KYRAiSklKUs03q8h duNObQ6ydvkzUiEO5C9eRMQ/W6wvXXz1xzjmzTgoPXy+yO0CLDeQBQ94d7OAcFDiivMy nwrQ== X-Gm-Message-State: AD7BkJJ8mPVng7BUKxEercj0ba2gei2HwOVwHB2DDYSsdyR3F+WBCH/rX/LhhGA4ZOozuE5ISF6KnzD1nkVExZKaHrucaH9aKY4PSGRhVTmwZezaOpn9qrFvuK088sJ86Psl/0myE36WIgsIeaHlHcN+pDQk4DXi3hCAl0c8FebOcjfXS7/qv5YRE8bnBg5MuEwBwSp1fltr X-Received: by 10.28.139.147 with SMTP id n141mr505213wmd.53.1456932613579; Wed, 02 Mar 2016 07:30:13 -0800 (PST) Received: from [10.137.1.13] (ip-78-45-216-26.net.upcbroadband.cz. [78.45.216.26]) by smtp.gmail.com with ESMTPSA id b203sm4676865wmh.8.2016.03.02.07.30.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Mar 2016 07:30:12 -0800 (PST) Subject: Re: pg_dump / copy bugs with "big lines" ? To: Tom Lane References: <10cb3300-67ab-4d3b-a930-7106d4dbac04@mm> <56D70458.2010006@2ndquadrant.com> <21331.1456932193@sss.pgh.pa.us> Cc: pgsql-hackers@postgresql.org From: Tomas Vondra Message-ID: <56D70703.9000007@2ndquadrant.com> Date: Wed, 2 Mar 2016 16:30:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <21331.1456932193@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 03/02/2016 04:23 PM, Tom Lane wrote: > Tomas Vondra writes: >> On 03/02/2016 03:18 PM, Daniel Verite wrote: >>> However, getting it to the client with \copy big2 to 'file' >>> still produces the error in psql: >>> lost synchronization with server: got message type "d" >>> and leaves an empty file, so there are more problems to solve to >>> go beyond 2GB text per row. > >> My guess is this is a problem at the protocol level - the 'd' message is >> CopyData, and all the messages use int32 to define length. So if there's >> a 2GB row, it's likely to overflow. > > I'm too lazy to check the exact wording, but I don't think there's a hard > and fast promise in the protocol doc that one CopyData message == one row. > So we could probably subdivide a very wide line into multiple messages. Well, actually we claim this [1]: Data that forms part of a COPY data stream. Messages sent from the backend will always correspond to single data rows, but messages sent by frontends might divide the data stream arbitrarily. So that suggests 1:1 messages to rows, although I'm not sure how difficult would it be to relax this (or how much the clients might rely on this). [1] http://www.postgresql.org/docs/9.5/static/protocol-message-formats.html regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers