Skip site navigation (1) Skip section navigation (2)

Re: psql as an execve(2) interpreter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brook(at)biology(dot)nmsu(dot)edu
Cc: pgsql-hackers(at)postgresql(dot)org, brook(at)nmsu(dot)edu
Subject: Re: psql as an execve(2) interpreter
Date: 2005-07-27 04:31:47
Message-ID: 21620.1122438707@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
<brook(at)biology(dot)nmsu(dot)edu> writes:
> I would like to use pgsl as an interpreter (in the sense of
> execve(2)).  In short, if a file begins with the line

> 	     #! /path/to/psql -f

> it should be interpretable by psql.  The normal semantics of execve(2)
> ensure that this will work perfectly (indeed a file containing
> "#!/path/to/psql -l" works as expected), except for psql's nasty habit
> of not interpreting the first line as a comment.

Given that # is not a comment introducer in SQL, I would consider
it a bug if it did.

You should instead write a shell script that invokes psql.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Michael FuhrDate: 2005-07-27 04:32:49
Subject: Re: RESULT_OID Bug
Previous:From: Jeff DavisDate: 2005-07-27 04:11:25
Subject: Re: ENUM type

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group