469,087 Members | 1,277 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,087 developers. It's quick & easy.

Functions not dropped.

I was a little surprised today when I tried to move a production
database on to my test server. The test server already had a copy of
the database so I did

psql -Uadmin template1
drop database admin;
create database admin;

When I tried to reload the production database dump, I got a series of
errors relating to functions. I repeated the exercise but this time did
a \df prior to trying to load the database. In the public schema for the
newly created admin database where all the functions from the old one.
It seems that the drop database doesn't drop all of the functions. Is it
supposed to ? I am using 7.4.2 on FC2.

If it isn't is there a way to clean them all out before the load ?

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Glen and Rosanne Eustace,
GodZone Internet Services, a division of AGRE Enterprises Ltd.,
P.O. Box 8020, Palmerston North, New Zealand 5301
Ph/Fax: +64 6 357 8168, Mob: +64 27 5 424 015, Web: www.godzone.net.nz

"A Ministry specialising in providing low-cost professional Internet
Services to NZ Christian Churches, Ministries and Organisations"
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
2 1938
On Mon, 2004-11-01 at 21:14, Sim Zacks wrote:
I would check the template1 database to see if you had the functions
defined there as well.
Any functions/structures/data... in template1 will be moved to the new
database. Then when you try to restore the old one it will conflict.


Thanks you.

That is exactly what had happened. I recall on a previous exercise
loading the database but forgetting to created the admin db first and it
loading the whole lot into template1. I remember cleaning out all the
tables etc, I must have forgotten the functions.

Time to re-init the installation.

---------------------------(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 23 '05 #2
On Mon, 2004-11-01 at 21:14, Sim Zacks wrote:
I would check the template1 database to see if you had the functions
defined there as well.
Any functions/structures/data... in template1 will be moved to the new
database. Then when you try to restore the old one it will conflict.


Thanks you.

That is exactly what had happened. I recall on a previous exercise
loading the database but forgetting to created the admin db first and it
loading the whole lot into template1. I remember cleaning out all the
tables etc, I must have forgotten the functions.

Time to re-init the installation.

---------------------------(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 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

99 posts views Thread by David MacQuigg | last post: by
76 posts views Thread by Nick Coghlan | last post: by
4 posts views Thread by Ufit | last post: by
5 posts views Thread by Sarloc | last post: by
reply views Thread by Glen Eustace | last post: by
9 posts views Thread by TheOne | last post: by
110 posts views Thread by Gregory Pietsch | last post: by
23 posts views Thread by deepakvsoni | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.