logo       

Re: questions about transaction and rollback: msg#00056

Subject: Re: questions about transaction and rollback
jing han wrote:

Hello,

I have questions about transaction and rollback.

Question 1:
In the postgresql.conf file of our running system,
autocommit=true. If leave it as true, can we disable
this attribute when we issue a connection to database?

From the DBD::Pg documentation:

The transaction behavior is now controlled with the attribute AutoCommit. For a complete definition of AutoCommit
please refer to the DBI documentation.

According to the DBI specification the default for AutoCommit is TRUE. In this mode, any change to the database becomes valid immediately. Any ’begin’, ’commit’ or ’rollback’ statement will be rejected.

If AutoCommit is switched-off, immediately a transaction will be started by issuing a ’begin’ statement. Any ’commit’ or ’rollback’ will start a new transaction. A disconnect will issue a ’rollback’ statement.




Question 2:

If we use the following command to restore database.
system("su -l postgres -c \"psql -d dbname -f
/tmp/db_dump\"");
Can command psql rollback if in the middle of restore
power failure happens?

If the db_dump file starts with a transaction yes.



Question 3:

During restore, if power failure happens, we want to
rollback everything having been inserted or updated to
database. In another word, if we are restoring a
database with thousands of turples changes, at the
time, we restore the last turple, power failure
happens, we want to rollback.  Can postgres support
huge data changes in one transaction block?

Yes.

How to
configure the limit of how much we can do in one
transaction block?

That would be controlled by issuing multiple transactions.



Hope to hear from you soon and thank you in advance.

Sincerely,

Joshua D. Drake





Best Regards

jing


                
__________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe