You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It returns an url to the plan, but then the url returns error 500. It's https://explain.dalibo.com/plan/0424...hacb (I can post full URL if you want, but I suppose you can see that in logs somewhere). Any pointers on what's wrong the the query? $PLAN in question is a JSON from postgres.
The text was updated successfully, but these errors were encountered:
Thanks, it works now! If you've interested in adding that to a site, I've got a script to execute a query in Postgres and then POST it to explain.dalibo.com:
#!/bin/sh
set -euo pipefail
if [ -z "${1:-}" ]; then
echo "Usage: $0 <name from pg_service.conf>"
echo ""
echo "Gets SQL query from clipboard, sends it to Postgres you supply as"
echo "a first argument and posts it to explain.dalibo.com"
exit 1
fi
SERVICE="$1"
QUERY="EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) $(pbpaste)"
PLAN=$(psql "service=$SERVICE" -qXAt -c "$QUERY")
URL=$(echo "$PLAN" | curl -s -w '%{redirect_url}' --data-urlencode "query=$QUERY" --data-urlencode title= --data-urlencode plan@- -X POST 'https://explain.dalibo.com/new' -o /dev/null)
echo "$URL" | pbcopy
echo "URL copied to clipboard: $URL"
I'm writing a shell script to create a plan from query and got to the following curl command:
It returns an url to the plan, but then the url returns error 500. It's
https://explain.dalibo.com/plan/0424...hacb
(I can post full URL if you want, but I suppose you can see that in logs somewhere). Any pointers on what's wrong the the query?$PLAN
in question is a JSON from postgres.The text was updated successfully, but these errors were encountered: