pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
copy a database withou the data
2+ messages / 2 participants
[nested] [flat]

* copy a database withou the data
@ 2008-03-06 18:48  Marc Fromm <Marc.Fromm@wwu.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Marc Fromm @ 2008-03-06 18:48 UTC (permalink / raw)
  To: pgsql-admin

We have a database that we use each year.
Each year the database needs to be free of any data from the past year.
We need to retain last years data base with its data.

I tried using template:
CREATE DATABASE 'year2007-2008' TEMPLATE 'year2006-2007';

But the new database contains all the data from the old database.
Is there a way to just get the old database design into a new database?

Thanks

Marc




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: copy a database withou the data
@ 2008-03-06 18:55  salman <salmanb@quietcaresystems.com>
  parent: Marc Fromm <Marc.Fromm@wwu.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: salman @ 2008-03-06 18:55 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin


Marc Fromm wrote:
> We have a database that we use each year.
> Each year the database needs to be free of any data from the past year.
> We need to retain last years data base with its data.
> 
> I tried using template:
> CREATE DATABASE 'year2007-2008' TEMPLATE 'year2006-2007';
> 
> But the new database contains all the data from the old database.
> Is there a way to just get the old database design into a new database?
> 
> Thanks
> 
> Marc
> 
> 
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-admin
> 
> 

Sounds like you just want the schema? If so, pg_dump -s will get you it.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-03-06 18:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-06 18:48 copy a database withou the data Marc Fromm <Marc.Fromm@wwu.edu>
2008-03-06 18:55 ` salman <salmanb@quietcaresystems.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox