Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTNe8-0007bn-VB for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Aug 2022 13:20:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTNe7-0006Yj-PM for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Aug 2022 13:20:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTNe6-0006Ya-24 for pgsql-bugs@lists.postgresql.org; Wed, 31 Aug 2022 13:20:43 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oTNe2-0005KZ-RV for pgsql-bugs@postgresql.org; Wed, 31 Aug 2022 13:20:40 +0000 Received: by mail-wr1-x42a.google.com with SMTP id b5so18245148wrr.5 for ; Wed, 31 Aug 2022 06:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=FZEwislLpVx2Vzgc7RJfmsO9WBjSp1xIufYKonprknU=; b=Etbg39p7B+GALJTBLWJ44tsDDPsnmjZK7hzmt4rjSYXcbbtpP/rju+SHYCXkAxLCNA Yee3B3xGD1djsEFJgwY0Bs8F2zxRLGpRSpyTCZJEopKxllByGqaMzrKD5DeFvmGKEV/L +Kab/T0Sll7kBKkH6TcZeaVxnv1yreFVd6LfoiPQ7FlI0sSs1WCJyKWiT5ojraIg7Dsp pBrS9yZiy8KLllocIaXXivSjEJkkIbmMCk2uDZzMQSfNJ9gH3c4BMdvXHtL+F6aIhZts Via2T8JIPhYGp+WdVdr11VD3E7UdPNMgZgcvxm1HUMigNFnA8TzrSFOQy3EHSlVf1d0d tKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=FZEwislLpVx2Vzgc7RJfmsO9WBjSp1xIufYKonprknU=; b=er+1wDZQTdo9Bhx4/sjNw5uZZuh0H/5YGhykjdSf/5lTL5CM1zfW1COyKH3dbMtSNj UxZQbAgYkOuwZbKxFA+MuLd8pNHZKxbt8uAgGoxWqVbvEwcuBSfhm1RLl/GPHNXZf90n HkcASVBojYll/Mcg1m+x5FxIa1P43R18dlQi5PH1zUFS5HtO2jdG2SkxRZy2RuLb3ow2 dLSAEnDfADHLQcDi/ZOt8xpDmtR6xDuO0uuAV9Z2fiVZtOa0SYQWBtcq8LZ1xFoPs6TR OpvNhwb+xgdXje9OsFHHJvJolRo+VUo+b4r0CtGzTOTLkHNHPho2NB59529oOjOaERL7 EwAg== X-Gm-Message-State: ACgBeo0I0uxA65R7njGHP0BUtpBdckbw1Gk+8oPwu2AlociMIHLu5Geh +Bmur9b3PDddcMzWiKpiBkeYmA9Qv07bcz3oRCAyCoTZPBGFtZvZP6qWvXGrtjF9iGKYT5bOi3/ FRX3gyHmbY7TYOsPVHEGKneIdz3BGspETHFNReeEFWBoABCcnAexwV0zOhZ2njq2U2Na3EX19jt mgM0b+kdjR47avriJ4eyVIJRXymyFp X-Google-Smtp-Source: AA6agR5goJQW5k+bmf/yNPeWXh32swQqeAIABpn5K7Go7e8yTyG77gd68lFYSq8t66KpuVtTp6OlfA== X-Received: by 2002:a05:6000:1f99:b0:226:ded3:3a38 with SMTP id bw25-20020a0560001f9900b00226ded33a38mr6865935wrb.340.1661952036354; Wed, 31 Aug 2022 06:20:36 -0700 (PDT) Received: from [10.137.0.17] (static-84-42-175-93.bb.vodafone.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id l8-20020a5d4108000000b0021eed2414c9sm12081364wrp.40.2022.08.31.06.20.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 06:20:35 -0700 (PDT) Message-ID: Date: Wed, 31 Aug 2022 15:20:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: fetching bytea (blob) data of 850 MB from psql client failed Content-Language: en-US To: John Naylor , jitesh tiwari Cc: pgsql-bugs@postgresql.org References: From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/31/22 09:27, John Naylor wrote: > On Mon, Aug 29, 2022 at 1:02 PM jitesh tiwari wrote: >> >> Hi John, >> Thanks for those details. >> The database table for bytea columns has binary data data and some are not text. Hence, when it tried to fetch by changing the bytea_output to 'escape' it failed again with the below error - >> VERROR; result of bytea output conversion is too large(File varlena.c; Line 415; Routine byteaout; ). >> BTW, is there any plan to fix this issue in the PostgreSQL backend code in near future? > > Unfortunately, there is no plan as there is no consensus on how to > approach the issue. It seems the possible actions are (easiest to > hardest): > > 1. Document that bytea is unsafe -- you can insert anything you like, > but you may be unable to retrieve it again. > 2. Determine some maximum size that guarantees accessibility and > invent a GUC that by default prevents inserting larger values than > that. > 3. Fix the issue properly. > > #2 and #3 are challenging for reasons given in the thread I linked to above. > I haven't tried, but wouldn't it be enough to fetch the data in smaller chunks? The application would have to re-assemble that, of course. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company