Skip to content

Commit 45a19ef

Browse files
committed
Change numericsep to a boolean, and make it locale-aware.
1 parent 4a8bbbd commit 45a19ef

File tree

5 files changed

+93
-76
lines changed

5 files changed

+93
-76
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.146 2005/07/10 03:46:12 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.147 2005/07/14 08:42:36 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -1496,10 +1496,9 @@ lo_import 152801
14961496
<term><literal>numericsep</literal></term>
14971497
<listitem>
14981498
<para>
1499-
Specifies the character separator between groups of three digits
1500-
to the left of the decimal marker. The default is <literal>''</>
1501-
(none). Setting this to a period also changes the decimal marker
1502-
to a comma.
1499+
Toggles the display of a locale-aware character to separate groups
1500+
of digits to the left of the decimal marker. It also enables
1501+
a locale-aware decimal marker.
15031502
</para>
15041503
</listitem>
15051504
</varlistentry>

src/bin/psql/command.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.148 2005/07/14 06:49:58 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.149 2005/07/14 08:42:37 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "command.h"
@@ -1420,15 +1420,17 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
14201420
: _("Expanded display is off.\n"));
14211421
}
14221422

1423+
/* numeric separators */
14231424
else if (strcmp(param, "numericsep") == 0)
14241425
{
1425-
if (value)
1426+
popt->topt.numericSep = !popt->topt.numericSep;
1427+
if (!quiet)
14261428
{
1427-
free(popt->topt.numericSep);
1428-
popt->topt.numericSep = pg_strdup(value);
1429+
if (popt->topt.numericSep)
1430+
puts(_("Showing numeric separators."));
1431+
else
1432+
puts(_("Numeric separators are off."));
14291433
}
1430-
if (!quiet)
1431-
printf(_("Numeric separator is \"%s\".\n"), popt->topt.numericSep);
14321434
}
14331435

14341436
/* null display */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy