Postgres - Select all if given parameter is null i have a table with the below columns
name varchar(250)
type varchar(25)

is there a way for me to structure a query to return all records if the type parameter is null?
Im aware that i can do something like
select * from tbl where type = Coalesce(@param, 'a');

which will give me all records of type 'a' if i give an empty param.
But what if i want to retrieve all records if param is null?
Use the placeholder for strings:
select * from tbl where type LIKE Coalesce(@param, '%');