public inbox for [email protected]  
help / color / mirror / Atom feed
From: Vincent Veyron <[email protected]>
To: Patrick FICHE <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Retrieve filename within a script
Date: Fri, 15 Nov 2024 17:29:30 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <DUZPR05MB110211E125949ECF03413C533EF5B2@DUZPR05MB11021.eurprd05.prod.outlook.com>
References: <DUZPR05MB110211E125949ECF03413C533EF5B2@DUZPR05MB11021.eurprd05.prod.outlook.com>

On Thu, 14 Nov 2024 08:42:36 +0000
Patrick FICHE <[email protected]> wrote:

> I was wondering if it was possible to get the filename provided as an argument to psql.
> psql -f /tmp/test.sql
> 

Since you know it already, you could pass it as a variable :

psql -f /tmp/test.sql -v my_path='/tmp/test.sql'

and retrieve it with SELECT :'my_path';

-- 
					Bien à vous, Vincent Veyron

https://marica.fr
Logiciel de gestion des contentieux juridiques, des contrats et des sinistres d'assurance






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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Retrieve filename within a script
  In-Reply-To: <[email protected]>

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

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