public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: veem v <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Getting specific partition from the partition name
Date: Thu, 8 Aug 2024 16:45:18 -0400
Message-ID: <CAKAnmmLRnzV2C6XBzu64Let3jtABh1P2sGbHBcfAfKpT22ufVQ@mail.gmail.com> (raw)
In-Reply-To: <CAB+=1TUgzD7CfGbgiBAgcuttN06X11787WvJSeCPs=ek5qCgxw@mail.gmail.com>
References: <CAB+=1TUgzD7CfGbgiBAgcuttN06X11787WvJSeCPs=ek5qCgxw@mail.gmail.com>

YYYY_MM_DD is already setup for sorting, so just do:

SELECT table_name FROM information_schema.tables WHERE table_name ~
'table_part_p' ORDER BY 1 DESC;

If you need to grab the numbers:

SELECT substring('table_part_p2022_03_04' from '([\d_]+)$');

Cheers,
Greg


view thread (4+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Getting specific partition from the partition name
  In-Reply-To: <CAKAnmmLRnzV2C6XBzu64Let3jtABh1P2sGbHBcfAfKpT22ufVQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox