By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Reloading Template1

P: n/a
Hello,
I've accidently created a whole bunch of tables and sequences in
template1.

I didn't actually want the information in template1 but with the slip of
a key my script piped all the commands into it and now all the info is
there, doh!.

Problem is now that I try to create the DB I want, all the view and
structures are already there.

How to I recreate an empty template1?

Thanks
--
Hadley Willan » Director » ha***********@deeperdesign.com » +64(21) 28
41 463
Deeper Design Limited » +64(7) 377 3328 » www.deeperdesign.com

Nov 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dear Hadley Willan ,

Read This
http://techdocs.postgresql.org/redir...enturesep1.php


--
Regards,
Vishal Kashyap

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
I Know you believe my words so logon to Jabber.org
and add vi***********@jabber.org to your roster.
OR
Seek Me at 264360076
~*~*~*~*~*~*~*~*
I am usually called as Vishal Kashyap
but my Girlfriend calls me as Vishal CASH UP.
This is because others identify me because of my generosity
but my Girlfriend identify me because of my CASH.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Nov 22 '05 #2

P: n/a
Dear Hadley Willan ,

Read This
http://techdocs.postgresql.org/redir...enturesep1.php


--
Regards,
Vishal Kashyap

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
I Know you believe my words so logon to Jabber.org
and add vi***********@jabber.org to your roster.
OR
Seek Me at 264360076
~*~*~*~*~*~*~*~*
I am usually called as Vishal Kashyap
but my Girlfriend calls me as Vishal CASH UP.
This is because others identify me because of my generosity
but my Girlfriend identify me because of my CASH.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Nov 22 '05 #3

P: n/a
On Tuesday 27 January 2004 08:13, Hadley Willan wrote:
Hello,
I've accidently created a whole bunch of tables and sequences in
template1.

I didn't actually want the information in template1 but with the slip of
a key my script piped all the commands into it and now all the info is
there, doh!.
We all have doh! moments, you are not the first to be here.
How to I recreate an empty template1?


Two options:
1. Manually undo all the changes (no, didn't think you liked that one)
2. Drop template1 and recreate it using template0

The createdb command has a flag to let you base your new database on something
other than template1. Actually, IIRC this is exactly why we have template0 -
for those occasions where you want to regenerate template1.

--
Richard Huxton
Archonet Ltd

---------------------------(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 22 '05 #4

P: n/a
Richard Huxton <de*@archonet.com> writes:
Actually, IIRC this is exactly why we have template0 -
for those occasions where you want to regenerate template1.


Well, that's one of its uses.

IIRC there is a page on techdocs.postgresql.org that will walk you
through this procedure. There are a couple of safety interlocks you
need to defeat temporarily, so it's a bit more than a DROP and a CREATE.

regards, tom lane

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

http://archives.postgresql.org

Nov 22 '05 #5

P: n/a
Thanks everybody for your help.

It was a pretty simple procedure at the end of the day and I've learned
a valuable lesson, remember which DB its all going to!

Thanks again.

Hadley

On Wed, 2004-01-28 at 10:13, Hadley Willan wrote:
Hello,
I've accidently created a whole bunch of tables and sequences in
template1.

I didn't actually want the information in template1 but with the slip
of a key my script piped all the commands into it and now all the info
is there, doh!.

Problem is now that I try to create the DB I want, all the view and
structures are already there.

How to I recreate an empty template1?

Thanks



Nov 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.