Minor pg_dump buglet
От | gjerde@icebox.org |
---|---|
Тема | Minor pg_dump buglet |
Дата | |
Msg-id | Pine.LNX.4.05.9905081208220.32135-100000@snowman.icebox.org обсуждение исходный текст |
Ответы |
Re: [HACKERS] Minor pg_dump buglet
|
Список | pgsql-hackers |
Hey, Found a little "bug" in pg_dump today. [snip] -- finding the attribute names and types for each table -- finding the attrs and types for table: 'members' -- finding the attrs and types for table: 'currentuser' -- finding DEFAULT expression for attr: 'id' -- finding the attrs and types for table: 'memberaccess' -- finding DEFAULT expression for attr: 'id' -- flagging inherited attributes in subtables -- dumping out user-defined types -- dumping out tables -- dumping out user-defined procedural languages -- dumping out user-defined functions -- dumping out user-defined aggregates -- dumping out user-defined operators -- dumping out the contents of all of 5 tables -- dumping out the contents of Table 'members' -- dumping out the contents of Table 'currentuser' -- dumping out the contents of Table 'memberaccess' | postgres | currentuser | table || postgres | currentuser_id_seq |sequence || postgres | memberaccess | table || postgres | memberaccess_id_seq | sequence || postgres | members | table | As you can see, it says it's dumping out 5 tables, while there is only 3 real tables. I guess it's also counting the 2 sequences as tables(or tuples in this case). This might be right(sequences being tuples), but in this case they should in my opinion not be counted.. Also, in getTables() in pg_dump.c there are at least a couple of these: if (!res || PQresultStatus(res)!= PGRES_COMMAND_OK) { fprintf(stderr, "BEGIN command failed\n"); exit_nicely(g_conn); } Shouldn't this be more like if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "BEGIN command failed(%s)\n", PGresultErrorMessage(res)); exit_nicely(g_conn); } or if (!res) { fprintf(stderr, "BEGIN command failed\n"); exit_nicely(g_conn); } else if(PGresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "BEGIN command failed. ERROR: %s\n",PGresultErrorMessage(res)); exit_nicely(g_conn); } Thanks, Ole Gjerde
В списке pgsql-hackers по дате отправления: