Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiHMd-0003Ea-IS for pgsql-general@arkaria.postgresql.org; Tue, 02 Jul 2019 11:54:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hiHLc-0006bg-4c for pgsql-general@arkaria.postgresql.org; Tue, 02 Jul 2019 11:53:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiHLb-0006bZ-OO for pgsql-general@lists.postgresql.org; Tue, 02 Jul 2019 11:53:19 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiHLY-0001g2-JC for pgsql-general@lists.postgresql.org; Tue, 02 Jul 2019 11:53:18 +0000 Received: from [10.8.0.6] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MLAAs-1hzGGT1yQE-00IE96 for ; Tue, 02 Jul 2019 13:53:11 +0200 Subject: Re: Sequences part 2 To: pgsql-general@lists.postgresql.org References: <4f61207408b84e9f8e6f36f1476f928d@UKEXCHMBX003.TechMahindra.com> From: Thomas Kellerer Message-ID: <718af8b0-d6e9-a059-9cc8-4806d3466e13@gmx.net> Date: Tue, 2 Jul 2019 13:53:10 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <4f61207408b84e9f8e6f36f1476f928d@UKEXCHMBX003.TechMahindra.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:pWWg/bjbIMDK6iXQorjw2GAvR1v+DCDhVPnPop9yKVD1pad+dWg 5wP8jVgPtUMZxnDlHPnOV//623YVpwB9zJ2y8w7UsFVW/ttpxoccKRcUnWnRaHf4hUX+atB M2StieafYFWqPnSIBbAu+zCiKMF0wBfb4uhDCyfWbGFDrh2u2vHndZg0cv+1MLJDm7yAdsj VwmZ6pt30kRG4WRGlKKow== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6Yq5jUekAKk=:4rCse80nO5NANYIh6Xt5e6 ODGDTR7/fpMsUbRTg48u7SCH1TtCAFUfPJnmkl9B+5j+U3BipzTui9DtkWbj2Be3VVj5pO2Gu jGl9xJg4M82TOCoHzGVtNyIQSCt6gaOJiIHP9H4AlUSm15i42EBBp+r38aDGO/wgl3YstROM4 ZrPETep4Q0fIXCSIAAD6nGXVfbNDOPOPyONeMBchDhVfB7yq7ZmFN3Oqt49yG20YHVKizy851 1mZBscxAefQF+qnsJ/nzNQ2d6Zbbn0QPUO5353sCOzoEGexurDIG1BPoDDSwZNFO3A0PmtW/F eFNV5xjXiMxWrnkhZnlbLO9ISBSYhthHneSoA1qkn3qON9wb6ujd82vgUzQKQGn42E65bgll5 IrCEaKPOZRhS7UXg14D9MaRp684anNhZqlNny9flHR+uoy8+Wa8ZQQT/STaBCNMb3T/ARhgTW GjOUnaeqhi98uM7irjciPCO6u+aSvVXU1qrqceYrSq9ZQvSie/q6/NoebtOPJWd/z3tMe+75B k085QJa9wWunaaVivzrn25IJf5h0O02FmRwy+1o7f7ue+/sroSCkVCrb4e6fJ2yp/JYMQyvte 1OnLunPQVeNkUSDfx7BO01ZnmLHD8ftG6YfsT6xbe+xpWZBDMK/9o1cQsqeGbH3TzmhyLrgen xlr9vjuQkyEagDXXOTsV1bmmtKj50rQlExk8gKQN+BmOzmlHTD0yecH+OH7NoS7qaZbMmngVE hLIjqIZUOvAtMkE645pQCf0PNxXz0rbc52QjyAkb3NMKtDOpd1WJO8tElQs= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Karl Martin Skoldebrand schrieb am 02.07.2019 um 13:20: >>> Now I want to insert more countries, between France and Ireland. >> >> That is a wrong assumption - there is no "between" for rows in a >> relational database. >> > > Yes, I'm fairly aware of this. However the application the > database table belongs to seems to rely on a specific order in the > database. I.e. if I just add value to the table they end up, possibly > due to how the application is coded in an undesireable spot on the > web page. That is why I wanted them to be inserted with the previous > records. There is no "order of rows" in a relational database. Even _if_ you squeeze the IDs of the new rows between existing ones, you still have no guarantee whatsoever on the order of the rows returned by a SELECT statement. The only(!) way to get a guaranteed sort order is to use ORDER BY. Thomas