Feature request (was psql: absolutes and toggles)

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Feature request (was psql: absolutes and toggles)
Date: 2006-09-14 21:33:54
Message-ID: 4509CAC2.1070608@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I would like the ability to absolutely set parameters/settings in psql
so that our psql scripts could generate predictable output absent a
known or controllable initial state. Original discussion at bottom of
message.

One alternate and easier approach I've thought of is to simply add
something akin to a \factory-reset meta-command which would return all
settings to the state they would be in immediately after starting psql
with the --no-psqlrc option. This would at least provide one solution to
the problem and might be a handy meta-command even if absolute settings
were added.

If a "factory reset" meta-command were added I think that \o should be
exempted as it is already an absolute setting that can be predictably
used in scripts and, where output redirection isn't specified in the
script, we shouldn't interfere with the ability to save the output of a
script or scripts as the user desires.

Cheers,
Steve

Peter Eisentraut wrote:
> Steve Crawford wrote:
>> We create psql scripts that can be used at various times by various
>> users. I have been unable to find how to absolutely set various
>>options (timing, expanded, etc.) rather than toggle them.

>> The --no-psqlrc option provides a partial workaround - as long as
>> the user remembers to include it and as long as they are only
>> running the one script. But if they forget or if they are already
>> running a session there is no telling what settings have been
>> toggled by previously run scripts or the users themselves.

>> So...have I overlooked an interactive psql option that will let me
>> reset all options to "factory-defaults" or a method of specifying an
>> absolute setting to the various options?
>
> Probably not.
>
>> If not, do psql users out there feel this is worth a feature request?
>
> I think so.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jack Orenstein 2006-09-14 21:45:07 Re: Initializing Datums for use with SPI_execute_plan
Previous Message Brandon Aiken 2006-09-14 21:24:45 Re: PostgreSQL slammed by PHP creator

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2006-09-14 21:36:22 Re: Mid cycle release?
Previous Message Joshua D. Drake 2006-09-14 21:32:56 Re: Mid cycle release?