$ psql -l | grep freshports freshports.old | dan | SQL_ASCII | C | C | freshports.org | dan | SQL_ASCII | C | C |
But it doesn’t work:
$ /usr/local/libexec/nagios/check_pgsql -H slocum -l www -d freshports.org check_pgsql: Database name is not valid - freshports.org Usage: check_pgsql [-H
] [-P ] [-c ] [-w ] [-t ] [-d ] [-l ] [-p ]
Hmm, what’s up with that. Looking at the source code, I found this comment:
Valid PostgreSQL database names are less than &NAMEDATALEN;
characters long and consist of letters, numbers, and underscores. The
first character cannot be a number, however.
This seems to be true for most identifiers (a database name is an identifier). But you can also use quoted identifiers, such as “freshports.org”. To quote: “Quoted identifiers can contain any character, except the character with code zero.
In the meantime, I’ve created another database and I’m testing that one can connect.