Обсуждение: mirroring tables to sqlite?

Поиск
Список
Период
Сортировка

mirroring tables to sqlite?

От
Mark Harrison
Дата:
So I need to mirror some data to sqlite.  This will be a new application,
so we'll be able to keep the schema pretty simple so as not to overwhelm
sqlite... most of it is just strings and numbers anyways.

Right now I'm going over the output of "psql -echo-hidden" to see how
to pull the appropriate schema information from postgresql.  The final
output will be sqlite statements to create tables which mirror the
structure in the master postgresql database.

Does anybody have something like this already?

Thanks!
Mark

--
Mark Harrison
Pixar Animation Studios

Re: mirroring tables to sqlite?

От
John DeSoi
Дата:
On Dec 5, 2005, at 6:05 PM, Mark Harrison wrote:

> Right now I'm going over the output of "psql -echo-hidden" to see how
> to pull the appropriate schema information from postgresql.  The final
> output will be sqlite statements to create tables which mirror the
> structure in the master postgresql database.

You might be able to use pg_dump to get what you need - it can dump
the schema with or without data. In fact prior to SQLite 3.0, SQLite
had support for directly reading pg_dump output. For simple schemas
it would probably work fine. Just be sure to use the -d option if you
decide to dump data and you are using SQLite 3.0 or later.

http://www.postgresql.org/docs/8.1/interactive/app-pgdump.html

http://www.sqlite.org/lang_copy.html


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL