Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYDqV-0003Qg-Gd for pgsql-admin@arkaria.postgresql.org; Sun, 18 Apr 2021 20:16:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYDqU-0005uV-Eq for pgsql-admin@arkaria.postgresql.org; Sun, 18 Apr 2021 20:16:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYDqU-0005uN-7C for pgsql-admin@lists.postgresql.org; Sun, 18 Apr 2021 20:16:42 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lYDqP-0003oX-8X for pgsql-admin@lists.postgresql.org; Sun, 18 Apr 2021 20:16:41 +0000 Received: by mail-ed1-x52c.google.com with SMTP id z5so1722436edr.11 for ; Sun, 18 Apr 2021 13:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=4pAS/b/dEeEvC0yKbtqrJBDoVIdIGvu26e3QIApaOoo=; b=rp03guX+uEMprrE7ALvAd42lRLKrGvLhtRFGUdJq3PJhy/Qhv7PifN8BjzchBKaJjJ Xlki+DXRtfg+xng03e0jn4zCc/TwuRho9hisnuLTY9JCyKlMQleurZi92iIKDzzvEuwl Oxg+a+WymPcFlJ0RDY8iHxH3nDHWaIGRJ1MTtwdrWrlHQAoUWqgeXjY5sIxU76SLFPZU HiaZYPxA7AA4OjA2EBuHHp0pXwh5TNSs5IDTY3ntTb6fx72KYnFjWLyNsUfvXV94UrvM VEv1mYjVFYn/RG3mqMuwzYOjvu8/606a4FoeZ38K92n30bIZiHL8OApCF9YIYjEIHjmz W/fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=4pAS/b/dEeEvC0yKbtqrJBDoVIdIGvu26e3QIApaOoo=; b=kKPJ5ZC6GV4w7FU3J1mtLV7FZp5wm7rAoPkAVSfweSLbWn2LkQRUPqf9qvCErmC18s TKGYj6lx/pX+BzMIKMURgGgm1NLO3d7a4GrzigWcl6Xuc9YT6xsyds5dZ2RVxV4Fp/UL Zc73nDsZJcQLGifLWDvRGdIMVMhn3OXIEB/fm3QrpV7iN75VBnWa9iAjPeYNap8KFjqD a/lYcr15ZhUkTzYoC253TpyLoJJWWIyeSa64n1TjbdnrKeE8Fp14wGFmM+8Qa3nc1i/q sfTKaVQ9PoEJRMHZ3f2FtOUiiZMf/SCHFe+WoHkDXoCRWnx9RES/2j5yWR8mun3btvku fScg== X-Gm-Message-State: AOAM530wQxB7OaorcTcRxf1+gIOWEWZLKbgU1QaYBsapg3dCBn4opzJ4 RZnR01nqoI5rbhUEbTgrO/yScw== X-Google-Smtp-Source: ABdhPJwLrsyJk9DbOWk0SLpatMKJBOFVptD1A2LKIp9xxpi616jNg9sCdPLWC7VHtKcMgwVFik0ggA== X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr207772edb.46.1618776995832; Sun, 18 Apr 2021 13:16:35 -0700 (PDT) Received: from localhost.localdomain (178-190-171-71.adsl.highway.telekom.at. [178.190.171.71]) by smtp.gmail.com with ESMTPSA id pv21sm8846776ejb.109.2021.04.18.13.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 13:16:35 -0700 (PDT) Message-ID: <519ffa9f26f607e8154b012f0ee323be72512da2.camel@cybertec.at> Subject: Re: Reordering the fields in a table From: Laurenz Albe To: Ron , pgsql-admin@lists.postgresql.org Date: Sun, 18 Apr 2021 22:16:34 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-04-16 at 22:33 -0500, Ron wrote: > On 4/16/21 2:54 PM, Laurenz Albe wrote: > > On Fri, 2021-04-16 at 16:15 +0000, Campbell, Lance wrote: > > > I would love to see an enhancement to PostgreSQL where administrators had some way to reorder the fields in their tables. > > > > There is a misconception here. > > Database tables are not designed for human consumption. > > Rubbish. Database tables are designed by humans to store data that humans > care about. I think you deliberately misunderstand me. A database is not a GUI to render data. > > If you want to present your table data in a readable format, you need a front end application. > > Arranging table columns is the job of such a tool. > > Adding "ALTER TABLE MOVE COLUMN ... BEFORE/AFTER COLUMN ..." is pretty > trivial, requiring "just another table", which stores the physical order of > the columns, and also the order in which they are presented to the "user > layer". I know this because such a feature was implemented 15+ years ago in > Rdb/VMS. It is *not* trivial. If you want a solution and are not just trolling, why don't you use views? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com