473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

owner orphaned databases

CSN
Not a big deal, but I'm transferring a dumpall and
it's choking on databases where the owner no longer
exists. Maybe it shouldn't be possible to delete a
user while it still owns databases, or maybe a cascade
option, or requiring changing the ownership to another
user?

CREATE DATABASE "orphan" WITH OWNER = "deleted" ...;
....
SET SESSION AUTHORIZATION "deleted";
....
\c orphan # fails because "orphan" wasn't created
CSN

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

Nov 23 '05 #1
1 1273
CSN <co*******************@yahoo.com> writes:
Maybe it shouldn't be possible to delete a
user while it still owns databases,


You mean like this?

regression=# create user foo;
CREATE USER
regression=# create database foo owner foo;
CREATE DATABASE
regression=# drop user foo;
ERROR: user "foo" cannot be dropped
DETAIL: The user owns database "foo".
regression=#

There are plenty of related scenarios that we don't cover, but AFAIR
that particular interlock has always been there.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2

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

Similar topics

2
by: jack-b | last post by:
Hi, I currently have two databases (DEV & TEST) with the same users but different owners. The TEST database is on a remote machine with 2 database users - USR1 & DBO. The DEV database is exactly...
6
by: David Allison | last post by:
Relationship problem ~ How to tell Owner his db is crap. His db was made in 1999 - 12 tables - none normalised - none with relationships.(YES REALLY) He only knows about inputing data - 22,000...
1
by: Mike Mascari | last post by:
While migrating to 7.4, which performs quite nicely btw, I must have performed some sequence of the migration incorrectly. Now, when I use pg_dump on a database for backup, I get: pg_dump:...
1
by: andreas.bjorck | last post by:
Hello, Does anyone know what procedure to run to show information such as the owner of a specific database for MSSQL2000? I want to make a script to loop through all the databases on a server...
0
by: skip | last post by:
Over the past couple days I've been trying to reduce the large number of orphaned wiki pages, deleting many, stitching many others back into the fabric. There are a bunch of orphaned PyCon-related...
1
by: Mikael71 | last post by:
Hi, I'm currently following the book: Beginning Databases with PostgreSQL, From Novice to Professional with Postgresql-8.2.0-1 Chapter 4, page 76: Accessing You Data. Having followed the book's...
2
by: amplegamble | last post by:
Hello, As the title says I need to find out the owner of database on both sql 2000 and 2005. I found a query which works great on sql 2005.. select suser_sname(owner_sid) from sys.databases where...
4
by: John Sheppard | last post by:
Hello there, I was wondering if anyone could give me some advice on orphaned rows and foreign key constraints. I am migrating a MS-Access database that didnt have any relations setup...
2
by: aj | last post by:
SQL Server 2005 SP2 What is the significance of the owner of a database being sa as opposed to some administrative (or non-administrative) local login? Should I favor one over the other? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
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...

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.