@@ -2709,7 +2709,8 @@ exec_command_pset(PsqlScanState scan_state, bool active_branch)
27092709
27102710int i ;
27112711static const char * const my_list []= {
2712- "border" ,"columns" ,"csv_fieldsep" ,"expanded" ,"fieldsep" ,
2712+ "border" ,"columns" ,"csv_fieldsep" ,
2713+ "display_false" ,"display_true" ,"expanded" ,"fieldsep" ,
27132714"fieldsep_zero" ,"footer" ,"format" ,"linestyle" ,"null" ,
27142715"numericlocale" ,"pager" ,"pager_min_lines" ,
27152716"recordsep" ,"recordsep_zero" ,
@@ -5300,6 +5301,26 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
53005301}
53015302}
53025303
5304+ /* 'false' display */
5305+ else if (strcmp (param ,"display_false" )== 0 )
5306+ {
5307+ if (value )
5308+ {
5309+ free (popt -> falsePrint );
5310+ popt -> falsePrint = pg_strdup (value );
5311+ }
5312+ }
5313+
5314+ /* 'true' display */
5315+ else if (strcmp (param ,"display_true" )== 0 )
5316+ {
5317+ if (value )
5318+ {
5319+ free (popt -> truePrint );
5320+ popt -> truePrint = pg_strdup (value );
5321+ }
5322+ }
5323+
53035324/* field separator for unaligned text */
53045325else if (strcmp (param ,"fieldsep" )== 0 )
53055326{
@@ -5474,6 +5495,20 @@ printPsetInfo(const char *param, printQueryOpt *popt)
54745495popt -> topt .csvFieldSep );
54755496}
54765497
5498+ /* show boolean 'false' display */
5499+ else if (strcmp (param ,"display_false" )== 0 )
5500+ {
5501+ printf (_ ("Boolean false display is \"%s\".\n" ),
5502+ popt -> falsePrint ?popt -> falsePrint :"f" );
5503+ }
5504+
5505+ /* show boolean 'true' display */
5506+ else if (strcmp (param ,"display_true" )== 0 )
5507+ {
5508+ printf (_ ("Boolean true display is \"%s\".\n" ),
5509+ popt -> truePrint ?popt -> truePrint :"t" );
5510+ }
5511+
54775512/* show field separator for unaligned text */
54785513else if (strcmp (param ,"fieldsep" )== 0 )
54795514{
@@ -5743,6 +5778,10 @@ pset_value_string(const char *param, printQueryOpt *popt)
57435778return psprintf ("%d" ,popt -> topt .columns );
57445779else if (strcmp (param ,"csv_fieldsep" )== 0 )
57455780return pset_quoted_string (popt -> topt .csvFieldSep );
5781+ else if (strcmp (param ,"display_false" )== 0 )
5782+ return pset_quoted_string (popt -> falsePrint ?popt -> falsePrint :"f" );
5783+ else if (strcmp (param ,"display_true" )== 0 )
5784+ return pset_quoted_string (popt -> truePrint ?popt -> truePrint :"t" );
57465785else if (strcmp (param ,"expanded" )== 0 )
57475786return pstrdup (popt -> topt .expanded == 2
57485787 ?"auto"