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 1jJNs3-0002C9-Uf for pgsql-general@arkaria.postgresql.org; Tue, 31 Mar 2020 20:52:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJNs2-0006WW-TA for pgsql-general@arkaria.postgresql.org; Tue, 31 Mar 2020 20:52:26 +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 1jJNs2-0006WN-Hj for pgsql-general@lists.postgresql.org; Tue, 31 Mar 2020 20:52:26 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jJNrw-0005Ef-6y for pgsql-general@lists.postgresql.org; Tue, 31 Mar 2020 20:52:25 +0000 Received: by mail-ot1-x343.google.com with SMTP id m2so8862150otr.1 for ; Tue, 31 Mar 2020 13:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=vPYkXRnksbh4PCN4ztgg8ai0YZYGS7ajiR6ewPEpg/s=; b=u8W/G/KifWqdzsfjmWOfclN2qrUHaEXx6f/hV5lXOdzDNNyfLuzM9qP+Seajyjxhu6 80PqbXZHMUKQw6JiTgP1Dea3nAYodjRHTZ8djMEl+h+u3rK3XihxfvihbiBhtfhVIBzh SqQ45bEvEaONuTTaceYVtLAU0+FDxW9mo37kH5hOaXO/TzE6Uuae/gtjr6ygM7GY90I8 E+Mfd0m8kDwxJKl44Rk6cjgLbm0RtsAjUx7XfCWjAImcILS20n2ga4ZVyA3qemV7G2HU yf7eVAZJLWcHC7Hhdyz5zzGr4x+eT/CPJUZIPlUMstmcEyGHan9CtWXRtGYcjGrRh1tN iTDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=vPYkXRnksbh4PCN4ztgg8ai0YZYGS7ajiR6ewPEpg/s=; b=VCeXVeO1VTEjNxH4OMC56k4YB6bvZy2uqyjSHcd8mv+4sDtaGtNw/34Zoszc5tgcmZ oZiwKiZrVcppIlM8vLoOy30RasCeW+SWCd6zAZa3zyy+S4qdfru7xRTFWskxxo/wfLU8 GWSbf9fcYOeRWC+61zxzhnGtb62XS099BjtSf/+12+VdAwXZ1dKD9B01fYZ/uIdnNGHJ C+FLBsJHyjtNP/5ACSBpKbdVVZBe33tQbgY+6JZx5Ri0ZElEXEtrFp0V757DGbYgsgjV hhNeSF0N0FIafXLrud18TmQyjg6kJomkLtFGIAQd4S+ebKwCuIYQMK42M0I1mvNSOpH5 DcBA== X-Gm-Message-State: ANhLgQ1Hte6oPsjQvI6BqoOXNTZaugQ3Uj/PGEIOR3Y2MGvZz2Oy6Of1 26km5np3PTUF76cMQ1d/4QzUao5/ X-Google-Smtp-Source: ADFU+vvGlCyC4NavTrT6Otu6YDoTPduFWtvB5W8fRWk7WGwZBBhkTtLaG3zQDoQec33AKNIgl34lGw== X-Received: by 2002:a4a:2c55:: with SMTP id o82mr14920655ooo.33.1585687939303; Tue, 31 Mar 2020 13:52:19 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id x64sm5368066ooa.7.2020.03.31.13.52.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2020 13:52:18 -0700 (PDT) Subject: Re: keeping images in a bytea field on AWS RDS To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <8dc1619c-b29e-17ae-7ae7-1dd3928c7bb6@gmail.com> Date: Tue, 31 Mar 2020 15:52:18 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------772AEC12F7437ACCA90C1559" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------772AEC12F7437ACCA90C1559 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 3/31/20 2:49 PM, Richard Bernstein wrote: > 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? > > $ initdb -D /usr/local/pgsql/data > or > pg_ctl -D /usr/local/pgsql/data initdb initdb is definitely *not* what you want to do just to load an image into an exiting database. -- Angular momentum makes the world go 'round. --------------772AEC12F7437ACCA90C1559 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 3/31/20 2:49 PM, Richard Bernstein wrote:
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?

$ initdb -D /usr/local/pgsql/data 

or

pg_ctl -D /usr/local/pgsql/data initdb

initdb is definitely not what you want to do just to load an image into an exiting database.

--
Angular momentum makes the world go 'round.
--------------772AEC12F7437ACCA90C1559--