-
Notifications
You must be signed in to change notification settings - Fork 24
/
pgcharts.1
175 lines (173 loc) · 5.14 KB
/
pgcharts.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "PGCHARTS" "1" "June 2015" "ff" ""
.
.SH "NAME"
\fBpgcharts\fR \- PostgreSQL data loader
.
.SH "SYNOPSIS"
\fBpgcharts\fR [\fIoptions\fR] [\fIcommand\-file\fR]\.\.\.
.
.SH "DESCRIPTION"
pgcharts is The PostgreSQL Extension Installer server\.
.
.SH "OPTIONS"
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Show command usage summary and exit\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Show pgcharts version string and exit\.
.
.TP
\fB\-c\fR, \fB\-\-config\fR
Use the given configuration file (default to "~/\.pgcharts\.ini")\.
.
.SH "COMMANDS"
The pgcharts binary allows running and controling the pgcharts embedded web server\.
.
.SS "CONFIGURATION CONTROL"
While it\'s possible to ship a configuration file or to prepare it by hand, the following commands allow to control the setup from the command line\.
.
.IP "\(bu" 4
\fBconfig [ name ] [ value ]\fR
.
.IP
Without arguments, print the whole configuration file content\. When given a variable \fIname\fR, print its current value\. When given both a \fIname\fR and a \fIvalue\fR, set the configuration variable to the given value\.
.
.IP "\(bu" 4
\fBconfig get <name>\fR
.
.IP
Print the current value of the configuration variable \fIname\fR\.
.
.IP "\(bu" 4
\fBconfig set <name> <value>\fR
.
.IP
Set the variable \fIname\fR to the given \fIvalue\fR\.
.
.IP "" 0
.
.SS "SERVER CONTROL"
The PostgreSQL Extension Installer comes with a PostgreSQL plugin that downloads static files: that part doesn\'t need any server at all\. This server is meant to be used by maintainers of a set of extension archives, when they want to ease the maintenance and setup of the building\.
.
.IP "\(bu" 4
\fBstart\fR
.
.IP
Start the embedded pgcharts HTTP server on the port it\'s been setup to listen to, which defaults to 8042\. The
.
.IP "\(bu" 4
\fBstop\fR
.
.IP
Stops the server\.
.
.IP "\(bu" 4
\fBstatus\fR
.
.IP
Print the result of querying the HTTP status API against the (hopefully) running server\.
.
.IP "\(bu" 4
\fBpid\fR
.
.IP
Print the registered pid of the server process\. This information might be stale in case of unexpected termination of the server\.
.
.IP "\(bu" 4
\fBsetup <dburi>\fR
.
.IP
Connects to the PostgreSQL database specified with the \fIdburi\fR parameter and install the database model there\.
.
.IP "" 0
.
.SS "REGISTERING DATABASES"
Once pgcharts is properly setup (see the \fBsetup\fR command above) then it\'s necessary to add databases against which you want to run queries and draw charts\.
.
.IP "\(bu" 4
\fBregister <dburi>\fR
.
.IP
Register given \fIdburi\fR\.
.
.IP "" 0
.
.SH "DATABASE URI"
The \fIdburi\fR connection string is expected to be given as a \fIConnection URI\fR as documented in the PostgreSQL documentation at http://www\.postgresql\.org/docs/9\.3/static/libpq\-connect\.html#LIBPQ\-CONNSTRING\.
.
.IP "" 4
.
.nf
postgresql://[user[:password]@][netloc][:port][/dbname][?sslmode=\.\.\.]
.
.fi
.
.IP "" 0
.
.P
Where:
.
.IP "\(bu" 4
\fIuser\fR
.
.IP
Can contain any character, including colon (\fB:\fR) which must then be doubled (\fB::\fR) and at\-sign (\fB@\fR) which must then be doubled (\fB@@\fR)\.
.
.IP
When omitted, the \fIuser\fR name defaults to the value of the \fBPGUSER\fR environment variable, and if it is unset, the value of the \fBUSER\fR environment variable\.
.
.IP "\(bu" 4
\fIpassword\fR
.
.IP
Can contain any character, including that at sign (\fB@\fR) which must then be doubled (\fB@@\fR)\. To leave the password empty, when the \fIuser\fR name ends with at at sign, you then have to use the syntax user:@\.
.
.IP
When omitted, the \fIpassword\fR defaults to the value of the \fBPGPASSWORD\fR environment variable if it is set, otherwise the password is left unset\.
.
.IP "\(bu" 4
\fInetloc\fR
.
.IP
Can be either a hostname in dotted notation, or an ipv4, or an Unix domain socket path\. Empty is the default network location, under a system providing \fIunix domain socket\fR that method is preferred, otherwise the \fInetloc\fR default to \fBlocalhost\fR\.
.
.IP
It\'s possible to force the \fIunix domain socket\fR path by using the syntax \fBunix:/path/to/where/the/socket/file/is\fR, so to force a non default socket path and a non default port, you would have:
.
.IP "" 4
.
.nf
postgresql://unix:/tmp:54321/dbname
.
.fi
.
.IP "" 0
.
.IP
The \fInetloc\fR defaults to the value of the \fBPGHOST\fR environment variable, and if it is unset, to either the default \fBunix\fR socket path when running on a Unix system, and \fBlocalhost\fR otherwise\.
.
.IP "\(bu" 4
\fIdbname\fR
.
.IP
Should be a proper identifier (letter followed by a mix of letters, digits and the punctuation signs comma (\fB,\fR), dash (\fB\-\fR) and underscore (\fB_\fR)\.
.
.IP
When omitted, the \fIdbname\fR defaults to the value of the environment variable \fBPGDATABASE\fR, and if that is unset, to the \fIuser\fR value as determined above\.
.
.IP "\(bu" 4
The only optional parameter supported is \fBsslmode\fR and it accepts the values \fBdisable\fR, \fBallow\fR, \fBprefer\fR and \fBrequire\fR\.
.
.IP "" 0
.
.SH "AUTHOR"
Dimitri Fontaine \fIdimitri@2ndQuadrant\.fr\fR
.
.SH "SEE ALSO"
The pgcharts source code and all documentation may be downloaded from \fIhttps://github\.com/dimitri/pgcharts/\fR\.