473,811 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1290
CSN <co************ *******@yahoo.c om> 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
1848
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 the same. However, when I create procedures etc the DEV database recognises the owner as DBO and the TEST database USR1. I have made USR1 an owner on DEV and I login using the correct credentials. However it still is not recognising this when...
6
1746
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 records. How does one solve this type of Relationship ? -- Dave Allison ~ Scotland
1
2572
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: WARNING: owner of data type "plr_environ_type" appears to be invalid pg_dump: WARNING: owner of data type "r_typename" appears to be invalid pg_dump: WARNING: owner of function "plr_call_handler" appears to be invalid pg_dump: WARNING: owner of...
1
6920
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 and display owner and other helpful information. Best regards, Andreas
0
1023
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 pages, mostly subpages of PyCon2005 and PyCon2006. Would someone with PyCon-fu want to check them out and decide their fate? If so, visit http://wiki.python.org/moin/OrphanedPages and scroll down to the "P" section.
1
2985
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 instuctions, I've set up two roles: One as 'Mikael' and another as 'Rick' (with Mikael having permission to create Db's and new roles and Rick only having permission to create Db's) and created and populated a simple database called bpsimple. Using PSQL...
2
21957
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 name = 'DatabaseName' But cannot run this in QA against a sql 2000 database -- "Invalid object name 'sys.databases'." Anyone know how I can accomplish this? Select * from master.dbo.sysdatabases doesn't give me any promising data either,
4
1439
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 properly, consequently there are gazillions of orphaned tuples. If I was to leave these as they were and set constraints with NO CHECK is it likly that I am going to run into problems down the track?
2
2683
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? Can I change the owner of a database? TIA
0
9730
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
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
10651
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
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...
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...
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
6893
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
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
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

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.