473,461 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DROP DATABASE, but still there

What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.

--
Robert
---------------------------(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 #1
5 3755
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #2
On Thu, 2004-11-11 at 14:03, Doug McNaught wrote:
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.


Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?

--
Robert
---------------------------(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
On Thu, Nov 11, 2004 at 14:17:45 -0500,
Robert Fitzpatrick <ro****@webtent.com> wrote:
On Thu, 2004-11-11 at 14:03, Doug McNaught wrote:
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.


Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?


I think you need to use the -T option if you do this to have a copy made
of template0 instead of the default of template1.

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

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

Nov 23 '05 #4

Robert Fitzpatrick <ro****@webtent.com> writes:
Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?


You can do that but you'll have to do:

CREATE DATABASE template1 WITH template = 'template0'
--
greg
---------------------------(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 #5
Greg Stark <gs*****@mit.edu> writes:
Robert Fitzpatrick <ro****@webtent.com> writes:
Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?
You can do that but you'll have to do:
CREATE DATABASE template1 WITH template = 'template0'


Also there are several safety interlocks you'll have to defeat, IIRC.
It's not rocket science but I'd recommend consulting the writeup on
techdocs.postgresql.org about the exact process for recreating
template1.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #6

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

Similar topics

5
by: Jim Bo | last post by:
Hi, I have a drop down menu that is being populated by a query to the access database ---- Code --- Skill needed <SELECT size="1" NAME="SkillType" VALUE="SkillType"> <OPTION>...
4
by: Angie H. | last post by:
Anyone know how to create a drop down menu where the user can enter text also? If they do not want to choose an answer from the drop down menu, the users can just enter their own answers in the...
0
by: Manzoorul Hassan | last post by:
I just Installed MySQL v4.1.14 and had created a Database (from a script). But I would like to redo the Database portion of it but am not able to drop the Database. If I do a "show database;" I...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
1
by: Lee Harr | last post by:
Is there any way to forcibly disconnect all users from a database, or else force the drop of the database even though others are still connected? I have a report I run where I first drop the old...
6
by: ameshkin | last post by:
Hi, I've been working on a drag drop system and something happened when I tried to switch the code from a working model to one with another database. The drag drop still works, but the informatin...
3
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
9
by: flymo | last post by:
Hello All, I have been asked to build a simple database that will operate and track a liquid dispensing device. The machine is run in a multi-bus drop (coin operated basis) but I need to make...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.