473,770 Members | 6,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

template1, createdb, schemas, and owners

CSN
I have two machines between which I exchange dumps a
lot. On the first (Windows/cygwin), pgsql was set up
with "Administra tor" as the main superuser - who owns
all schemas in template0 and template1. On the second
machine (Linux), "postgres" is pgsql's main superuser.
On whatever machines I do "createdb", the owner of the
schemas in template0/1 is copied over to the schemas
in the new database, even when specifying the owner
parameter (shouldn't the owner of the database own all
schemas in it?). This creates problems when dumping
and importing between the machines. The "SET SESSION
AUTHORIZATION 'Administrator' ;" causes errors when
trying to import on the machine without user
"Administrator" .

What's the best way to remedy the problems caused by
the two different superusers? I've thought about
trying to change all instances of "Administra tor" to
"postgres" on the first machine, but don't know how to
go about it.

TIA,
CSN


_______________ _______________ ____
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
1 1585
CSN wrote:
I have two machines between which I exchange dumps a
lot. On the first (Windows/cygwin), pgsql was set up
with "Administra tor" as the main superuser - who owns
all schemas in template0 and template1. On the second
machine (Linux), "postgres" is pgsql's main superuser.
On whatever machines I do "createdb", the owner of the
schemas in template0/1 is copied over to the schemas
in the new database, even when specifying the owner
parameter (shouldn't the owner of the database own all
schemas in it?). This creates problems when dumping
and importing between the machines. The "SET SESSION
AUTHORIZATION 'Administrator' ;" causes errors when
trying to import on the machine without user
"Administrator" .

What's the best way to remedy the problems caused by
the two different superusers? I've thought about
trying to change all instances of "Administra tor" to
"postgres" on the first machine, but don't know how to
go about it.

TIA,
CSN


If you haven't already, check out pg_dump's -O option. This suppresses
all ownership data from the backup, so you'll never get any "SET SESSION
AUTHORIZATION.. ." lines at all. My setup doesn't use schemas, though,
so I can't be sure there aren't any issues lurking there, but I can't
see why there would be.

Rachel
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2

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

Similar topics

2
1294
by: AnonymousOne | last post by:
Greetings all, I'm getting a little frustrated trying to figure this out. When creating an XML schema file, the default extention is XSD. How is it that schemas can be accessed using only their XMLNS name (which does NOT include the XSD extension)? If I enter the XMLNS attribute into a browser, I get HTML pages - how are parsers resolving this? I've come across the "xsi:schemaLocation" attribute, but this is cumbersome to use, and...
3
3746
by: Dr. Azmir | last post by:
Hi there I'm Dr. Azmir from Kuala Lumpur. I'm using RH 9.0 with postgresql intalled in it. My problem is I can't createuser and createdb with it. The error message "psql: FATAL: user "name" does not exist createdb: database creation failed" will pop up. Why?
5
3275
by: Frank van Vugt | last post by:
Hi, I noticed that when using the single commandline: drop database <name>; create database <name>; this sometimes fails due to a pg_autovacuum process running on the background. When this happens, the error returned is:
16
2464
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables (se below) then I run a query giving me a running total, which give me the first stock in the batch purchased by an individual, then I use this number and add the number of shares in order to find the number of the individuals' last share. So...
5
1422
by: Hadley Willan | last post by:
Hello, I've accidently created a whole bunch of tables and sequences in template1. I didn't actually want the information in template1 but with the slip of a key my script piped all the commands into it and now all the info is there, doh!. Problem is now that I try to create the DB I want, all the view and structures are already there.
3
1335
by: Mark Harrison | last post by:
Apache has a nice feature: it creates copies of all the default configuration files, so that it's easy to diff and see what has been modified in the config files. Can this be included in createdb as well? Thanks, Mark Here's a patch:
1
1628
by: Michal Taborsky | last post by:
Hi there. I had a weak moment and accidentally ran a dump restore script on template1 instead of proper database. So my template1 is now polluted with many tables, sequences and the like. Is there a way to restore a pristine template1? I haven't done any modifications to it, so I'd be good with the one distributed with default installation. Is it safe to DROP DATABASE template1 and recreate it with dump from different cluster?...
0
1089
by: Thamzyne | last post by:
Hi guys Scenario: There are 4 db owners: wh1, wh2, wh3, wh4. I have created a stored proc for wh2 and it works. Problem: I want to make my stored proc wise enough to be able to see and instruct data from the other db owners. Remember a stored proc is sitting under wh2. I have tried to use prefixes like wh1..., wh3 and wh4 when I am calling the tables from these owners but when I am running the stored procedure, the error message: "Table...
5
8206
by: anand4nk | last post by:
Hi, I am installing postgreSQL 8.2 using batch files in windows xp machine. I am installing postgres using postgresql-8.2.msi installer. Installation was successful. When i tried to run createdb command using the following command from another batch file "createdb -U dbname username"
0
10225
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...
0
10053
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...
0
9867
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
8880
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...
0
6676
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
5312
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
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
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.