Re: SQL Path in psql - Mailing list pgsql-general

From Rob Sargentg
Subject Re: SQL Path in psql
Date
Msg-id 522A0E3D.6030609@gmail.com
Whole thread Raw
In response to Re: SQL Path in psql  (miles <miles@byu.net>)
Responses Re: SQL Path in psql  (David Johnston <polobo@yahoo.com>)
List pgsql-general
On 09/06/2013 11:05 AM, miles wrote:
> Bobby Dewitt wrote
>> I come from an Oracle background and I am fairly new to Postgres.
>> Oracle's command line utility (SQL*Plus) uses an environment variable
>> called SQLPATH to search the given directories for SQL scripts that the
>> user calls to execute using a method similar to the \i meta-command in
>> psql.  This allows users to put SQL scripts in various directories and
>> execute them no matter which directory is there current working directory
>> in psql.
>>
>> Is there a similar environment variable that can be used with psql, or
>> another way to mimic this behavior?
> I'm in the same boat as Bobby. Any feature like this exist? If not, how
> would it be requested?
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/SQL-Path-in-psql-tp4413658p5769925.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
I wonder if this would at least get the full path on-screen for a c/p
     \! for d in  $SQLPATH; do find $d -name <script-filename>; done

That said, I would down-vote this suggestion.  I tend to put sql files
in amongst my various project dirs and maintaining the envvar isn't
worth it.

Anything I re-use I make into a function.


pgsql-general by date:

Previous
From: miles
Date:
Subject: Re: SQL Path in psql
Next
From: David Johnston
Date:
Subject: Re: SQL Path in psql