Обсуждение: [BUGS] BUG #14772: psql autocommit does not work

Поиск
Список
Период
Сортировка

[BUGS] BUG #14772: psql autocommit does not work

От
abo@zetescards.be
Дата:
The following bug has been logged on the website:

Bug reference:      14772
Logged by:          Alain Bourgeois
Email address:      abo@zetescards.be
PostgreSQL version: 10beta2
Operating system:   Win x64
Description:

D:\PostgreSQL\10beta\bin>psql -U postgres -d testdb
Mot de passe pour l'utilisateur postgres :
psql (10beta2)
Attention : l'encodage console (850) diffère de l'encodage Windows (1252).           Les caractères 8 bits peuvent ne
pasfonctionner correctement.           Voir la section « Notes aux utilisateurs de Windows » de la 
page           référence de psql pour les détails.
Saisissez « help » pour l'aide.

testdb=# set autocommit=off;
ERREUR:  paramètre de configuration « autocommit » non reconnu
testdb=# set autocommit = off;
ERREUR:  paramètre de configuration « autocommit » non reconnu
testdb=# set autocommit to off;
ERREUR:  paramètre de configuration « autocommit » non reconnu
testdb=# set autocommit = off
testdb-# ;
ERREUR:  paramètre de configuration « autocommit » non reconnu
testdb=# SET AUTOCOMMIT=OFF;
ERREUR:  paramètre de configuration « autocommit » non reconnu
testdb=#


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: [BUGS] BUG #14772: psql autocommit does not work

От
Fabien COELHO
Дата:
> testdb=# set autocommit=off;
> ERREUR:  paramètre de configuration « autocommit » non reconnu

Sure, there is no "autocommit" server-side setting.

You meant the client-side setting: psql> \set AUTOCOMMIT off

-- 
Fabien.
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: [BUGS] BUG #14772: psql autocommit does not work

От
Fabien COELHO
Дата:
Hello Alain,

> testdb=# \set autocommit off;

Hmmm.

The special variable name is "AUTOCOMMIT", and you are creating an 
unrelated "autocommit" lower case variable instead. Client-side variable 
names are case sensitive. Maybe that was not a good idea, especially given 
than SQL is case insensitive, but it is probably too late to change 
that...

With the right name you would get a clear error message.
 psql> \set AUTOCOMMIT off; unrecognized value "off;" for "AUTOCOMMIT": boolean expected

I'm not sure what to do. Maybe generate a warning if a special variable 
name is used uncapitalized...

> OK I found : \set AUTOCOMMIT false
> (without any semicolumn)

Yep.

-- 
Fabien.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: [BUGS] BUG #14772: psql autocommit does not work

От
"alain bourgeois"
Дата:
also, the semicolumn, needed for some statementds (sql) but not all.

Alain Bourgeois
Software Engineer
Tel: +32 (0)2 333 49 20

Mobile: +32 (0)496 51 85 75
skype: abozetes
ZETES PASS, division of ZETES SA/NV
Disclaimer : This e-mail may contain material that is confidential and privileged for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may be unlawful. If you receive this message in error, please contact the sender and delete the material from any computer.





From:        Fabien COELHO <coelho@cri.ensmp.fr>
To:        alain bourgeois <a.bourgeois@zetescards.be>
Cc:        abo@zetescards.be, PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Date:        08-08-17 15:02
Subject:        Re: [BUGS] BUG #14772: psql autocommit does not work





Hello Alain,

> testdb=# \set autocommit off;

Hmmm.

The special variable name is "AUTOCOMMIT", and you are creating an
unrelated "autocommit" lower case variable instead. Client-side variable
names are case sensitive. Maybe that was not a good idea, especially given
than SQL is case insensitive, but it is probably too late to change
that...

With the right name you would get a clear error message.

 psql> \set AUTOCOMMIT off;
 unrecognized value "off;" for "AUTOCOMMIT": boolean expected

I'm not sure what to do. Maybe generate a warning if a special variable
name is used uncapitalized...

> OK I found : \set AUTOCOMMIT false
> (without any semicolumn)

Yep.

--
Fabien.



Re: [BUGS] BUG #14772: psql autocommit does not work

От
Fabien COELHO
Дата:
> also, the semicolumn, needed for some statementds (sql) but not all.

Yes, it is pretty strange.

The backslash command are outside of SQL and finished on the line. You can 
use them anywhere:
  psql> SELECT         \set x 2         1         \set y 3         ;  # 1  psql> \echo :x :y  # 2 3

Basically SQL & backslash commands are unrelated. The SQL is sent to the 
server, the backslash is executed on the client...

-- 
Fabien.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs