Being curious I found out that the conversion is defined in /src/backend/parser/scan.l
:
/* Convert "!=" operator to "<>" for compatibility */
if (strcmp(yytext, "!=") == 0)
yylval->str = pstrdup("<>");
else
yylval->str = pstrdup(yytext);
return Op;
scan.l
is used almost at the beginning of parsing. There is also note in Create Operator chapter:
The operator != is mapped to <> on input, so these two names are always equivalent.
You can find <>
operator in pg_operator
table, but there is nothing for !=
:
select * from pg_operator where oprname = '<>';
select * from pg_operator where oprname = '!=';
There is a lot on this topic in this similar question.