Re: psql: Greatly speed up "\d tablename" when not using regexes

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: Greatly speed up "\d tablename" when not using regexes
Date: 2024-04-10 17:31:56
Message-ID: CAKAnmmK3Y=pv3ZimxmMT8RGBicBaJVfcmhh6u1rc5Y11kZhiFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Patch looks good to me. Great idea overall, that forced regex has always
bugged me.

+ char *regexChars = "|*+?()[]{}.^$\\";

One super minor optimization is that we technically do not need to scan for
')' and ']'. If they appear without their partner, the query will fail
anyway. :)
Cheers,
Greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-04-10 17:32:42 Re: Issue with the PRNG used by Postgres
Previous Message Robert Haas 2024-04-10 17:25:20 Re: Table AM Interface Enhancements