pg_restore cleanups

. remove unnecessary oid_string list stuff
. use pg_get_line_buf() instead of open-coding it
. cleaner parsing of map.dat lines

Reverts 2b69afbe50d add new list type simple_oid_string_list to fe-utils/simple_list

Author: Álvaro Herrera <alvherre@kurilemu.de>
Author: Andrew Dunstan <andrew@dunslane.net>

Discussion: https://postgr.es/m/202504141220.343fmoxfsbj4@alvherre.pgsql
This commit is contained in:
Andrew Dunstan
2025-04-16 11:58:44 -04:00
parent 3b35f9a4c5
commit 40b9c27014
4 changed files with 65 additions and 100 deletions

View File

@ -55,19 +55,6 @@ typedef struct SimplePtrList
SimplePtrListCell *tail;
} SimplePtrList;
typedef struct SimpleOidStringListCell
{
struct SimpleOidStringListCell *next;
Oid oid;
char str[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string here */
} SimpleOidStringListCell;
typedef struct SimpleOidStringList
{
SimpleOidStringListCell *head;
SimpleOidStringListCell *tail;
} SimpleOidStringList;
extern void simple_oid_list_append(SimpleOidList *list, Oid val);
extern bool simple_oid_list_member(SimpleOidList *list, Oid val);
extern void simple_oid_list_destroy(SimpleOidList *list);
@ -81,7 +68,4 @@ extern const char *simple_string_list_not_touched(SimpleStringList *list);
extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
extern void simple_ptr_list_destroy(SimplePtrList *list);
extern void simple_oid_string_list_append(SimpleOidStringList *list, Oid oid, const char *str);
extern void simple_oid_string_list_destroy(SimpleOidStringList *list);
#endif /* SIMPLE_LIST_H */