Re: archive_command fails but works outside of Postgres

From: twoflower <standa(dot)kurik(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: archive_command fails but works outside of Postgres
Date: 2017-08-19 08:05:23
Message-ID: 1503129923508-5979093.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera-9 wrote
> I saw one installation with "gsutil cp" in archive_command recently.
> Ithad the CLOUDSDK_PYTHON environment variable set in the
> archive_commanditself. Maybe that's a problem.

After all, this was the solution:
archive_command = 'CLOUDSDK_PYTHON=/usr/bin/python gsutil cp
/storage/postgresql/9.6/main/pg_xlog/%p gs://my_bucket/'
as also hinted in https://github.com/GoogleCloudPlatform/gsutil/issues/402
<https://github.com/GoogleCloudPlatform/gsutil/issues/402>

I still don't understand why the environments differ (the context of
archive_command vs. "su postgres -" and executing it there) but I am happy
it's working now.Thank you!

--
View this message in context: http://www.postgresql-archive.org/archive-command-fails-but-works-outside-of-Postgres-tp5979040p5979093.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2017-08-19 10:50:52 Re: archive_command fails but works outside of Postgres
Previous Message Peter J. Holzer 2017-08-19 08:04:04 Re: Count column with name 'count' returns multiple rows. Why?