From 8344979d5bbc63aa8fb8c804bd933c887a2abb58 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 21 Jul 2021 18:03:33 -0400 Subject: [PATCH] Doc: improve documentation about exponentiation operator. Now that we're not having to wedge this into the straitjacket of the old operator table format, we can add another example to clarify the point about left-to-right associativity. Per suggestion from mdione at grulic.org.ar. https://postgr.es/m/162661954599.693.13700316547731859171@wrigleys.postgresql.org --- doc/src/sgml/func.sgml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5dea1aa986e..32328de46d5 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1007,16 +1007,23 @@ repeat('Pg', 4) PgPgPgPg double precision - Exponentiation (unlike typical mathematical practice, multiple uses of - ^ will associate left to right) + Exponentiation 2 ^ 3 8 + + Unlike typical mathematical practice, multiple uses of + ^ will associate left to right by default: + 2 ^ 3 ^ 3 512 + + + 2 ^ (3 ^ 3) + 134217728