pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #13841: Unable to set autocommit in psql
6+ messages / 5 participants
[nested] [flat]
* BUG #13841: Unable to set autocommit in psql
@ 2016-01-01 15:10 floriparob@gmail.com
2016-01-01 16:19 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 6+ messages in thread
From: floriparob@gmail.com @ 2016-01-01 15:10 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 13841
Logged by: ROBERT
Email address: floriparob@gmail.com
PostgreSQL version: 9.5rc1
Operating system: Debian stretch/sid
Description:
O/S
Linux roblaptop 4.3.0-1-amd64 #1 SMP Debian 4.3.3-2 (2015-12-17) x86_64
GNU/Linux
psql session
psql (9.5rc1)
Type "help" for help.
timemanager=> set autocommit off;
ERROR: syntax error at or near "off"
LINE 1: set autocommit off;
^
timemanager=> set autocommit 'off';
ERROR: syntax error at or near "'off'"
LINE 1: set autocommit 'off';
^
timemanager=> set autocommit to off;
ERROR: unrecognized configuration parameter "autocommit"
timemanager=> SET AUTOCOMMIT TO OFF;
ERROR: unrecognized configuration parameter "autocommit"
timemanager=>
Thought that I'd made a typo but entered as per doco.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #13841: Unable to set autocommit in psql
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
@ 2016-01-01 16:19 ` Guillaume Lelarge <guillaume@lelarge.info>
2016-01-01 16:33 ` Re: BUG #13841: Unable to set autocommit in psql David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Guillaume Lelarge @ 2016-01-01 16:19 UTC (permalink / raw)
To: floriparob@gmail.com; +Cc: pgsql-bugs
Hi,
2016-01-01 16:10 GMT+01:00 <floriparob@gmail.com>:
> The following bug has been logged on the website:
>
> Bug reference: 13841
> Logged by: ROBERT
> Email address: floriparob@gmail.com
> PostgreSQL version: 9.5rc1
> Operating system: Debian stretch/sid
> Description:
>
> O/S
>
> Linux roblaptop 4.3.0-1-amd64 #1 SMP Debian 4.3.3-2 (2015-12-17) x86_64
> GNU/Linux
>
>
> psql session
>
> psql (9.5rc1)
> Type "help" for help.
>
> timemanager=> set autocommit off;
> ERROR: syntax error at or near "off"
> LINE 1: set autocommit off;
> ^
> timemanager=> set autocommit 'off';
> ERROR: syntax error at or near "'off'"
> LINE 1: set autocommit 'off';
> ^
> timemanager=> set autocommit to off;
> ERROR: unrecognized configuration parameter "autocommit"
> timemanager=> SET AUTOCOMMIT TO OFF;
> ERROR: unrecognized configuration parameter "autocommit"
> timemanager=>
>
> Thought that I'd made a typo but entered as per doco.
>
>
There's no autocommit GUC. You probably want to use the AUTOCOMMIT internal
variable of psql. In which case, you should do :
\set AUTOCOMMIT off
Definitely not a bug.
--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #13841: Unable to set autocommit in psql
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
2016-01-01 16:19 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
@ 2016-01-01 16:33 ` David G. Johnston <david.g.johnston@gmail.com>
2016-01-01 17:04 ` Re: BUG #13841: Unable to set autocommit in psql Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: David G. Johnston @ 2016-01-01 16:33 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: rob stone <floriparob@gmail.com>; pgsql-bugs
On Fri, Jan 1, 2016 at 9:19 AM, Guillaume Lelarge <guillaume@lelarge.info>
wrote:
> Hi,
>
> 2016-01-01 16:10 GMT+01:00 <floriparob@gmail.com>:
>
>> The following bug has been logged on the website:
>>
>> Bug reference: 13841
>> Logged by: ROBERT
>> Email address: floriparob@gmail.com
>> PostgreSQL version: 9.5rc1
>> Operating system: Debian stretch/sid
>> Description:
>>
>>>
>>>
>> timemanager=> set autocommit off;
>>
>>
> Thought that I'd made a typo but entered as per doco.
>>
>>
> There's no autocommit GUC. You probably want to use the AUTOCOMMIT
> internal variable of psql. In which case, you should do :
>
> \set AUTOCOMMIT off
>
> Definitely not a bug
>
Though when referencing the documentation in a report like this it is
generally helpful to provide a link to said documentation so it at least
can be checked. But indeed the behavior is client-side only and so it
makes no sense to try and control it via SQL - which is what the command
"SET" is from.
David J.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #13841: Unable to set autocommit in psql
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
2016-01-01 16:19 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
2016-01-01 16:33 ` Re: BUG #13841: Unable to set autocommit in psql David G. Johnston <david.g.johnston@gmail.com>
@ 2016-01-01 17:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-01-02 17:56 ` Re: BUG #13841: Unable to set autocommit in psql rob stone <floriparob@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2016-01-01 17:04 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Guillaume Lelarge <guillaume@lelarge.info>; rob stone <floriparob@gmail.com>; pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
>> 2016-01-01 16:10 GMT+01:00 <floriparob@gmail.com>:
>>> Thought that I'd made a typo but entered as per doco.
> Though when referencing the documentation in a report like this it is
> generally helpful to provide a link to said documentation so it at least
> can be checked.
Indeed. "set autocommit to off" hasn't been supported since PG 7.3, more
than ten years ago. So if there's still some documentation somewhere
recommending that, we really need to find and fix it.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #13841: Unable to set autocommit in psql
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
2016-01-01 16:19 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
2016-01-01 16:33 ` Re: BUG #13841: Unable to set autocommit in psql David G. Johnston <david.g.johnston@gmail.com>
2016-01-01 17:04 ` Re: BUG #13841: Unable to set autocommit in psql Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-01-02 17:56 ` rob stone <floriparob@gmail.com>
2016-01-02 18:01 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 6+ messages in thread
From: rob stone @ 2016-01-02 17:56 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; +Cc: Guillaume Lelarge <guillaume@lelarge.info>; pgsql-bugs
On Fri, 2016-01-01 at 12:04 -0500, Tom Lane wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > > 2016-01-01 16:10 GMT+01:00 <floriparob@gmail.com>:
> > > > Thought that I'd made a typo but entered as per doco.
>
> > Though when referencing the documentation in a report like this it
> > is
> > generally helpful to provide a link to said documentation so it at
> > least
> > can be checked.
>
> Indeed. "set autocommit to off" hasn't been supported since PG 7.3,
> more
> than ten years ago. So if there's still some documentation somewhere
> recommending that, we really need to find and fix it.
>
> regards, tom lane
Thanks for all the replies.
If you search for "autocommit" in the 9.5rc1 doco the first entry
displayed takes you to:-
http://www.postgresql.org/docs/9.5/static/ecpg-sql-set-autocommit.html
and as "set" is bog standard SQL syntax I thought you could use it
within a psql session.
However, as David pointed out you need to use \set.
Using \set works fine.
After perusing the psql doco there is mention there of using a .psqlrc
file to hold psql session variables but I have yet to find any doco
describing the syntax of this file.
Nor can I find a file named psqlrc, as both are mentioned in the psql
doco.
So, maybe initdb needs to create a dummy psqlrc file which users can
alter for global useage or copy over to their $HOME directory and alter
it for personal use.
My apologies for reporting this as a "bug" and wasting your time.
Regards,
Robert
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #13841: Unable to set autocommit in psql
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
2016-01-01 16:19 ` Re: BUG #13841: Unable to set autocommit in psql Guillaume Lelarge <guillaume@lelarge.info>
2016-01-01 16:33 ` Re: BUG #13841: Unable to set autocommit in psql David G. Johnston <david.g.johnston@gmail.com>
2016-01-01 17:04 ` Re: BUG #13841: Unable to set autocommit in psql Tom Lane <tgl@sss.pgh.pa.us>
2016-01-02 17:56 ` Re: BUG #13841: Unable to set autocommit in psql rob stone <floriparob@gmail.com>
@ 2016-01-02 18:01 ` Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 0 replies; 6+ messages in thread
From: Guillaume Lelarge @ 2016-01-02 18:01 UTC (permalink / raw)
To: rob stone <floriparob@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; pgsql-bugs
2016-01-02 18:56 GMT+01:00 rob stone <floriparob@gmail.com>:
> On Fri, 2016-01-01 at 12:04 -0500, Tom Lane wrote:
> > "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > > > 2016-01-01 16:10 GMT+01:00 <floriparob@gmail.com>:
> > > > > Thought that I'd made a typo but entered as per doco.
> >
> > > Though when referencing the documentation in a report like this it
> > > is
> > > generally helpful to provide a link to said documentation so it at
> > > least
> > > can be checked.
> >
> > Indeed. "set autocommit to off" hasn't been supported since PG 7.3,
> > more
> > than ten years ago. So if there's still some documentation somewhere
> > recommending that, we really need to find and fix it.
> >
> > regards, tom lane
>
>
> Thanks for all the replies.
>
> If you search for "autocommit" in the 9.5rc1 doco the first entry
> displayed takes you to:-
>
> http://www.postgresql.org/docs/9.5/static/ecpg-sql-set-autocommit.html
>
> and as "set" is bog standard SQL syntax I thought you could use it
> within a psql session.
>
>
Well, the page clearly says that "SET AUTOCOMMIT is an extension of
PostgreSQL ECPG.".
> However, as David pointed out you need to use \set.
> Using \set works fine.
>
>
Good to hear.
> After perusing the psql doco there is mention there of using a .psqlrc
> file to hold psql session variables but I have yet to find any doco
> describing the syntax of this file.
> Nor can I find a file named psqlrc, as both are mentioned in the psql
> doco.
>
>
The .psqlrc file can contain any meta commands (\something) or SQL commands.
> So, maybe initdb needs to create a dummy psqlrc file which users can
> alter for global useage or copy over to their $HOME directory and alter
> it for personal use.
>
>
I don't think so. And there's already one in the "share" directory (search
for a psqlrc.sample file).
--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2016-01-02 18:01 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01 15:10 BUG #13841: Unable to set autocommit in psql floriparob@gmail.com
2016-01-01 16:19 ` Guillaume Lelarge <guillaume@lelarge.info>
2016-01-01 16:33 ` David G. Johnston <david.g.johnston@gmail.com>
2016-01-01 17:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-01-02 17:56 ` rob stone <floriparob@gmail.com>
2016-01-02 18:01 ` Guillaume Lelarge <guillaume@lelarge.info>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox