> pairing cert ID from psql query with common name
You can do that like this:
psql -h crt.sh -p 5432 -U guest -d certwatch -q -c "SELECT c.ID, x509_commonName(c.CERTIFICATE) FROM certificate c WHERE to_tsquery('certwatch', 'mydomain:*') @@ identities(c.CERTIFICATE)" -o output.txt
> I would like to only know, can I rely on this psql query? Will it be available?
Access to crt.sh:5432 has been available for several years already and we have no plans to discontinue this service.
Long-running queries tend to be terminated early by the postgres replication system. If you experience this, try repeating the query. I've found that often the first attempt will have primed the cache, meaning that the second attempt will run to completion quickly.