How to list all table columns in sorted order? I know that \d table_name lists all columns for that table, but is there a way to list them sorted in alphabetical order?
Generally, use the information_schema:

SELECT column_name
FROM information_schema.columns 
WHERE table_schema = 'public' 
AND table_name = 'blah' 
ORDER BY column_name ASC;