######octothorp.es

#logging

  • Enable CSV Logging in PostgreSQL

    https://justatheory.com/2009/08/enable-postgres-csvlogging/

    One of the cooler features of recent versions of PostgreSQL is support for CSV-formatted logging. I’ve never had a chance to use it, but after reading Josh’s cool hack for determining sums of concurrent queries using windowing functions in PostgreSQL 8.4 to query a table generated from a CSV log, I just had to give it a try. But while there is decent documentation for loading up the contents of a CSV-formatted log file, there I couldn’t find simple information on how to set it up. So I figured it out and record it here for posterity.

    Follow #logging on RSS or use the

    JSON API
    
    curl -X GET \
      -H "Content-type: application/json" \
      -H "Accept: application/json" \
      "https://octothorp.es/~/logging"