Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aKtxl-0001Jq-45 for pgsql-sql@arkaria.postgresql.org; Sun, 17 Jan 2016 20:30:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aKtxk-00074R-IN for pgsql-sql@arkaria.postgresql.org; Sun, 17 Jan 2016 20:30:12 +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 1aKtxi-00073k-JQ for pgsql-sql@postgresql.org; Sun, 17 Jan 2016 20:30:11 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aKtxb-0006y2-3n for pgsql-sql@postgresql.org; Sun, 17 Jan 2016 20:30:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7A1F02034A for ; Sun, 17 Jan 2016 15:30:01 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sun, 17 Jan 2016 15:30:01 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ptEWzPJ9NseCP1gOX6apO5dKHT0=; b=Hu+wMX X6H2j0ovKXYh1yxnlI7UflKkQNREUmRGcZRJC1NMd4D7Vy5Wk+Z4aRsk7dS8ZO6Y RSmPXiuFM2Ux1AVKSf3Oh7LZeXKuutTpAUveZlbCJ/pWeGwFoAE4tFUsSKvydAf7 Hybeb8eNftxfVB88XGNnIjwOicAYbDr7HMih8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ptEWzPJ9NseCP1g OX6apO5dKHT0=; b=RGl3thptnjO3hKj0HQPdEkBc0BF2makHBp5gBsWo/XypGRS 5c5d52tjK+OXDyUi0CwuKRddfJByXEEvOSnvOveGg85I3wMZrPD5Lz7xfiYTGugp CBmg/HiuQem7p1uwYHcV4Y9lh5raUaPW/tO9BmLfBOY6x9julXh7RMfrJ6Pc= X-Sasl-enc: oyaOGowxShBVnAQ/71eUoWOTlwXwJlRkGMGBTUo8cknz 1453062601 Received: from [192.168.1.2] (65-102-182-223.tukw.qwest.net [65.102.182.223]) by mail.messagingengine.com (Postfix) with ESMTPA id CE363C016F0; Sun, 17 Jan 2016 15:30:00 -0500 (EST) Subject: Re: BYTEA To: Eugene Yin , Postgres List References: <194527298.6807703.1453059218766.JavaMail.yahoo.ref@mail.yahoo.com> <194527298.6807703.1453059218766.JavaMail.yahoo@mail.yahoo.com> From: Adrian Klaver Message-ID: <569BF994.1060909@aklaver.com> Date: Sun, 17 Jan 2016 12:29:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <194527298.6807703.1453059218766.JavaMail.yahoo@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.2 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 01/17/2016 11:33 AM, Eugene Yin wrote: > Pg 9.4+ > > Storing binary data using bytea > or text > data > types > > * Pluses > o Storing and Accessing entry utilizes the same interface when > accessing any other data type or record. > o No need to track OID of a "large object" you create > * Minus > o bytea and text data type both use TOAST > > (details here ) > + limited to 1G per entry > + 4 Billion (> 2KB) entries per table max > . > o *Need to escape/encode binary data before sending to DB then do > the reverse after retrieving the data * > o Memory requirements on the server can be steep even on a small > record set. > > https://wiki.postgresql.org/wiki/BinaryFilesInDB > > > > Do I really *Need to escape/encode binary data before sending to DB > then do the reverse after retrieving the data?* > * > * > If so, what (*Java*) codes should I use to achieve this goal (I am using > the Java to interface with the DB)? https://jdbc.postgresql.org/documentation/94/binary-data.html > > > > Thanks > > Eugene -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql