From: Rui DeSousa <rui@crazybean.net>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Sbob <sbob@quadratum-braccas.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: sort output per alpha-numeric?
Date: Thu, 2 Dec 2021 01:03:02 -0500
Message-ID: <E3F7F091-808A-4C9E-950D-99B12AFE11D3@crazybean.net> (raw)
In-Reply-To: <CAKFQuwZNkdXjmgiw-BWq=sSoDJEZdt6-QhERc30ZpWdkKRqUqg@mail.gmail.com>
References: <6b1034cc-d98d-f3a7-6dd9-264bb0f934d8@quadratum-braccas.com>
<CAKFQuwYL_gQ9JoPehdCj8NKevW77636xSNr2PvSR_BS+8_KhnQ@mail.gmail.com>
<CAKFQuwZNkdXjmgiw-BWq=sSoDJEZdt6-QhERc30ZpWdkKRqUqg@mail.gmail.com>
> On Dec 1, 2021, at 6:24 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
> the normalized version of this model would store the width and height measurements separately and your print_size text would be a presentation issue.
I second this approach as it should be normalized into two fields. It would then be a simple order by area.
i.e. order by width * height
This would work in the meantime, given the data format doesn’t change:
order by split_part(print_size, 'x', 1)::int * split_part(print_size, 'x', 2)::int
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: rui@crazybean.net, david.g.johnston@gmail.com, sbob@quadratum-braccas.com, pgsql-admin@lists.postgresql.org
Subject: Re: sort output per alpha-numeric?
In-Reply-To: <E3F7F091-808A-4C9E-950D-99B12AFE11D3@crazybean.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox