473,811 Members | 3,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dumping pg_shadow and pg_database as SQL using pg_dump

I'd like to save the list of users, groups, and databases regularly to a
separate file (just in case). The output of pg_dumpall suffices for my need:

=============== =============== ===
DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database
WHERE datname = 'template0');
CREATE USER ... WITH SYSID ... PASSWORD '...' NOCREATEDB NOCREATEUSER;
....

DELETE FROM pg_group;
....

CREATE DATABASE ... WITH OWNER = ... TEMPLATE = ... ENCODING = '...';
....
=============== =============== ===

But can I get these with pg_dump?

--
dave
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
0 1212

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

Similar topics

0
1124
by: Greg Patnude | last post by:
From: "Greg Patnude" <gpatnude@hotmail.com> Subject: pg_shadow --> passwd Date: Monday, October 13, 2003 6:04 PM Is there a way to "decrypt" a database users passwd stored in pg_shadow ??? my postgreSQL installation stores passwords as MD5... I have a need to authenticate users from a login page before I give them system access.... Thoughts anyone ???
7
4840
by: Ed L. | last post by:
We are seeing what looks like pgsql data file corruption across multiple clusters on a RAID5 partition on a single redhat linux 2.4 server running 7.3.4. System has ~20 clusters installed with a mix of 7.2.3, 7.3.2, and 7.3.4 (mostly 7.3.4), 10gb ram, 76gb on a RAID5, dual cpus, and very busy with hundreds and sometimes > 1000 simultaneous connections. After ~250 days of continuous, flawless uptime operations, we recently began...
1
1826
by: William Harazim | last post by:
Is there a way, having a user entered username and password, to select a single row from pg_shadow which is using md5 password encryption? I'm currently authenticating web users (.asp page) with our own user table that uses crypt() to store passwords. I'd like to remove our 'redundant' user table and use pg_shadow. The authentication function I'm using is included in the attachment... Thanks. <<auth_user.txt>> William Harazim,...
4
3817
by: jack turer | last post by:
I have a database in pgsql (7.3.2) on redhat 9. When I try a 'pg_dump mydb' to back up the database, I get: pg_dump: could not find namespace with OID 2200 Verbose version is: -bash-2.05b$ pg_dump -v mydb | more pg_dump: saving database definition pg_dump: reading namespaces pg_dump: reading user-defined types
2
3058
by: Kari Lavikka | last post by:
Hi, I'm having some problems with pg_database -system table. It lost all of it's contents while database was running. It's actually still running but I don't know what to do because I'm not sure if it will start up at all after shutdown. I noticed the problem while trying to use pg_dump: tuner@xyzzy:~$ /usr/local/pgsql/bin/pg_dump -Ugalleria galleria pg_dump: missing pg_database entry for database "galleria"
26
5525
by: David Garamond | last post by:
I read that the password hash in pg_shadow is salted with username. Is this still the case? If so, since probably 99% of all PostgreSQL has "postgres" as the superuser name, wouldn't it be better to use standard Unix/Apache MD5 hash instead? -- dave ---------------------------(end of broadcast)---------------------------
2
2151
by: Együd Csaba | last post by:
Hi All, I'm wonder if there is any possibility to modify a users password by updating the pg_shadow table. I'd like to ensure that when the user modifies his/her http password (htpasswd) than his database password also changes. It is important to have the same password for both services. I plan to do it from php. Is there any way to do so? Thans,
0
1170
by: stig erikson | last post by:
Hi. Is it possible to dump a database on a 7.4.6 server and then restore it on a 7.4.1 server? should i use the 7.4.1 pg_dump or the 7.4.6 pg_dump? should i use any switches? thanks
1
4484
by: kaywin | last post by:
pg_dump: SQL command failed pg_dump: Error message from server: ERROR: relation "pg_user" does not exist pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE usesysid = datdba) as dba, pg_encoding_to_char(encoding) as encoding, datpath FROM pg_database WHERE datname = 'dbname' Can anybody suggest to take the backup??
0
9605
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
10392
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
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
10136
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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
7671
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
5555
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...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3868
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.