@@ -224,7 +224,7 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
224
224
PQExpBufferData buf ;
225
225
PGresult * res ;
226
226
printQueryOpt myopt = pset .popt ;
227
- static const bool translate_columns [] = {false, false, false, false, true, true, false, false, false, false};
227
+ static const bool translate_columns [] = {false, false, false, false, true, true, true, false, false, false, false};
228
228
229
229
if (strlen (functypes ) != strspn (functypes , "antwS+" ))
230
230
{
@@ -457,6 +457,7 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
457
457
myopt .title = _ ("List of functions" );
458
458
myopt .translate_header = true;
459
459
myopt .translate_columns = translate_columns ;
460
+ myopt .n_translate_columns = lengthof (translate_columns );
460
461
461
462
printQuery (res , & myopt , pset .queryFout , pset .logfile );
462
463
@@ -789,6 +790,7 @@ permissionsList(const char *pattern)
789
790
myopt .title = buf .data ;
790
791
myopt .translate_header = true;
791
792
myopt .translate_columns = translate_columns ;
793
+ myopt .n_translate_columns = lengthof (translate_columns );
792
794
793
795
printQuery (res , & myopt , pset .queryFout , pset .logfile );
794
796
@@ -862,6 +864,7 @@ listDefaultACLs(const char *pattern)
862
864
myopt .title = buf .data ;
863
865
myopt .translate_header = true;
864
866
myopt .translate_columns = translate_columns ;
867
+ myopt .n_translate_columns = lengthof (translate_columns );
865
868
866
869
printQuery (res , & myopt , pset .queryFout , pset .logfile );
867
870
@@ -1034,6 +1037,7 @@ objectDescription(const char *pattern, bool showSystem)
1034
1037
myopt .title = _ ("Object descriptions" );
1035
1038
myopt .translate_header = true;
1036
1039
myopt .translate_columns = translate_columns ;
1040
+ myopt .n_translate_columns = lengthof (translate_columns );
1037
1041
1038
1042
printQuery (res , & myopt , pset .queryFout , pset .logfile );
1039
1043
@@ -2818,6 +2822,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
2818
2822
myopt .title = _ ("List of relations" );
2819
2823
myopt .translate_header = true;
2820
2824
myopt .translate_columns = translate_columns ;
2825
+ myopt .n_translate_columns = lengthof (translate_columns );
2821
2826
2822
2827
printQuery (res , & myopt , pset .queryFout , pset .logfile );
2823
2828
}
@@ -2999,7 +3004,8 @@ listConversions(const char *pattern, bool verbose, bool showSystem)
2999
3004
PQExpBufferData buf ;
3000
3005
PGresult * res ;
3001
3006
printQueryOpt myopt = pset .popt ;
3002
- static const bool translate_columns [] = {false, false, false, false, true};
3007
+ static const bool translate_columns [] =
3008
+ {false, false, false, false, true, false};
3003
3009
3004
3010
initPQExpBuffer (& buf );
3005
3011
@@ -3055,6 +3061,7 @@ listConversions(const char *pattern, bool verbose, bool showSystem)
3055
3061
myopt .title = _ ("List of conversions" );
3056
3062
myopt .translate_header = true;
3057
3063
myopt .translate_columns = translate_columns ;
3064
+ myopt .n_translate_columns = lengthof (translate_columns );
3058
3065
3059
3066
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3060
3067
@@ -3079,19 +3086,23 @@ listEventTriggers(const char *pattern, bool verbose)
3079
3086
initPQExpBuffer (& buf );
3080
3087
3081
3088
printfPQExpBuffer (& buf ,
3082
- "select evtname as \"%s\", "
3083
- "evtevent as \"%s\", "
3084
- "pg_catalog.pg_get_userbyid(e.evtowner) AS \"%s\", "
3085
- "case evtenabled when 'O' then 'enabled' "
3086
- " when 'R' then 'replica' "
3087
- " when 'A' then 'always' "
3088
- " when 'D' then 'disabled ' end as \"%s\", "
3089
- "e.evtfoid::regproc as \"%s\", "
3090
- "array_to_string(array(select x "
3091
- " from unnest(evttags) as t(x)), ', ') as \"%s\" " ,
3089
+ "SELECT evtname as \"%s\", "
3090
+ "evtevent as \"%s\", "
3091
+ "pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n "
3092
+ " case evtenabled when 'O' then '%s' "
3093
+ " when 'R' then '%s' "
3094
+ " when 'A' then '%s' "
3095
+ " when 'D' then '%s ' end as \"%s\",\n "
3096
+ " e.evtfoid::pg_catalog. regproc as \"%s\", "
3097
+ "pg_catalog. array_to_string(array(select x"
3098
+ " from pg_catalog. unnest(evttags) as t(x)), ', ') as \"%s\"" ,
3092
3099
gettext_noop ("Name" ),
3093
3100
gettext_noop ("Event" ),
3094
3101
gettext_noop ("Owner" ),
3102
+ gettext_noop ("enabled" ),
3103
+ gettext_noop ("replica" ),
3104
+ gettext_noop ("always" ),
3105
+ gettext_noop ("disabled" ),
3095
3106
gettext_noop ("Enabled" ),
3096
3107
gettext_noop ("Procedure" ),
3097
3108
gettext_noop ("Tags" ));
@@ -3100,7 +3111,7 @@ listEventTriggers(const char *pattern, bool verbose)
3100
3111
",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"" ,
3101
3112
gettext_noop ("Description" ));
3102
3113
appendPQExpBufferStr (& buf ,
3103
- "\nFROM pg_event_trigger e " );
3114
+ "\nFROM pg_catalog. pg_event_trigger e " );
3104
3115
3105
3116
processSQLNamePattern (pset .db , & buf , pattern , false, false,
3106
3117
NULL , "evtname" , NULL , NULL );
@@ -3116,6 +3127,7 @@ listEventTriggers(const char *pattern, bool verbose)
3116
3127
myopt .title = _ ("List of event triggers" );
3117
3128
myopt .translate_header = true;
3118
3129
myopt .translate_columns = translate_columns ;
3130
+ myopt .n_translate_columns = lengthof (translate_columns );
3119
3131
3120
3132
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3121
3133
@@ -3134,7 +3146,7 @@ listCasts(const char *pattern, bool verbose)
3134
3146
PQExpBufferData buf ;
3135
3147
PGresult * res ;
3136
3148
printQueryOpt myopt = pset .popt ;
3137
- static const bool translate_columns [] = {false, false, false, true};
3149
+ static const bool translate_columns [] = {false, false, false, true, false };
3138
3150
3139
3151
initPQExpBuffer (& buf );
3140
3152
@@ -3214,6 +3226,7 @@ listCasts(const char *pattern, bool verbose)
3214
3226
myopt .title = _ ("List of casts" );
3215
3227
myopt .translate_header = true;
3216
3228
myopt .translate_columns = translate_columns ;
3229
+ myopt .n_translate_columns = lengthof (translate_columns );
3217
3230
3218
3231
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3219
3232
@@ -3289,6 +3302,7 @@ listCollations(const char *pattern, bool verbose, bool showSystem)
3289
3302
myopt .title = _ ("List of collations" );
3290
3303
myopt .translate_header = true;
3291
3304
myopt .translate_columns = translate_columns ;
3305
+ myopt .n_translate_columns = lengthof (translate_columns );
3292
3306
3293
3307
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3294
3308
@@ -3548,6 +3562,7 @@ describeOneTSParser(const char *oid, const char *nspname, const char *prsname)
3548
3562
myopt .topt .default_footer = false;
3549
3563
myopt .translate_header = true;
3550
3564
myopt .translate_columns = translate_columns ;
3565
+ myopt .n_translate_columns = lengthof (translate_columns );
3551
3566
3552
3567
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3553
3568
@@ -3579,6 +3594,7 @@ describeOneTSParser(const char *oid, const char *nspname, const char *prsname)
3579
3594
myopt .topt .default_footer = true;
3580
3595
myopt .translate_header = true;
3581
3596
myopt .translate_columns = NULL ;
3597
+ myopt .n_translate_columns = 0 ;
3582
3598
3583
3599
printQuery (res , & myopt , pset .queryFout , pset .logfile );
3584
3600
0 commit comments