Search Postgresql Archives

Re: Petition: Treat #!... shebangs as comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, Jul 18, 2014 at 11:32 AM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
On 07/18/2014 08:16 AM, Andrew Pennebaker wrote:
Could we please have the PostgreSQL lexer treat #!... on the first line
of a file as a comment? This would enable .psql scripts to be run with
dot-slash notation preferred by many unix users:

./script.psql

While still allowing the traditional (and Windows compatible) style:

psql -f script.psql

Would not doing the below accomplish the same thing for you?

Snip ... 


Actually, it wouldn't. Andrew's request is to be able to take advantage of Unix's method of using all text after a #! on the first line of a file to actually mean to execute the program mentioned after the #! and then feed the file to mentioned program. So having a script file like

select * from foo;

modified to

#!/usr/local/pgsql/bin/psql
select * from foo;

would result in a file that could be executed directly on an Unix platform, yet still be capable of being using on a Window's platform using the 'psql -f file' style of execution.

Sounds like a good idea. A more generic approach is to have '#' itself be a comment delimiter. But I suspect doing such would be in conflict with the SQL standard.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux