473,665 Members | 2,774 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 5637
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
5403
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" backgroundProcessorDelay="-1" cachingAllowed="true"
5
2468
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
6592
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 (possibly through ident), and controlling access to different database entities strictly through...
19
5237
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 frozen. ab -n 100 -c 10 http://localsite/testscript
2
2206
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 ------------- Celestica A8440 4xOpteron 848
14
2595
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 out of my Access program. The billing software provider says that Access and Postgresql running...
1
5683
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 are being created for database(postgres) update are not getting closed even though my threads had...
1
4534
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
8438
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7376
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.