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 1jJMvY-0004Pc-Uz for pgsql-general@arkaria.postgresql.org; Tue, 31 Mar 2020 19:52:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJMvX-0000wa-Tg for pgsql-general@arkaria.postgresql.org; Tue, 31 Mar 2020 19:51:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJMvX-0000vs-Ja for pgsql-general@lists.postgresql.org; Tue, 31 Mar 2020 19:51:59 +0000 Received: from smtp77.ord1c.emailsrvr.com ([108.166.43.77]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJMvR-0006K7-3P for pgsql-general@lists.postgresql.org; Tue, 31 Mar 2020 19:51:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1585684310; bh=goMt44Vs/jAoSz1iorYgEL8zWE7Rjfwm0RZUlOc8fo0=; h=Subject:From:Date:To:From; b=Bv4SmLEWnlEliS4Lq1DUXQibOsViXsXnuChfrB4/DJTwn0rUtXKqXlkhp8e2XDSE7 gYyYRRiYI6ZawmhGs/cwhSEO40JhUyBSliiC/ZRSN7bBP09of0iJi3KhJha+aSEKF8 qQzCxA7KTKYEuuQpzRbSCPFV5GwGtQZeUa1H54w4= X-Auth-ID: xof@thebuild.com Received: by smtp18.relay.ord1c.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 85FA2E014A; Tue, 31 Mar 2020 15:51:50 -0400 (EDT) X-Sender-Id: xof@thebuild.com Received: from [10.1.26.128] (157-131-136-66.dedicated.static.sonic.net [157.131.136.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:587 (trex/5.7.12); Tue, 31 Mar 2020 15:51:50 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: keeping images in a bytea field on AWS RDS From: Christophe Pettus In-Reply-To: Date: Tue, 31 Mar 2020 12:51:48 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <4F206EC1-7336-4621-ACF8-5498754941F0@thebuild.com> References: To: Richard Bernstein X-Mailer: Apple Mail (2.3445.9.1) X-Classification-ID: a59d7ae0-6abc-446b-8858-65aa21e3b979-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Mar 31, 2020, at 12:49, Richard Bernstein = wrote: >=20 > I am using postgresql on RDS. I need to upload an image to the table. = I understand that I need to set the PGDATA directory and place the image = file in it, before setting the path in the bytea field. But how do I set = PGDATA if I don't have the ability to set an environment variable, and = don't have access to the following on an AWS controlled installation? No, that's not how you upload images to a bytea field; you use the = standard client library and send the bytea data over that way. It works = the same on community PostgreSQL and RDS. PostgreSQL handles managing = the bytea data for you. Note that for very large binary objects, = storing them in the database is not going to be very efficient versus = keeping them in the filesystem (noting, of course, that you don't have = access to the filesystem of an RDS server). -- -- Christophe Pettus xof@thebuild.com