472,371 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

dump schema schema only?

I have a development server where I, well, do my development. Occasionally,
I will create a new schema within an existing database that I would like to
use on my production machine. I know that doing a pg_dump -s <database>
somefile.sql will dump the entire schema of the database, but is there a

way to export only schema X from the database?

TIA
Patrick Hatcher

---------------------------(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 #1
6 11157

You can use -t to specify a table:

% pg_dump -s database -t tablename
-Rick

-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Patrick
Hatcher
Sent: Wednesday, October 29, 2003 12:57 PM
To: pg***********@postgresql.org
Subject: [GENERAL] dump schema schema only?
I have a development server where I, well, do my development.
Occasionally,
I will create a new schema within an existing database that I would
like to
use on my production machine. I know that doing a pg_dump -s
<database>
somefile.sql will dump the entire schema of the database, but is

there a
way to export only schema X from the database?

TIA
Patrick Hatcher

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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
"Patrick Hatcher" <PH******@macys.com> writes:
I have a development server where I, well, do my development. Occasionally,
I will create a new schema within an existing database that I would like to
use on my production machine. I know that doing a pg_dump -s <database>
somefile.sql will dump the entire schema of the database, but is there a

way to export only schema X from the database?


7.4's pg_dump has an option to dump the contents of just one schema.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #3
In article <20**************@sss.pgh.pa.us>,
Tom Lane <tg*@sss.pgh.pa.us> writes:
"Patrick Hatcher" <PH******@macys.com> writes:
I have a development server where I, well, do my development. Occasionally,
I will create a new schema within an existing database that I would like to
use on my production machine. I know that doing a pg_dump -s <database>
> somefile.sql will dump the entire schema of the database, but is there a way to export only schema X from the database?

7.4's pg_dump has an option to dump the contents of just one schema.


The pg_dump manpage of beta4 does not include this option, although
the source code does. Has this been fixed in beta5?
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #4
Harald Fuchs <no****@sap.com> writes:
Tom Lane <tg*@sss.pgh.pa.us> writes:
7.4's pg_dump has an option to dump the contents of just one schema.
The pg_dump manpage of beta4 does not include this option,


Sure it does:

-n namespace
--schema=schema

Dump the contents of schema only. If this option is not specified,
all non-system schemas in the target database will be dumped.

regards, tom lane

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

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

Nov 12 '05 #5
Harald Fuchs wrote:
In article <20**************@sss.pgh.pa.us>,
Tom Lane <tg*@sss.pgh.pa.us> writes:
"Patrick Hatcher" <PH******@macys.com> writes:
I have a development server where I, well, do my development. Occasionally,
I will create a new schema within an existing database that I would like to
use on my production machine. I know that doing a pg_dump -s <database>
> somefile.sql will dump the entire schema of the database, but is there a
way to export only schema X from the database?

7.4's pg_dump has an option to dump the contents of just one schema.


The pg_dump manpage of beta4 does not include this option, although
the source code does. Has this been fixed in beta5?


Really? Perhaps we haven't updated the manual pages, but the SGML is
OK. I have added this to the list to be done before 7.4 final.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #6
Tom Lane wrote:
Harald Fuchs <no****@sap.com> writes:
Tom Lane <tg*@sss.pgh.pa.us> writes:
7.4's pg_dump has an option to dump the contents of just one schema.

The pg_dump manpage of beta4 does not include this option,


Sure it does:

-n namespace
--schema=schema

Dump the contents of schema only. If this option is not specified,
all non-system schemas in the target database will be dumped.


I thought he was complaining because our 'man' output wasn't updated for
7.4. I just checked beta5's man.tar.gz, and it has the 7.3 contents,
and doesn't mention -n/--schema. I have added to our open items list:

Update manual pages.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

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

http://archives.postgresql.org

Nov 12 '05 #7

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

Similar topics

1
by: Thomas Marti | last post by:
Hello I have the following problem: I want to have an XML-Schema that only declares one Attribute, but does not specify in which specific Element it has to be used. I've already tried the...
0
by: Robert Jacobson | last post by:
Hi, I have a number of classes in one assembly. I'd like to use XSD.exe to generate a schema for just one class ("Parse Rules") and its nested child classes. Is there an attribute that will...
6
by: btober | last post by:
Is there a way to get a dump of all the DDL and data associated with a single schema within a database? What I tried in attempting to hack this out was \dt consume.* and \dv consume.*
0
by: Glenn Davy | last post by:
Hi all Is there a command like backup ( or an option to backup) I can execute from osql to simply dump out a schema (a bit like pg_dump --schema-only in postgres). I'm sure there must be...
1
by: MLH | last post by:
Last month, I posted this... http://support.microsoft.com/d­efault.aspx?scid=kb;en-us;1009­73 shows Function Screendump(). It is code that effectively does the same thing as pressing...
6
by: Rory Campbell-Lange | last post by:
I think this is a suggestion/comment! pg_dump man page: --schema-only Dump only the schema (data definitions), no data I think this use of the word schema is confusing, meaning data...
1
by: raptor | last post by:
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...
2
by: Anony Mous | last post by:
Hi, I've seen in previous posts that recommended practice for database backup is to run the dump utility twice. Once for schema only and a second time for data only (I think). Up to know,...
1
by: korkless | last post by:
hi, i have a xml as <itemCollection> <item enabled="false" /> <item enabled="true" /> <item enabled="false" /> </itemCollection> I want know if exists a solution with xml schema for...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.