Re: Temporary, In-memory Postgres DB?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "Ron Johnson" <ron(dot)l(dot)johnson(at)cox(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Temporary, In-memory Postgres DB?
Date: 2007-11-07 15:40:04
Message-ID: D7FF158337303A419CF4A183F48302D6034F0654@hdsmsx411.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I'm thinking of a small DB (could fit into mem). And the notion
that all the data would reside in memory makes sense. But what about
the metadata? And there is the question of the "initdb" and all the
stuff it creates. That goes to disk, yes? no?

Another question, but first my tenuous understanding of how dbs are
created, up for critique...

- "initdb" creates (on disk) all the stuff you need to have before you
"createdb".
- "createdb" creates a db (puts it in the place you designated with
"initdb")
- "create schema" can be used to create multiple schemas in a singel DB.

- "drop schema" can be used to get rid of a schema within a db
- "dropdb" can be used to get rid of a db that was created with
"createdb"
Q: How does one get rid of whatever gets created with "initdb"? Is it
(gulp) just a "rm -r" ?

I do have access to scratch disks which, in effect, could be used as a
temporary storage area. IOW, if something goes wrong, and I don't get
to delete a db that was created on the scratch disk, it'll get cleaned
up for me overnight. It's just a question of how long it'll take to
initdb + createdb + create a db model + load.

Thanks for the expert advise !

-dave

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Ron Johnson
Sent: Wednesday, November 07, 2007 10:17 AM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Temporary, In-memory Postgres DB?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/07/07 09:03, Gauthier, Dave wrote:
> This is a real longshot, but here goes...
>
>
>
> Is there such a thing as a temporary, probably in-memory, version of a
> Postgres DB? Sort of like SQLite, only with the features/function of
> PG? A DB like this would exist inside of, and for the duration of, a
> script/program that created it, then vanish when the script/program
> ends.
>
>
>
> Probably not, but if not, then this would be (IMO) a great addition to
> have, something that'd really make it distinct from MySQL . I'd use
> SQLite, but I want to have stored functions and other "real" database
> features that it just doesn't have.

If you have enough RAM, and your database is small enough, the OS
will eventually cache the whole thing.

I know that's not exactly what you're talking about, but I think
it's as close as you'll get.

- --
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHMdcAS9HxQb37XmcRAqD9AJ4usfOq49ApqnLOz9advUnRmc7q2QCdFa8s
xAL+tMf4Xu4T4hGhvUCzomA=
=QmE5
-----END PGP SIGNATURE-----

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

http://www.postgresql.org/docs/faq

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2007-11-07 15:45:54 Re: md5() sorting
Previous Message Scott Marlowe 2007-11-07 15:39:56 Re: Temporary, In-memory Postgres DB?