@@ -2879,11 +2879,7 @@ _selectTablespace(ArchiveHandle *AH, const char *tablespace)
2879
2879
/*
2880
2880
* Extract an object description for a TOC entry, and append it to buf.
2881
2881
*
2882
- * This is not quite as general as it may seem, since it really only
2883
- * handles constructing the right thing to put into ALTER ... OWNER TO.
2884
- *
2885
- * The whole thing is pretty grotty, but we are kind of stuck since the
2886
- * information used is all that's available in older dump files.
2882
+ * This is used for ALTER ... OWNER TO.
2887
2883
*/
2888
2884
static void
2889
2885
_getObjectDescription (PQExpBuffer buf , TocEntry * te , ArchiveHandle * AH )
@@ -2895,43 +2891,24 @@ _getObjectDescription(PQExpBuffer buf, TocEntry *te, ArchiveHandle *AH)
2895
2891
strcmp (type , "MATERIALIZED VIEW" ) == 0 )
2896
2892
type = "TABLE" ;
2897
2893
2898
- /* objects named by a schema and name */
2894
+ /* objects that don't require special decoration */
2899
2895
if (strcmp (type , "COLLATION" ) == 0 ||
2900
2896
strcmp (type , "CONVERSION" ) == 0 ||
2901
2897
strcmp (type , "DOMAIN" ) == 0 ||
2902
2898
strcmp (type , "TABLE" ) == 0 ||
2903
2899
strcmp (type , "TYPE" ) == 0 ||
2904
2900
strcmp (type , "FOREIGN TABLE" ) == 0 ||
2905
2901
strcmp (type , "TEXT SEARCH DICTIONARY" ) == 0 ||
2906
- strcmp (type , "TEXT SEARCH CONFIGURATION" ) == 0 )
2907
- {
2908
- appendPQExpBuffer (buf , "%s " , type );
2909
- if (te -> namespace && te -> namespace [0 ]) /* is null pre-7.3 */
2910
- appendPQExpBuffer (buf , "%s." , fmtId (te -> namespace ));
2911
-
2912
- /*
2913
- * Pre-7.3 pg_dump would sometimes (not always) put a fmtId'd name
2914
- * into te->tag for an index. This check is heuristic, so make its
2915
- * scope as narrow as possible.
2916
- */
2917
- if (AH -> version < K_VERS_1_7 &&
2918
- te -> tag [0 ] == '"' &&
2919
- te -> tag [strlen (te -> tag ) - 1 ] == '"' &&
2920
- strcmp (type , "INDEX" ) == 0 )
2921
- appendPQExpBuffer (buf , "%s" , te -> tag );
2922
- else
2923
- appendPQExpBuffer (buf , "%s" , fmtId (te -> tag ));
2924
- return ;
2925
- }
2926
-
2927
- /* objects named by just a name */
2928
- if (strcmp (type , "DATABASE" ) == 0 ||
2902
+ strcmp (type , "TEXT SEARCH CONFIGURATION" ) == 0 ||
2903
+ /* non-schema-specified objects */
2904
+ strcmp (type , "DATABASE" ) == 0 ||
2929
2905
strcmp (type , "PROCEDURAL LANGUAGE" ) == 0 ||
2930
2906
strcmp (type , "SCHEMA" ) == 0 ||
2931
2907
strcmp (type , "FOREIGN DATA WRAPPER" ) == 0 ||
2932
2908
strcmp (type , "SERVER" ) == 0 ||
2933
2909
strcmp (type , "USER MAPPING" ) == 0 )
2934
2910
{
2911
+ /* We already know that search_path was set properly */
2935
2912
appendPQExpBuffer (buf , "%s %s" , type , fmtId (te -> tag ));
2936
2913
return ;
2937
2914
}
0 commit comments