Reputation: 2405
I have created an enum
type in Postgres:
CREATE TYPE myenum AS ENUM ('a', 'b', 'c', 'd');
I have created a function:
CREATE OR REPLACE FUNCTION public.mystore(type myenum)
Now in the stored procedure how I can check if a type is 'a'
or 'b'
like
if(type = myenum.a or type = myenum.b) then
...
end if;
In fact the last line of code is not working.
Upvotes: 2
Views: 190
Reputation: 658492
Just use a string literal
:
WHERE type = 'a' OR type = 'b'
Or:
WHERE type IN ('a', 'b')
Upvotes: 2