Re: [HACKERS] PSQL man page patch

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] PSQL man page patch
Дата
Msg-id 34BA3672.67D7FC13@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] PSQL man page patch  (Andrew Martin <martin@biochemistry.ucl.ac.uk>)
Список pgsql-hackers
> ... patch to man page for psql.1 which documents suggested addition
> of support for a /etc/psqlrc and/or $(HOME)/.psqlrc containing SQL code
> to be run whenever psql is started]
>
> Personally, I think this should just be a function of psql not libpq - it's
> really there as a convenience to the person running psql to save typing a
> few lines of SQL every time (like setting the date format). If you are
> running PG/SQL via some other interface (such as Perl), then it is
> trivial to write those few lines as part of your Perl script rather than
> in a .psqlrc file.

I have added support for PGTZ to libpq and fixed the existing PGDATESTYLE
support, so at least a few common environment settings will not need .psqlrc.
The bigger problem is that .psqlrc could contain commands which might screw up
an embedded application. For example. a query to show the current time in
.psqlrc would result in an unexpected response from the backend as an app fires
up. It does seem like a nice feature for at least psql though, as Andrew
suggests. I'd suggest that if we add it to libpq that we do so as a separate
call or an option, so an embedded app can choose to use it or not.

                                                      - Tom

> I still have the patch file for the source as well as for the man page




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: varchar() troubles
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: varchar() troubles