@@ -307,21 +307,9 @@ do { \
307
307
output_failed = true, output_errno = errno; \
308
308
} while (0)
309
309
310
- #define PG_CMD_PRINTF1 (fmt , arg1 ) \
310
+ #define PG_CMD_PRINTF (fmt , ... ) \
311
311
do { \
312
- if (fprintf(cmdfd, fmt, arg1) < 0 || fflush(cmdfd) < 0) \
313
- output_failed = true, output_errno = errno; \
314
- } while (0)
315
-
316
- #define PG_CMD_PRINTF2 (fmt , arg1 , arg2 ) \
317
- do { \
318
- if (fprintf(cmdfd, fmt, arg1, arg2) < 0 || fflush(cmdfd) < 0) \
319
- output_failed = true, output_errno = errno; \
320
- } while (0)
321
-
322
- #define PG_CMD_PRINTF3 (fmt , arg1 , arg2 , arg3 ) \
323
- do { \
324
- if (fprintf(cmdfd, fmt, arg1, arg2, arg3) < 0 || fflush(cmdfd) < 0) \
312
+ if (fprintf(cmdfd, fmt, __VA_ARGS__) < 0 || fflush(cmdfd) < 0) \
325
313
output_failed = true, output_errno = errno; \
326
314
} while (0)
327
315
@@ -1490,7 +1478,7 @@ setup_auth(FILE *cmdfd)
1490
1478
PG_CMD_PUTS (* line );
1491
1479
1492
1480
if (superuser_password )
1493
- PG_CMD_PRINTF2 ("ALTER USER \"%s\" WITH PASSWORD E'%s';\n\n" ,
1481
+ PG_CMD_PRINTF ("ALTER USER \"%s\" WITH PASSWORD E'%s';\n\n" ,
1494
1482
username , escape_quotes (superuser_password ));
1495
1483
}
1496
1484
@@ -1684,7 +1672,7 @@ setup_description(FILE *cmdfd)
1684
1672
" objsubid int4, "
1685
1673
" description text);\n\n" );
1686
1674
1687
- PG_CMD_PRINTF1 ("COPY tmp_pg_description FROM E'%s';\n\n" ,
1675
+ PG_CMD_PRINTF ("COPY tmp_pg_description FROM E'%s';\n\n" ,
1688
1676
escape_quotes (desc_file ));
1689
1677
1690
1678
PG_CMD_PUTS ("INSERT INTO pg_description "
@@ -1697,7 +1685,7 @@ setup_description(FILE *cmdfd)
1697
1685
" classname name, "
1698
1686
" description text);\n\n" );
1699
1687
1700
- PG_CMD_PRINTF1 ("COPY tmp_pg_shdescription FROM E'%s';\n\n" ,
1688
+ PG_CMD_PRINTF ("COPY tmp_pg_shdescription FROM E'%s';\n\n" ,
1701
1689
escape_quotes (shdesc_file ));
1702
1690
1703
1691
PG_CMD_PUTS ("INSERT INTO pg_shdescription "
@@ -1738,7 +1726,7 @@ setup_collation(FILE *cmdfd)
1738
1726
* in pg_collation.h. But add it before reading system collations, so
1739
1727
* that it wins if libc defines a locale named ucs_basic.
1740
1728
*/
1741
- PG_CMD_PRINTF3 ("INSERT INTO pg_collation (oid, collname, collnamespace, collowner, collprovider, collisdeterministic, collencoding, collcollate, collctype)"
1729
+ PG_CMD_PRINTF ("INSERT INTO pg_collation (oid, collname, collnamespace, collowner, collprovider, collisdeterministic, collencoding, collcollate, collctype)"
1742
1730
"VALUES (pg_nextoid('pg_catalog.pg_collation', 'oid', 'pg_catalog.pg_collation_oid_index'), 'ucs_basic', 'pg_catalog'::regnamespace, %u, '%c', true, %d, 'C', 'C');\n\n" ,
1743
1731
BOOTSTRAP_SUPERUSERID , COLLPROVIDER_LIBC , PG_UTF8 );
1744
1732
@@ -1982,12 +1970,12 @@ setup_schema(FILE *cmdfd)
1982
1970
1983
1971
free (lines );
1984
1972
1985
- PG_CMD_PRINTF1 ("UPDATE information_schema.sql_implementation_info "
1973
+ PG_CMD_PRINTF ("UPDATE information_schema.sql_implementation_info "
1986
1974
" SET character_value = '%s' "
1987
1975
" WHERE implementation_info_name = 'DBMS VERSION';\n\n" ,
1988
1976
infoversion );
1989
1977
1990
- PG_CMD_PRINTF1 ("COPY information_schema.sql_features "
1978
+ PG_CMD_PRINTF ("COPY information_schema.sql_features "
1991
1979
" (feature_id, feature_name, sub_feature_id, "
1992
1980
" sub_feature_name, is_supported, comments) "
1993
1981
" FROM E'%s';\n\n" ,
0 commit comments