473,378 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

dumping the schema

How to DUMP the Database schema, (so later can get it back i.e recreate everything).
I need only the schema (tables, users, groups etc..) now (not the data, is it any different if i want the data too).

the dump should be in order so that i can just execute it...

One more thing I created db and tables with default config (with pgadmin3) i.e. owner postgres,
Now I want to switch all to other user I just created, can I do it "at once" or I
have to go and edit permission of every table...
Can I remove any access to the DB for "postgres" and "public" and leave such access to
my new user OR they should stay for some db-functionality..

tia

---------------------------(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
1 1536
ra****@tvskat.net wrote:
How to DUMP the Database schema, (so later can get it back i.e recreate everything).
I need only the schema (tables, users, groups etc..) now (not the data, is it any different if i want the data too).
http://www.postgresql.org/docs/7.4/s...pp-pgdump.html

Check --schema-only/--data-only options.
the dump should be in order so that i can just execute it...
psql dbname < dump.file

This is the simplest way of restoring a dump.
One more thing I created db and tables with default config (with pgadmin3) i.e. owner postgres,
Now I want to switch all to other user I just created, can I do it "at once" or I
have to go and edit permission of every table...
Dump the schema and hand-edit it to change ownership.
Can I remove any access to the DB for "postgres" and "public" and leave such access to
my new user OR they should stay for some db-functionality..


Well, you better leave those users and accesses in place on system objects at
least. For use defined table, you can fiddle around as you please.

HTH

Shridhar

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

Nov 23 '05 #2

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

Similar topics

6
by: Greg Brant | last post by:
Hi, how can i backup a table / entire DB and get the index's as well as the data / create table's etc cheers Greg
4
by: rozrabiak | last post by:
Hi:) I need to dump data from database in to *.sql file. I try it using DUMP DATABASE but it not work that I need it. So, how can I dump data from database in to *.sql file and then run it...
0
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > ...
4
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could...
10
by: ken | last post by:
hello, i'm writing a c program on a linux system. i'm debugging a segmentation fault but i don't want it to dump a core file because the memory footprint of the program is over 300Mb and i don't...
3
by: noleander | last post by:
My Vis C++ program takes forever to exit. Reason: it is dumping potential memory leaks. I like finding leaks once a month, but not every time I run. How do I turn mem leak dumping off? I...
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
11
by: davids58 | last post by:
I currently create sites using xml and xsl to produce .html files. I'm thinking about using PHP and MySQL instead for performance reasons. Is there a way of using PHP to create a set of .html files...
7
by: gomzi | last post by:
hi, I would like to know the command for dumping stored procedures. Thought that I knew the command and dumped the db using the -R option, only to realise that dumping of procedures had failed...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.