Обсуждение: pg_dump and schemas

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

pg_dump and schemas

От
ow
Дата:
pgSql 7.4.0

Hi,

Suppose, there are two (2) schemas in the database: schemaA and schemaB.
schemaA is relatively small and updated all the time, schemaB is huge and
updated occasionally, maybe several times a day. The whole database, with
schemaA and schemaB, is dumped once a week, say Sunday, and schemaA is also
dumped every night. The whole db cannot be backed up every night due to lack of
time.

Say, on Thursday, it was determined that db is corrupt and we need to restore
it from backups. We'll take Sunday's dump of the whole database and then try to
apply Wednesday's dump of schemaA to it. I guess we'll also need Wednesday's
pg_catalog schema dump?

I wonder if the above approach will lead to problems since the state of schemaB
is from Sunday but schemaA and, most importantly, pg_catalog schema, is from
Wednesday. schemaB may have been updated between Sunday and Wednesday.

Any ideas? Thanks






__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Sending a libpq C function variables through function call

От
Kris Kiger
Дата:
Hi all,

    I've got a function in PG set up, the libpq C call goes like this:

    PERFORM funcName(''t1'', ''t2'', ''t3'', ''t4'', NEW.someInteger,
NEW.someBoolean)

    funcName looks like this:

    create function funcName(text, text, text, text, int, boolean)
returns int as '/var/lib/postgres/CfileName.so', 'CfunctionName'
language 'C';

    the C function header accepts each of these arguments as
CfunctionName(char* name1, char* name2, char* name3, char* name4, int
variable1, bool variable2).  When I try to grab a value, say from name1,
I get nothing.  So, for some reason parameters are not being passed.
 I'm not sure if there is a good way to pass parameters through libpq,
or will I have to use something like SPI to grab them?  Use of libpq is
preferable, but not absolute.  I appreciate the input!

Kris


Re: Sending a libpq C function variables through function

От
Peter Eisentraut
Дата:
Kris Kiger writes:

>  I'm not sure if there is a good way to pass parameters through libpq,
> or will I have to use something like SPI to grab them?  Use of libpq is
> preferable, but not absolute.  I appreciate the input!

There is no choice: libpq connects to a remote database as a client; SPI
performs database actions from within a server-side function.

--
Peter Eisentraut   peter_e@gmx.net