사용자 도구

사이트 도구


dbms:pgsql:clientenv

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
dbms:pgsql:clientenv [2008/02/08 13:08]
starlits
dbms:pgsql:clientenv [2008/02/08 13:19] (현재)
starlits
줄 1: 줄 1:
 ====== PostgreSQL 환경설정 ====== ====== PostgreSQL 환경설정 ======
 +
 +
 +===== set AUTOCOMMIT OFF in psqlrc not having affect (~/.psqlrc) =====
 +  - I have \set AUTOCOMMIT OFF in my .psqlrc and it seems psql seems to not have any effect. \\ Am I missing something? I've been googling and googling and seem a bit lost at this point. 
 +  - ~/.psqlrc 에 아래의 내용이 존재하여야 한다. <code>
 +$ cat ~/.psqlrc
 +\set AUTOCOMMIT OFF
 +\echo 'AUTOCOMMIT is' :AUTOCOMMIT
 +\set PROMPT1 'host.%/%R%# '
 +\timing
 +</code>
 +  - 시작은 BEGIN으로 시작해야 하며, COMMIT, ROLLBACK 으로 DDL 명령을 실행한다. <code>
 +$ psql
 +Welcome to psql 7.4.5, the PostgreSQL interactive terminal.
 +
 +Type:  \copyright for distribution terms
 +       \h for help with SQL commands
 +       \? for help on internal slash commands
 +       \g or terminate with semicolon to execute query
 +       \q to quit
 +
 +AUTOCOMMIT is OFF
 +Timing is on.
 +host.domain=# commit;
 +WARNING:  there is no transaction in progress
 +COMMIT
 +host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
 +UPDATE 1
 +host.domain=# commit;
 +WARNING:  there is no transaction in progress
 +COMMIT
 +host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
 +UPDATE 1
 +host.domain=# rollback;
 +WARNING:  there is no transaction in progress
 +ROLLBACK
 +host.domain=# begin;
 +BEGIN
 +host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
 +UPDATE 1
 +host.domain=# rollback;
 +ROLLBACK
 +host.domain=# begin;
 +BEGIN
 +host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
 +UPDATE 1
 +host.domain=# rollback;
 +ROLLBACK
 +host.domain=# \q
 +</code>
  
  
dbms/pgsql/clientenv.1202443711.txt.gz · 마지막으로 수정됨: 2008/02/08 13:08 저자 starlits