473,549 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manage PostgreSQL Connections

Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must bedisconnected first.
Is that right?
_______________ _________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
Nov 11 '05 #1
3 5629
Thank you for the information.
the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place. By that you mean to have a pg_hba.conf file in $PGDATA directory named for
example pg_hba.conf.dum p and when
I want to perform the backup/restore to rename it to pg_hba.conf and make a
/etc/init.d/postgresql reload?
and by doing that users will not lose their data between the dump and
restore?
I think by doing /etc/init.d/postgresql reload with the new pg_hba.conf
users will be cut of brutaly, or am I wrong?

Thank you again,
On Thu, 14 Aug 2003, Nagy Karoly wrote:
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first. Is that right?


Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.

--
_______________ _________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
""Nagy Karoly"" <na********@exp ert-software.ro> wrote in message
news:000801c362 6c$cda8fd20$030 1a8c0@karaszexp ert...
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be
disconnected first.
Is that right?
_______________ _________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
Nov 11 '05 #2
On Thu, 14 Aug 2003, Nagy Karoly wrote:
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first.
Is that right?


Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #3
The only thing you want to be aware of is autovacuuming or vacuuming off of a chron script in the middle of dumping.

scott.marlowe wrote:
On Thu, 14 Aug 2003, Nagy Karoly wrote:

Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first.
Is that right?

Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5393
by: no-spam | last post by:
Hello group, I have some questions concerning configuring and using a JNDI DataSource with PostgreSQL and Apache Tomcat. Currently, I belive I have successfully configured a "basic" DataSource. Currently, my configuration which resides in a context.xml file is as follows: <Context className="org.apache.catalina.core.StandardContext"...
5
2464
by: Carlos Moreno | last post by:
Hi, I'm experiencing some really odd behaviour after upgrading to postgresql 7.4.1 We have three different machines: 1) Dual Athlon, 1GB RAM running RedHat 7.3 with all the updates (kernel, glibc, gcc/g++ 2.96-113)
20
6569
by: Keith G. Murphy | last post by:
I'm trying to get a feel for what most people are doing or consider best practice. Given a mod_perl application talking to a PostgreSQL database on the same host, where different users are logging onto the web server using LDAP for authentication, do most people 1) have the web server connecting to the database using its own user account...
19
5218
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the application under heavy load. When increasing the number of requests, all my memory is filled, and the Linux server begins to cache and remains...
2
2199
by: Postgresql | last post by:
What logs does postgresql produce? 1) It has transaction logs. Can it log connections? Are there other logs? 2) When I start postgresql it outputs log messages to the console. Does this also log anywhere else?
0
295
by: Steve Wolfe | last post by:
Some time ago, I asked about how well PostgreSQL scales with the number of processors in an Opteron system. To my surprise, no one seemed to know! Well, a couple of days ago, a shiny, new Celestica A8440 showed up at my office, so I decided to run it through the paces. Hopefully, this will be useful to someone else as well! Hardware info...
14
2582
by: jptpjs via AccessMonster.com | last post by:
I have an application I built in Access 2003. It is an electronic medical records program split into front end (8 computers) and back end. This runs flawlessly. Purchased a billing program that uses Postgresql. This resides on the same computer as our Access backend. We keep getting knocked out of the new billing program and never get knocked...
1
5672
by: Pradip | last post by:
Hello every body. I am new to this forum and also in Python. Read many things about multi threading in python. But still having problem. I am using Django Framework with Python having PostgreSQL as backend database with Linux OS. My applications are long running. I am using threading. The problem I am facing is that the connections that...
1
4527
by: nampet | last post by:
We set up a new system with the OS and database below. Now some pages are not loading in browser. the error is: but the same code is no problem with old server.. i can also insert the data into database with some pages.
0
7558
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7484
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7755
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7515
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7842
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6091
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5124
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
798
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.