記事:
sql_error_code = 28P01 # FATAL: password authentication failed for user "postgresql" sql_error_code = 28000 # FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "postgres", database "postgres", no encryption sql_error_code = 08P01 # HINT: This may indicate that the client does not support any SSL protocol version between TLSv1.2 and TLSv1.3. sql_error_code = 0A000 # FATAL: unsupported frontend protocol 255.255: server supports 3.0 to 3.0
sql_error_code AND -28P01 AND -28000 AND -08P01 AND -0A000
sql_error_code = (28P01|28000|08P01|0A000)
s3://bucket/<prefix>/dt=2020-08-01/2020-08-01-00.tsv.gz
SELECT date_trunc('hour', parse_datetime(generated_at,'yyyy-MM-dd HH:mm:ss')) AS generated_at_hour, COUNT(*) AS COUNT FROM papertrail_log WHERE heroku_app = 'example-heroku-app' AND dt = '2020-08-01' GROUP BY date_trunc('hour', parse_datetime(generated_at,'yyyy-MM-dd HH:mm:ss')) ORDER BY generated_at_hour ASC
SELECT date_trunc('minute', parse_datetime(generated_at,'yyyy-MM-dd HH:mm:ss')) AS TIME, COUNT(program) AS COUNT FROM papertrail_log WHERE heroku_app = 'example-heroku-app' AND program = 'heroku/router' AND dt BETWEEN format_datetime(now() - INTERVAL '1' DAY,'YYYY-MM-dd') AND format_datetime(now(),'YYYY-MM-dd') GROUP BY date_trunc('minute', parse_datetime(generated_at,'yyyy-MM-dd HH:mm:ss')) ORDER BY TIME ASC
SELECT regexp_extract(message, 'path=\"([^\"]+)', 1) AS path, COUNT(program) AS COUNT FROM papertrail_log WHERE heroku_app = 'example-heroku-app' AND program = 'heroku/router' AND dt BETWEEN format_datetime(now() - INTERVAL '1' DAY,'YYYY-MM-dd') AND format_datetime(now(),'YYYY-MM-dd') GROUP BY regexp_extract(message, 'path=\"([^\"]+)', 1) ORDER BY COUNT DESC LIMIT 100
SELECT regexp_extract(message, 'Started GET \"([^\"]+)', 1) AS started_get, COUNT(*) AS COUNT FROM papertrail_log WHERE heroku_app = 'example-heroku-app' AND dt = '2020-08-01' AND program = 'app/web.1' AND message LIKE '%Started GET%' GROUP BY regexp_extract(message, 'Started GET \"([^\"]+)', 1) ORDER BY COUNT DESC LIMIT 100