As far as the comparison behavior goes, psql's parser strips comments that start with double dashes, for $obscure_reasons.
That story aught to be worth a $beer or two
The server is perfectly capable of ignoring those by itself,
though. (Awhile back I tried to remove that psql behavior,
but it caused too much churn in our regression tests.)
regards, tom lane
