Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
73a7c322
Commit
73a7c322
authored
Jul 10, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add psql \pset numericsep to allow output numbers like 100,000.0 or
100.000,0. Eugen Nedelcu
parent
be3aa30d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
308 additions
and
87 deletions
+308
-87
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/psql-ref.sgml
+13
-1
src/bin/psql/command.c
src/bin/psql/command.c
+12
-2
src/bin/psql/help.c
src/bin/psql/help.c
+2
-2
src/bin/psql/print.c
src/bin/psql/print.c
+279
-81
src/bin/psql/print.h
src/bin/psql/print.h
+2
-1
No files found.
doc/src/sgml/ref/psql-ref.sgml
View file @
73a7c322
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.14
5 2005/06/14 02:57:38
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.14
6 2005/07/10 03:46:12
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -1492,6 +1492,18 @@ lo_import 152801
</listitem>
</varlistentry>
<varlistentry>
<term><literal>numericsep</literal></term>
<listitem>
<para>
Specifies the character separator between groups of three digits
to the left of the decimal marker. The default is <literal>''</>
(none). Setting this to a period also changes the decimal marker
to a comma.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>recordsep</literal></term>
<listitem>
...
...
src/bin/psql/command.c
View file @
73a7c322
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.14
6 2005/06/13 06:36:22 neilc
Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.14
7 2005/07/10 03:46:13 momjian
Exp $
*/
#include "postgres_fe.h"
#include "command.h"
...
...
@@ -838,7 +838,6 @@ exec_command(const char *cmd,
else
if
(
strcmp
(
cmd
,
"x"
)
==
0
)
success
=
do_pset
(
"expanded"
,
NULL
,
&
pset
.
popt
,
quiet
);
/* \z -- list table rights (equivalent to \dp) */
else
if
(
strcmp
(
cmd
,
"z"
)
==
0
)
{
...
...
@@ -1421,6 +1420,17 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
:
_
(
"Expanded display is off.
\n
"
));
}
else
if
(
strcmp
(
param
,
"numericsep"
)
==
0
)
{
if
(
value
)
{
free
(
popt
->
topt
.
numericSep
);
popt
->
topt
.
numericSep
=
pg_strdup
(
value
);
}
if
(
!
quiet
)
printf
(
_
(
"Numeric separator is
\"
%s
\"
.
\n
"
),
popt
->
topt
.
numericSep
);
}
/* null display */
else
if
(
strcmp
(
param
,
"null"
)
==
0
)
{
...
...
src/bin/psql/help.c
View file @
73a7c322
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.10
3 2005/07/06 03:14:48
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.10
4 2005/07/10 03:46:13
momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
...
...
@@ -239,7 +239,7 @@ slashUsage(unsigned short int pager)
fprintf
(
output
,
_
(
"
\\
pset NAME [VALUE]
\n
"
" set table output option
\n
"
" (NAME := {format|border|expanded|fieldsep|footer|null|
\n
"
" recordsep|tuples_only|title|tableattr|pager})
\n
"
));
"
numericsep|
recordsep|tuples_only|title|tableattr|pager})
\n
"
));
fprintf
(
output
,
_
(
"
\\
t show only rows (currently %s)
\n
"
),
ON
(
pset
.
popt
.
topt
.
tuples_only
));
fprintf
(
output
,
_
(
"
\\
T [STRING] set HTML <table> tag attributes, or unset if none
\n
"
));
...
...
src/bin/psql/print.c
View file @
73a7c322
This diff is collapsed.
Click to expand it.
src/bin/psql/print.h
View file @
73a7c322
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.2
5 2005/06/14 02:57:41
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.2
6 2005/07/10 03:46:13
momjian Exp $
*/
#ifndef PRINT_H
#define PRINT_H
...
...
@@ -40,6 +40,7 @@ typedef struct _printTableOpt
char
*
fieldSep
;
/* field separator for unaligned text mode */
char
*
recordSep
;
/* record separator for unaligned text
* mode */
char
*
numericSep
;
/* numeric units separator */
char
*
tableAttr
;
/* attributes for HTML <table ...> */
int
encoding
;
/* character encoding */
bool
normal_query
;
/* are we presenting the results of a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment