From: bangh <banghe@baileylink.net>
To: Andy Ruhl <acruhl@sdf.lonestar.org>
Cc: pgsql-admin@postgresql.org
Subject: Re: Sample database for testing?
Date: Fri, 01 Feb 2002 14:26:57 -0600
Message-ID: <3C5AFA10.B0B664FC@baileylink.net> (raw)
References: <Pine.NEB.4.33.0201260404390.22671-100000@sdf.lonestar.org>
There is a database template1 you can play with.
If there is no table in template1, you can create one by:
psql template1
psql> create table mytable (
psql> mydate datetime,
psql> mymem text);
psql> insert into mytable values('now', 'I am doing this today');
psql> select * from mytable;
psql>\q;
dump your database:
pg_dump template1 > mydump.pgdump
create another copy of this database:
createdb newdatabase
cat mydump.pgdump | psql newdatabase
have a look at your new database
psql newdatabase
psql>\d;
psql>select * from mytable;
(add a new column)
psql>alter table mytable add column priority text;
psql>insert into mytable values('now', 'Always play at first, then ...',
'super high');
psql>select * from mytable;
psql>\q;
Have a lot of fun!
Banghe
Andy Ruhl wrote:
> I'm new to postgresql and I was wondering if there was a "sample" database
> out there I could use to practice dumping and reloading. I figure I should
> get good at recovery and administration before I actually use it... I
> don't have a database to do these kinds of things with and I'd rather not
> write one just so I can hose it...
>
> Thanks.
>
> Andy
>
> acruhl@sdf.lonestar.org
> SDF Public Access UNIX System - http://sdf.lonestar.org
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: banghe@baileylink.net, acruhl@sdf.lonestar.org
Subject: Re: Sample database for testing?
In-Reply-To: <3C5AFA10.B0B664FC@baileylink.net>
References: <Pine.NEB.4.33.0201260404390.22671-100000@sdf.lonestar.org> <3C5AFA10.B0B664FC@baileylink.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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