confucius_007
confucius_007

Reputation: 326

What is the maximum numeric value I can use for BITWISE functions in Oracle and PostgreSQL?

I want to know, what is the maximum value of parameters we can use in the case of BITAND and BITOR functions?

Oracle.

BITAND(expr1, expr2)
BITOR(expr1, expr2)

PostgreSQL.

expr1 & expr2
expr1 | expr2

What are the maximum and minimum values allowed for expr1 and expr2 in both the systems?

Upvotes: 0

Views: 203

Answers (1)

user330315
user330315

Reputation:

For Postgres, the two operators | and & support different data types.

Mainly smallint, integer, bigint and bit.

So for "numbers" (integers) the maximum value on each side is the maximum for the bigint type: 9223372036854775807

For bit strings, the maximum length is 2147483647 (which could be interpreted as the number 2^2147483647)

Upvotes: 2

Related Questions