Paulo Jan <admin@mail.ddnet.es> writes:
> 1) I started psql and then looked at the PID of the "postgres" backend
> process.
> 2) I typed "gdb postgres (PID)":
> 3) I typed the query in psql and started it. psql hangs...
> 4) ...and in the meantime, I type "bt" in the gdb window:
Not quite the right sequence: I think what you've captured is just the
backend waiting to receive the query. Start the failing query, and
*after* it hangs attach to the backend process with gdb.
regards, tom lane