I am new to sql. How can I write query in postgresql for below statement.
select *
FROM t1
where (error_id = (123 or 456 or 789) and message_id = 100)
or (error_id = 111 and message_id=222)
Like mentioned in the comments, you should read up on sql and syntax in the postgres documenation. You can also get some practice by using db-fiddle sites, where you can create your own tables, populate them and write queries against them.
The proper query would look like this, where you use IN when including more than one value.
select *
from t1
where (error_id in (123, 456, 789) and message_id = 100)
or (error_id = 111 and message_id=222)
INkeyword when you're checking for multiple values:error_id IN (123 or 456 or 789).