Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Precedence of bitwise operators - Mailing list pgsql-hackers
From
Bauyrzhan Sakhariyev
Subject
Precedence of bitwise operators
Date
November 20, 2022
21:27:19
Msg-id
CAKpL73v_KF_x6vRS7ofZ33exkq4_FYWWz16nSdcSA5h2dPifrg@mail.gmail.com
Whole thread
Raw
Responses
Re: Precedence of bitwise operators
List
pgsql-hackers
Tree view
Hi! Do I get it right, that bitwise operations have the same precedence?
Query
SELECT 1 & 2 | 3, 3 | 1 & 2
returns 3 and 2 respectively. See also
https://www.db-fiddle.com/f/iZHd8zG7A1HjbB6J2y8R7k/1
. It looks like the result is calculated from left to right and operators have the same precedence.
I checked relevant documentation pages (
https://www.postgresql.org/docs/current/functions-bitstring.html
and
https://www.postgresql.org/docs/current/sql-syntax-lexical.html
) and couldn't find any information about bitwise operations precedence, only information about logical operations precedence.
I'm not saying it's a bug, rather trying to clarify as precedence of bitwise operators is different in programming languages, say c++ (
https://en.cppreference.com/w/c/language/operator_precedence
) or java (
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
)
pgsql-hackers
by date:
Previous
From:
Thomas Munro
Date:
20 November 2022, 21:13:06
Subject:
Re: Reducing power consumption on idle servers
Next
From:
Magnus Hagander
Date:
20 November 2022, 21:31:14
Subject:
Re: More efficient build farm animal wakeup?
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies