Re: SQL Path in psql

From: Rob Sargentg <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Path in psql
Date: 2013-09-06 17:17:49
Message-ID: 522A0E3D.6030609@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-09-06 17:45:26 Re: SQL Path in psql
Previous Message miles 2013-09-06 17:05:45 Re: SQL Path in psql