Reputation: 6733
I need to assign value 1 to variable which is of type bit.
Example:
create or replace function test()
returns void as
$Body$
Declare
var1 bit :=0;
Begin
....
....
var1 := 1;
....
....
end;
$Body$
language plpgsql;
Error:
ERROR: operator does not exist: bit = integer
Upvotes: 5
Views: 4604
Reputation: 4653
You need to use bit string literal like this: var1 := B'1'
. Here some more examples on bit type.
Upvotes: 6