PGCHARTS(1)
π PGCHARTS β like, the PostgreSQL data loader, bestie π
okay so you found the manual for pgcharts β that's the section 1 (general commands) page, the one you get from man 1 pgcharts. Grab a boba, we're doing this. π§β¨
β¨ NAME β¨
pgcharts β the PostgreSQL data loader. That's the whole job description. Iconic. π«Ά
πΈ SYNOPSIS πΈ
pgcharts [options] [command-file]...
π¦ DESCRIPTION π¦
pgcharts is The PostgreSQL Extension Installer server. Periodt. That's literally the description and we're not gonna pretend it's more than that. π
π OPTIONS π
-h,--helpβ shows you the command usage summary and then dips out. βοΈ-V,--versionβ prints thepgchartsversion string and exits. no cap.-c,--configβ use the configuration file you point at here (it defaults to"~/.pgcharts.ini"). π
π COMMANDS π
The pgcharts binary is what lets you run and control the embedded pgcharts web server. Two moods, one binary. main character energy fr fr. β¨
βοΈ CONFIGURATION CONTROL βοΈ
So like, you can ship a configuration file, or hand-write one yourself β totally valid. But these commands let you control the whole setup straight from the command line instead, which is lowkey so much nicer. π
config [ name ] [ value ]With no arguments at all, it prints the entire configuration file content. Give it just a variable name and it prints that variable's current value. Give it both a name and a value and it sets the configuration variable to the value you gave it. β¨config get <name>Prints the current value of the configuration variable name.config set <name> <value>Sets the variable name to the given value.
π₯οΈ SERVER CONTROL π₯οΈ
Heads up bestie β The PostgreSQL Extension Installer comes with a PostgreSQL plugin that downloads static files, and that part doesn't need any server at all. π So what's this server for then?? It's meant to be used by maintainers of a set of extension archives, when they want to make the maintenance and setup of the building easier. iykyk.
startStarts the embeddedpgchartsHTTP server on the port it's been setup to listen to, which defaults to8042. The
π okay so that sentence justβ¦ ends. "The" and then nothing. We're keeping it exactly as written because I do not make the rules. Iconic of it honestly.
stopStops the server. Simple. Slay. βstatusPrints the result of querying the HTTP status API against the (hopefully π) running server.pidPrints the registered pid of the server process. β οΈ careful though β this info might be stale if the server terminated unexpectedly. It's giving "trust but verify".setup <dburi>Connects to the PostgreSQL database you specify with the dburi parameter, and installs the database model there. ποΈ
ποΈ REGISTERING DATABASES ποΈ
Once pgcharts is properly setup (see the setup command up there β¬οΈ), you still gotta add the databases you want to run queries against and draw charts from. That's this part. π
register <dburi>Registers the given dburi. That's it, that's the whole thing. π
π DATABASE URI π
The dburi connection string is expected to be given as a Connection URI, exactly as documented in the PostgreSQL documentation over at http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNSTRING.
postgresql://[user[:password]@][netloc][:port][/dbname][?sslmode=...]
Where:
userCan contain any character, including a colon (:) which then must be doubled (::), and an at-sign (@) which then must be doubled (@@). π«
When it's omitted, the user name defaults to the value of the PGUSER environment variable, and if that is unset, it falls back to the value of the USER environment variable.
passwordCan contain any character, including that at-sign (@) which then must be doubled (@@). To leave the password empty, when the user name ends with an at-sign you then have to use the syntaxuser:@. βοΈ
When omitted, the password defaults to the value of the PGPASSWORD environment variable if it's set β otherwise the password is just left unset.
netlocCan be either a hostname in dotted notation, or an ipv4, or a Unix domain socket path. Empty is the default network location, and on a system that provides unix domain socket, that method is preferred β otherwise the netloc defaults tolocalhost.
It's possible to force the unix domain socket path by using the syntax unix:/path/to/where/the/socket/file/is, so to force a non default socket path and a non default port, you'd have:
postgresql://unix:/tmp:54321/dbname
The netloc defaults to the value of the PGHOST environment variable, and if it's unset, it goes to either the default unix socket path when running on a Unix system, or localhost otherwise. π
dbnameShould be a proper identifier β a letter followed by a mix of letters, digits, and the punctuation signs comma (,), dash (-) and underscore (_). π
When omitted, the dbname defaults to the value of the environment variable PGDATABASE, and if that's unset, it defaults to the user value as determined above.
- The only optional parameter supported is
sslmode, and it accepts the valuesdisable,allow,preferandrequire. π (that's the whole list, don't try to sneak anything else in there)
π AUTHOR π
Dimitri Fontaine β dimitri@2ndQuadrant.fr π
π₯ SEE ALSO π₯
The pgcharts source code and all documentation may be downloaded from https://github.com/dimitri/pgcharts/. Go get it, bestie. πβ
and that's the whole page, mwah π β this one was put together by ff, dated June 2015. ty for coming to my ted talk, now go draw some charts πβ¨π
π¦ where this page comes from
- ubuntu jammy: pgcharts 1.0+2017-09-16-1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms