473,799 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creation permissions when moving from 7.2 -> 7.4

I am attempting to transfer a cluster of 28 databases from one machine to
another. The former machine runs PostgreSQL 7.2.3; the latter 7.4.2.

I first tried a filesystem-level backup. I stopped the old server, copied
its data directory, restarted the old server, transferred the copied data
to the new machine, and attempted to start the new server. The new server
complained about the version mismatch. Fair enough.

I then tried pg_dump and its ilk. As we rely on OIDs and BLOBs, I didn't
use pg_dumpall for everything, but rather used a shell script to grab the
global stuff and to iterate through the databases with pg_dump:

#!/bin/sh

export PGUSER=postgres
export PGPASSWORD=**** ********

pg_dumpall -g > globals.sql

for i in $(psql template1 -t -A -c \
"select datname from pg_database;"); do
echo "Dumping catalog [$i] ..."
pg_dump -b -o -Ft $i > $i.tar
done

I then attempted to restore this data on the new machine:

#!/bin/sh

export PGUSER=postgres

psql template1 -f globals.sql

for i in *.tar; do
echo "Restoring from [$i] ..."
pg_restore -d template1 -C $i.tar
done

The new server's pg_hba.conf's first line is "local all all trust".

Most of the databases are owned by usesysid #1 ("postgres") and were
restored properly. The ones owned by a different user did not:

Restoring from [ajp.tar] ...
pg_restore: [archiver (db)] could not execute query: ERROR:
permission denied to create database

Given that (a) I'm using PGUSER=postgres and (b) my pg_hba.conf should be
sufficiently liberal anyway, I'm wondering why this is not working.

Also, template0 failed due to a null tar file, and template1 failed due to
it already existing. Would I be correct in assuming that the globals.sql
step takes care of the necessary items in template1, and that I can leave
template0 alone altogether?

--
Kevin DeGraaf

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 23 '05 #1
1 1452
Kevin DeGraaf <ke***@kevindeg raaf.net> writes:
Restoring from [ajp.tar] ...
pg_restore: [archiver (db)] could not execute query: ERROR:
permission denied to create database Given that (a) I'm using PGUSER=postgres and (b) my pg_hba.conf should be
sufficiently liberal anyway, I'm wondering why this is not working.
I think you've got the other user not permitted to create databases?
I believe 7.4's pg_dump creates a script that handles this case
correctly, but 7.2's doesn't. (A hint for next time is that it's
usually best to use the latest available pg_dump.)
Also, template0 failed due to a null tar file, and template1 failed due to
it already existing. Would I be correct in assuming that the globals.sql
step takes care of the necessary items in template1, and that I can leave
template0 alone altogether?


template0 is do-not-touch. You need only worry about template1 if you
created stuff in it to have copied to other databases by CREATE
DATABASE. (The most common thing of that sort is procedural languages;
you'd be best advised to use "createlang " to reinsert them anyway.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #2

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

Similar topics

1
1992
by: Ook | last post by:
I am trying to create a project. The web server is IIS running on a Win2000 pro box. I have shared the wwwroot directory under my inetpub directory. I have previously created the directory I'm creating the project in, and from IIS given it every privelage I can think of giving it. I go to create a new C# ASP Web page project. I get this message: "Unable to set the permissions on the 'bin' folder to restrict browse access. Active...
3
2929
by: Jennifer Sanders | last post by:
We're running windows 2000 server with IIS 5.0. We're trying to execute .asp scripts but we keep getting the 500 (internal server) error. It looks like the permissions might be corrupted. When I go to the folder in question, go to properties >> security and look at the user groups, for several seconds they say this: S-1-1-0
6
1722
by: jonathanmcdougall | last post by:
I have read many posts on this subject and found no satisfying answer. I am creating a file on the server via a PHP script. The file is created using GD (imagejpeg()), though I don't think it is specific to GD. Here is what I understand so far: 1) a PHP script runs in the webserver user space. In my case, this is 'apache', though I think 'nobody' is quite frequent also. 2) creating a file from the script makes the "current" user its...
1
2370
by: William Grace via AccessMonster.com | last post by:
I still have not had an answer to this, anyone with any ideas? I create an MBE in Folder A, it works in folder A, it works when I double click on it. if I move it to Folder B, it will not launch when double clicked on, it will only run when I use Access to open it as a file. If I create the file in Folder B, it works, I can double click on it I can do what I like, I move it to Folder A, and it will not run unless selected open file...
1
3073
by: Daniel Passwater via DotNetMonster.com | last post by:
I'm working on a app that displays according to a registry key value. The user needs the ability to update the display, and hense the registry key (via a click event on a popup menu). This all worked just fine until some users were set up as power-users. I've tried to change the permissions on that key programatically, on the fly, but to no avail. Here's my question: While the user is logged in with limited permissions, will the...
8
3453
by: Anthony Munter | last post by:
I have a web application with impersonate=”true” in Web.config and on my own logon page I allow the user to either - specify a userid/password for the app to impersonate when calling legacy COM objects - or, just use the interactive user If they choose to use the interactive option, the impersonate="true" means that the process runs under the interactiv user (which I've confirmed works correctly). If they specify a userid/password, I...
1
2214
by: Fred W. | last post by:
I have an application that creates directories in ...\All Users\Application Data. When I create the directories I need to make sure all users can modify and add files to them. How do I set permissions on the directory so that when they are initially created, "Everyone" has full control, even if the logged in user (i.e. the one creating them) is restricted. Thanks - Fred (using VS 2005 Pro)
4
3530
by: cybertoast | last post by:
i seem to have some misunderstanding about how roles work in sql server 2005. i see that i can add a role to a database (dbname->->properties->permissions->. THis allows me to add either users or roles. Users can be added programmatically using sp_grantdbaccess @username, but this does not allow for addition of roles to access the database (i.e., sp_grantdbaccess @rolename does not work). Is there some other command that is used to add...
2
4031
by: =?Utf-8?B?am9obnByZW1p?= | last post by:
Hi there, I have a web app that adds user into w2k3 server and adds it to the administrator group. The code snippet is something like this: try { DirectoryEntry AD = new DirectoryEntry("WinNT://" + in0.IPAddress + ",computer", in1.userName, decryptData(in1.password), AuthenticationTypes.Secure); // Create super user
15
1835
by: udayahirwal2 | last post by:
Can i create 4 sockets on same ip address with different portnumbers. I am working on windows mobile.
0
9687
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
1
10231
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
10027
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
9073
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 projectplanning, coding, testing, and deploymentwithout 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
7565
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
6805
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
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
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.