Get tables ending with numbers

From: Sathesh S <sathesh(dot)sundaram(at)hotmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Get tables ending with numbers
Date: 2017-02-15 06:16:51
Message-ID: AM5PR10MB06895D3FC5E6F9EBF3C737AD825B0@AM5PR10MB0689.EURPRD10.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

Im trying to get tables ending with numbers (last 8 characters should be numbers).

For example: I have the tables "test_20160215" and "test_20160131" and "test_1". When i run the below sql im not getting any output.

Select relname from pg_class where relname like '%[0-9]'

Can someone please give some idea on this.

Thanks,
Sathesh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charles Clavadetscher 2017-02-15 06:35:28 Re: Get tables ending with numbers
Previous Message Gmail 2017-02-15 05:26:40 Re: Can't restart Postgres