473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Retoring non-administrative user databases

I was going a test run through of of moving my 7.1.3 databases to 7.4RC1 and I
have a problem with creating databases for my users that do not have
administrative accounts. By that I mean, these users are NOT allow to create
databases. So the process was this:

On the 7.1.3 server:
pg_dumpall -c > dump.db

On the 7.4RC1 server:
psql -f dump.db template1 or psql < dump.db

Either style has the same result. Also, I usually don't use pg_retore but in
this case I tried:

bin/pg_restore -d template1 --ignore-version --use-set-session-authorization dump.db

the error I got was:

pg_restore: [archiver] input file does not appear to be a valid archive
I'm also tried pg_restore with a 7.3.4 database file and the result was the same
on the 7.4 server.
What am I missing?
--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

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

Nov 12 '05 #1
8 2232
Keith C. Perry writes:
What am I missing?


A reproduceable test case.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
Quoting Peter Eisentraut <pe*****@gmx.net>:
Keith C. Perry writes:
What am I missing?


A reproduceable test case.

--
Peter Eisentraut pe*****@gmx.net


???

Ok, lets try the question this way...

What is a method of dumping and restoring a complete database cluster when that
cluster contains users that are NOT allowed to create databases.

--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

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

http://archives.postgresql.org

Nov 12 '05 #3
"Keith C. Perry" <ne******@vcsn.com> writes:
On the 7.1.3 server:
pg_dumpall -c > dump.db


You would probably have better luck using the 7.4 installation's pg_dump
and pg_dumpall to extract data from the 7.1 server; there are three
releases worth of bug-fixes in those that are not in the 7.1 dump tools.

Given the lack of detail about the actual problem in your posting, it's
hard to make any other specific recommendations.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4
Keith C. Perry writes:
What is a method of dumping and restoring a complete database cluster when that
cluster contains users that are NOT allowed to create databases.


There is nothing special you need to do, except of course not actually
restoring the dump as one of those unprivileged users. A pg_dumpall dump
must be restored as a superuser.

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

Nov 12 '05 #5
What am I missing?

A reproduceable test case.
It is reproduceable for him Peter.

Keith could you provide a little more information?

Who is the user doing the dump?
Who is the user doing the restore?
Are these users superusers?
Either way, my suggestion would be to dump the schema only, restore the
schema only.
Then dump the data only, and restore the data only.

7.1.3 has some oddities that don't always make a clean restore to a
newere version (at
leat not 7.3 series)

Sincerely,

Joshua Drake
--
Peter Eisentraut pe*****@gmx.net


???

Ok, lets try the question this way...

What is a method of dumping and restoring a complete database cluster when that
cluster contains users that are NOT allowed to create databases.


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC - S/JDBC
Postgresql support, programming, shared hosting and dedicated hosting.
+1-503-222-2783 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL.Org - Editor-N-Chief - http://www.postgresql.org

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

Nov 12 '05 #6
Quoting "Joshua D. Drake" <jd@commandprompt.com>:
What am I missing?
A reproduceable test case.
It is reproduceable for him Peter.

Keith could you provide a little more information?

Who is the user doing the dump?
Who is the user doing the restore?
Are these users superusers?
I actually thought pg_dumpall could only be done by a superuser but I am using
(for the dump and restore) "postgres" which is my database superuser.
Either way, my suggestion would be to dump the schema only, restore the
schema only.
Then dump the data only, and restore the data only.
I'll try that-
7.1.3 has some oddities that don't always make a clean restore to a
newere version (at
leat not 7.3 series)

Sincerely,

Joshua Drake
It has also occurred to try was Tom suggested- using a higher version of
pg_dumpall but I've missed a library the 7.1.3 server so I either have to
compile 7.4 on there or recompile the current 7.4 server without shared
libraries. I haven't done that yet but I did find my problem document in the
man pages of pg_dump at the -R option:
Prohibit pg_dump from outputting a script that
would require reconnections to the database while
being restored. An average restoration script usu-
ally has to reconnect several times as different
users to set the original ownerships of the
objects. This option is a rather blunt instrument
because it makes pg_dump lose this ownership infor-
mation, unless you use the -X use-set-session-
authorization option.

That is the problem or rather the difference between the two pg_dumpall
programs. Apparently in 7.1.3, the "set session authorization" method to set
database ownerships is not used as a default. Additionally, the 7.1.3 pg_dump
program does not have a -X option. It does look like the -O option will work to
dump without ownership so that might be an option (a tedious option) for my
older servers at this point.

At least I know what going on now so thanks to everyone for the useful feedback.
--
Peter Eisentraut pe*****@gmx.net


???

Ok, lets try the question this way...

What is a method of dumping and restoring a complete database cluster when

that
cluster contains users that are NOT allowed to create databases.


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC - S/JDBC
Postgresql support, programming, shared hosting and dedicated hosting.
+1-503-222-2783 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL.Org - Editor-N-Chief - http://www.postgresql.org

--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #7
On Sun, Nov 16, 2003 at 07:56:01PM -0500, Keith C. Perry wrote:
It has also occurred to try was Tom suggested- using a higher version of
pg_dumpall but I've missed a library the 7.1.3 server so I either have to
compile 7.4 on there or recompile the current 7.4 server without shared
libraries. I haven't done that yet but I did find my problem document in the
man pages of pg_dump at the -R option:


Remember that if you have another machine with 7.4 running, you can use
pg_dump/pg_dumpall over the network if you don't want to mess with the
server's libraries. (Though it should be quite straightforward to install
on isolation without disturbing anything else.)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"A wizard is never late, Frodo Baggins, nor is he early.
He arrives precisely when he means to." (Gandalf, en LoTR FoTR)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #8
Quoting Alvaro Herrera <al******@dcc.uchile.cl>:
On Sun, Nov 16, 2003 at 07:56:01PM -0500, Keith C. Perry wrote:
It has also occurred to try was Tom suggested- using a higher version of
pg_dumpall but I've missed a library the 7.1.3 server so I either have to
compile 7.4 on there or recompile the current 7.4 server without shared
libraries. I haven't done that yet but I did find my problem document in

the
man pages of pg_dump at the -R option:


Remember that if you have another machine with 7.4 running, you can use
pg_dump/pg_dumpall over the network if you don't want to mess with the
server's libraries. (Though it should be quite straightforward to install
on isolation without disturbing anything else.)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"A wizard is never late, Frodo Baggins, nor is he early.
He arrives precisely when he means to." (Gandalf, en LoTR FoTR)


You read my mind Alvaro. That is exactly what I ended up doing from my test
server. I LOVE that feature.

'Course I still have to compile 7.4 eventually so I compiled it anyway :)

--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

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

http://archives.postgresql.org

Nov 12 '05 #9

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

Similar topics

12
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few...
5
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence...
3
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in...
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
0
by: amitvps | last post by:
Secure Socket Layer is very important and useful for any web application but it brings some problems too with itself. Handling navigation between secure and non-secure pages is one of the cumbersome...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
12
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
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,...
0
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,...
1
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...
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.