Re: Pg_dumpall

Поиск
Список
Период
Сортировка
От weigelt@metux.de
Тема Re: Pg_dumpall
Дата
Msg-id 20030613210057.GB15639@metux.de
обсуждение исходный текст
Ответ на Re: Pg_dumpall  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
On Fri, Jun 13, 2003 at 02:20:45PM -0600, scott.marlowe wrote:

hi,

> I have the same thing in PHP if someone needs it.  I wrote it originally
> to get around the limits of 7.3's pg_dumpall to hit against our 7.2
> production database, and then got carried away and did the same thing as
> you, made it dump them into seperate files.

i'd be more interested in an schema builder in php, which generates all
CREATE statements from an hash array structure, checks for results,
can cope with schema changes (i.e. field rename or fields added)
and reports problems.

i'm currently using such array structures for my database abstraction
layer, which handles whole objects (instead of relations), allows syncing, ...

$class_desc { CLSID_PERSON } = array
(
    type    => inode,
    table    => 'person',
    properties    => array
    (
    firstname    => array ( type => text, not_null => 1 ),
    lastname    => array ( type => text, not_null => 1 ),
    gender        => array ( type => char ),
    birth        => array ( type => date ),
    death        => array ( type => date )
    score        => array ( type => integer )
    ),
    unique_keys => array
    (
    array ( firstname => 1, lastname => 1 )
    )
);

the generated schema now could look like this:

CREATE TABLE person
(
    "firstname"    text,
    "lastname"    text,
    "gender"    character,
    "birth"    date,
    "death"    date,
    "score"    integer
)
INHERITS ( "_inode" );    -- this comes from type="inode"

CREATE UNIQUE INDEX person_ui0 ON person ( inode_id );
CREATE UNIQUE INDEX person_ui1 ON person ( firstname, lastname );


...

cu
--
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux ITS
 Webhosting ab 5 EUR/Monat.          UUCP, rawIP und vieles mehr.

 phone:     +49 36207 519931         www:       http://www.metux.de/
 fax:       +49 36207 519932         email:     contact@metux.de
 cellphone: +49 174 7066481         smsgate:   sms.weigelt@metux.de
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: viewing the original order of entered records
Следующее
От: Ernest E Vogelsinger
Дата:
Сообщение: Re: Postgres performance comments from a MySQL user