Re: Getting specific partition from the partition name

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: veem v <veema0000(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Getting specific partition from the partition name
Date: 2024-08-08 20:45:18
Message-ID: CAKAnmmLRnzV2C6XBzu64Let3jtABh1P2sGbHBcfAfKpT22ufVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2024-08-08 23:02:19 Re: Vacuum full connection exhaustion
Previous Message Greg Sabino Mullane 2024-08-08 20:35:32 Re: Column type modification in big tables