Extracting object source code from database to store in CVS...

Поиск
Список
Период
Сортировка
От Adrianna Pinska
Тема Extracting object source code from database to store in CVS...
Дата
Msg-id 7c713879050323041036ad6536@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extracting object source code from database to store in CVS...  (Sean Davis <sdavis2@mail.nih.gov>)
Re: Extracting object source code from database to store in CVS...  (Bruno Wolff III <bruno@wolff.to>)
Re: Extracting object source code from database to store in CVS...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

I'm working on a project which uses postgresql (7.4.x), and a lot of
the project code is in functions, views, etc. in a postgresql
database.  I would like to create an automated process for extracting
all this code to individual text files (which can be managed through a
version control system), and for putting the code in the text files
back in the database.

To begin with, has this sort of thing been done before?  I don't want
to re-invent the wheel (unless it's a wheel with a proprietary
licence).

More specifically, I've been looking for a way to persuade postgresql
to output the create script for a single object - without much
success.  It seems that pg_dump can output a dump of the entire
database schema or a dump of a single table, but not of a different
kind of object like a function or view.  So at the moment it looks
like I'll have to parse the output of the psql "\d" commands into
create scripts by myself.

Does anyone here know of a (linux) command-line utility, or a function
which can be added to psql, which produces create scripts for single
objects?  I believe that mysql has a built-in command that does it;
that's the functionality I'm looking for.

Regards
Adrianna
--
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!
--Registered Linux User #334504--

В списке pgsql-general по дате отправления:

Предыдущее
От: "Sim Zacks"
Дата:
Сообщение: Re: multi line text data/query ?bug?
Следующее
От: Sean Davis
Дата:
Сообщение: Re: Extracting object source code from database to store in CVS...