|
22 | 22 | * |
23 | 23 | * |
24 | 24 | * IDENTIFICATION |
25 | | - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.228 2001/09/06 02:07:42 tgl Exp $ |
| 25 | + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.229 2001/09/07 01:11:50 tgl Exp $ |
26 | 26 | * |
27 | 27 | *------------------------------------------------------------------------- |
28 | 28 | */ |
@@ -726,7 +726,7 @@ main(int argc, char **argv) |
726 | 726 | else |
727 | 727 | progname=strrchr(argv[0],'/')+1; |
728 | 728 |
|
729 | | -/* Setdefaulty options based on progname */ |
| 729 | +/* Setdefault options based on progname */ |
730 | 730 | if (strcmp(progname,"pg_backup")==0) |
731 | 731 | { |
732 | 732 | format="c"; |
@@ -1449,8 +1449,6 @@ getTypes(int *numTypes) |
1449 | 1449 | * OprInfo* structure |
1450 | 1450 | * |
1451 | 1451 | *numOprs is set to the number of operators read in |
1452 | | - * |
1453 | | - * |
1454 | 1452 | */ |
1455 | 1453 | OprInfo* |
1456 | 1454 | getOperators(int*numOprs) |
@@ -1821,8 +1819,6 @@ clearAggInfo(AggInfo *agginfo, int numArgs) |
1821 | 1819 | * return them in the AggInfo* structure |
1822 | 1820 | * |
1823 | 1821 | * numAggs is set to the number of aggregates read in |
1824 | | - * |
1825 | | - * |
1826 | 1822 | */ |
1827 | 1823 | AggInfo* |
1828 | 1824 | getAggregates(int*numAggs) |
@@ -2040,8 +2036,6 @@ getFuncs(int *numFuncs) |
2040 | 2036 | * in the system catalogs return them in the TableInfo* structure |
2041 | 2037 | * |
2042 | 2038 | * numTables is set to the number of tables read in |
2043 | | - * |
2044 | | - * |
2045 | 2039 | */ |
2046 | 2040 | TableInfo* |
2047 | 2041 | getTables(int*numTables,FuncInfo*finfo,intnumFuncs) |
@@ -2297,7 +2291,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) |
2297 | 2291 |
|
2298 | 2292 | resetPQExpBuffer(query); |
2299 | 2293 | appendPQExpBuffer(query, |
2300 | | -"SELECT indexrelid FROM pg_index i WHERE i.indisprimary AND i.indrelid =%s ", |
| 2294 | +"SELECT indexrelid FROM pg_index i WHERE i.indisprimary AND i.indrelid ='%s'::oid ", |
2301 | 2295 | tblinfo[i].oid); |
2302 | 2296 | res2=PQexec(g_conn,query->data); |
2303 | 2297 | if (!res2||PQresultStatus(res2)!=PGRES_TUPLES_OK) |
@@ -2335,7 +2329,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) |
2335 | 2329 | resetPQExpBuffer(query); |
2336 | 2330 | appendPQExpBuffer(query, |
2337 | 2331 | "SELECT relname FROM pg_class " |
2338 | | -"WHERE oid =%s", |
| 2332 | +"WHERE oid ='%s'::oid", |
2339 | 2333 | tblinfo[i].pkIndexOid); |
2340 | 2334 |
|
2341 | 2335 | res2=PQexec(g_conn,query->data); |
@@ -2656,8 +2650,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) |
2656 | 2650 | * from the system catalogs return them in the InhInfo* structure |
2657 | 2651 | * |
2658 | 2652 | * numInherits is set to the number of tables read in |
2659 | | - * |
2660 | | - * |
2661 | 2653 | */ |
2662 | 2654 | InhInfo* |
2663 | 2655 | getInherits(int*numInherits) |
@@ -3013,15 +3005,15 @@ dumpComment(Archive *fout, const char *target, const char *oid, |
3013 | 3005 | if (fout->remoteVersion >=70200) |
3014 | 3006 | { |
3015 | 3007 | appendPQExpBuffer(query,"SELECT description FROM pg_description " |
3016 | | -"WHERE objoid =%s and classoid = " |
| 3008 | +"WHERE objoid ='%s'::oid and classoid = " |
3017 | 3009 | "(SELECT oid FROM pg_class where relname = '%s') " |
3018 | 3010 | "and objsubid = %d", |
3019 | 3011 | oid,classname,subid); |
3020 | 3012 | } |
3021 | 3013 | else |
3022 | 3014 | { |
3023 | 3015 | /* Note: this will fail to find attribute comments in pre-7.2... */ |
3024 | | -appendPQExpBuffer(query,"SELECT description FROM pg_description WHERE objoid =%s",oid); |
| 3016 | +appendPQExpBuffer(query,"SELECT description FROM pg_description WHERE objoid ='%s'::oid",oid); |
3025 | 3017 | } |
3026 | 3018 |
|
3027 | 3019 | /*** Execute query ***/ |
@@ -3396,7 +3388,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i, |
3396 | 3388 |
|
3397 | 3389 | /* becomeUser(fout, finfo[i].usename); */ |
3398 | 3390 |
|
3399 | | -sprintf(query,"SELECT lanname FROM pg_language WHERE oid =%u", |
| 3391 | +sprintf(query,"SELECT lanname FROM pg_language WHERE oid ='%u'::oid", |
3400 | 3392 | finfo[i].lang); |
3401 | 3393 | res=PQexec(g_conn,query); |
3402 | 3394 | if (!res|| |
@@ -4556,7 +4548,7 @@ dumpIndexes(Archive *fout, IndInfo *indinfo, int numIndexes, |
4556 | 4548 | intnumRows; |
4557 | 4549 | PQExpBufferpred=createPQExpBuffer(); |
4558 | 4550 |
|
4559 | | -appendPQExpBuffer(pred,"SELECT pg_get_expr(indpred,indrelid) as pred FROM pg_index WHERE indexrelid =%s", |
| 4551 | +appendPQExpBuffer(pred,"SELECT pg_get_expr(indpred,indrelid) as pred FROM pg_index WHERE indexrelid ='%s'::oid", |
4560 | 4552 | indinfo[i].indexreloid); |
4561 | 4553 | res=PQexec(g_conn,pred->data); |
4562 | 4554 | if (!res||PQresultStatus(res)!=PGRES_TUPLES_OK) |
|