|
12 | 12 | *by PostgreSQL |
13 | 13 | * |
14 | 14 | * IDENTIFICATION |
15 | | - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.354 2003/10/21 04:46:28 tgl Exp $ |
| 15 | + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.355 2003/10/28 21:05:29 tgl Exp $ |
16 | 16 | * |
17 | 17 | *------------------------------------------------------------------------- |
18 | 18 | */ |
@@ -3539,36 +3539,34 @@ dumpProcLangs(Archive *fout, FuncInfo finfo[], int numFuncs) |
3539 | 3539 | lanacl="{=U}"; |
3540 | 3540 | } |
3541 | 3541 |
|
3542 | | -fidx=findFuncByOid(finfo,numFuncs,lanplcallfoid); |
3543 | | -if (fidx<0) |
3544 | | -{ |
3545 | | -write_msg(NULL,"handler procedure for procedural language \"%s\" not found\n", |
3546 | | -lanname); |
3547 | | -exit_nicely(); |
3548 | | -} |
3549 | | - |
3550 | | -if (strcmp(lanvalidator,"0")!=0) |
3551 | | -{ |
3552 | | -vidx=findFuncByOid(finfo,numFuncs,lanvalidator); |
3553 | | -if (vidx<0) |
3554 | | -{ |
3555 | | -write_msg(NULL,"validator procedure for procedural language \"%s\" not found\n", |
3556 | | -lanname); |
3557 | | -exit_nicely(); |
3558 | | -} |
3559 | | -} |
3560 | | - |
3561 | 3542 | /* |
3562 | 3543 | * Current theory is to dump PLs iff their underlying functions |
3563 | 3544 | * will be dumped (are in a dumpable namespace, or have a |
3564 | 3545 | * non-system OID in pre-7.3 databases). Actually, we treat the |
3565 | 3546 | * PL itself as being in the underlying function's namespace, |
3566 | 3547 | * though it isn't really. This avoids searchpath problems for |
3567 | 3548 | * the HANDLER clause. |
| 3549 | + * |
| 3550 | + * If the underlying function is in the pg_catalog namespace, |
| 3551 | + * we won't have loaded it into finfo[] at all; therefore, |
| 3552 | + * treat failure to find it in finfo[] as indicating we shouldn't |
| 3553 | + * dump it, not as an error condition. Ditto for the validator. |
3568 | 3554 | */ |
| 3555 | + |
| 3556 | +fidx=findFuncByOid(finfo,numFuncs,lanplcallfoid); |
| 3557 | +if (fidx<0) |
| 3558 | +continue; |
| 3559 | + |
3569 | 3560 | if (!finfo[fidx].pronamespace->dump) |
3570 | 3561 | continue; |
3571 | 3562 |
|
| 3563 | +if (strcmp(lanvalidator,"0")!=0) |
| 3564 | +{ |
| 3565 | +vidx=findFuncByOid(finfo,numFuncs,lanvalidator); |
| 3566 | +if (vidx<0) |
| 3567 | +continue; |
| 3568 | +} |
| 3569 | + |
3572 | 3570 | resetPQExpBuffer(defqry); |
3573 | 3571 | resetPQExpBuffer(delqry); |
3574 | 3572 |
|
|