pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ryan Lambert <ryan@rustprooflabs.com>
Cc: Igal @ Lucee.org <igal@lucee.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: pg_dump and search_path
Date: Wed, 10 Jul 2019 17:00:46 -0700
Message-ID: <5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com> (raw)
In-Reply-To: <CAN-V+g9ydM5w9gkUCyobJVbY11T5WPVo6grpNGhKFZCX99Cs1w@mail.gmail.com>
References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org>
	<94e28e8c-e5cf-f0b5-a148-43452446d9ec@aklaver.com>
	<fbe59d2f-79ce-1b8e-c96a-ef665f18f747@lucee.org>
	<126613fd-e0a9-c79f-a400-028107214439@aklaver.com>
	<09136454-d905-7cce-d0cd-38158482e269@lucee.org>
	<9660facc-0bdd-d7fd-8316-02a45a509dd5@aklaver.com>
	<CAN-V+g9sopbD5uuRhYieHroqumHWJewRV4HKzByZOegxSh+ZuQ@mail.gmail.com>
	<4f8a9e35-0797-ddf8-ba1a-68b65eb7d2ec@aklaver.com>
	<CAN-V+g9ydM5w9gkUCyobJVbY11T5WPVo6grpNGhKFZCX99Cs1w@mail.gmail.com>

On 7/10/19 4:31 PM, Ryan Lambert wrote:
> My exact situation was a deployment via sqitch,  It appears that uses 
> psql under the hood based on the error message I get.

Yes it does:
https://sqitch.org/docs/manual/sqitch/
"Native scripting

Changes are implemented as scripts native to your selected database 
engine. Writing a PostgreSQL application? Write SQL scripts for psql. 
Writing an Oracle-backed app? Write SQL scripts for SQL*Plus."

> 
> Running just "sqitch deploy" I  get an error due to a non-fully 
> qualified name and a missing search path (my mistakes).  The error I get:
> 
>       + 004 .. psql:deploy/004.sql:72: ERROR:  relation "vobservations"
>     does not exist
>     LINE 11:                FROM vobservations
>                                   ^
>     not ok
>     "psql" unexpectedly returned exit value 3
> 
>     Reverting all changes
> 
> 
> Running the following works for me in this case and allows it to find 
> the view in the proper schema.
> 
> PGOPTIONS='-c search_path=piws,public' sqitch deploy

Would it not be easier to just set the search_path in postgresql.conf?

Or if you want it just for Sqitch, modify the pg templates to include 
the search_path?

Unfortunately in the OP's case the restore is going to overwrite the env 
setting.

> 
> Ryan


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (17+ messages)

Message-ID: <5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com>
Permalink:  ../5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com/
Also on:    postgresql.org/message-id/5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ryan@rustprooflabs.com, igal@lucee.org
  Subject: Re: pg_dump and search_path
  In-Reply-To: <5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com>
  References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org> <94e28e8c-e5cf-f0b5-a148-43452446d9ec@aklaver.com> <fbe59d2f-79ce-1b8e-c96a-ef665f18f747@lucee.org> <126613fd-e0a9-c79f-a400-028107214439@aklaver.com> <09136454-d905-7cce-d0cd-38158482e269@lucee.org> <9660facc-0bdd-d7fd-8316-02a45a509dd5@aklaver.com> <CAN-V+g9sopbD5uuRhYieHroqumHWJewRV4HKzByZOegxSh+ZuQ@mail.gmail.com> <4f8a9e35-0797-ddf8-ba1a-68b65eb7d2ec@aklaver.com> <CAN-V+g9ydM5w9gkUCyobJVbY11T5WPVo6grpNGhKFZCX99Cs1w@mail.gmail.com> <5b276130-4f7c-ee61-1848-8aa91e141a5c@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox