Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwRFx-00Bfvb-15 for pgsql-admin@arkaria.postgresql.org; Fri, 27 Oct 2023 18:08:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qwRFv-000Fwd-EC for pgsql-admin@arkaria.postgresql.org; Fri, 27 Oct 2023 18:08:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwRFv-000FwV-1W for pgsql-admin@lists.postgresql.org; Fri, 27 Oct 2023 18:08:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwRFs-002bwm-EK for pgsql-admin@postgresql.org; Fri, 27 Oct 2023 18:08:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39RI8Jfr1586760; Fri, 27 Oct 2023 14:08:19 -0400 From: Tom Lane To: Loles cc: pgsql-admin@postgresql.org Subject: Re: ORDER BY DESC and NULLS LAST by default In-reply-to: References: Comments: In-reply-to Loles message dated "Fri, 27 Oct 2023 19:55:19 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1586758.1698430099.1@sss.pgh.pa.us> Date: Fri, 27 Oct 2023 14:08:19 -0400 Message-ID: <1586759.1698430099@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Loles writes: > I was really wondering if, just like you can disable autocommit mode in > PostgreSQL, if you could configure some parameter so that ORDER BY, by > default, would order DESC instead of ASC. There is no such setting, and we'd be unlikely to consider adding one. Bitter experience has taught us that GUC parameters that change query behavior are usually bad ideas. Also, the SQL standard says explicitly that ASC is the default behavior. regards, tom lane