processSQLNamePattern() analog

From: Sergey Cherkashin <s(dot)cherkashin(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: processSQLNamePattern() analog
Date: 2018-06-06 10:06:14
Message-ID: 1528279574.27656.14.camel@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

I'm working on adding to psql commands to print information about access methods. I ran into the following problem:
The command "\dA" (as well as several commands that I write) accept the access method name template. The resulting template is processed by the processSQLNamePattern () function, which means that a template with a schema can be fed to the input. But since the access method does not have schema, it's needed to handle somehow a command like "\dA foo. *". At this point, the command will display a full list of access methods, not paying attention to the presence of the schema name in the template. Function processSQLNamePattern () allows you to filter out the output, if for example to compare the name of the schema not with any value of the column, but with NULL. But in this case, patterns like "\dA *.*" will not be eliminated.

I also need a possibility to handle templates of type "schema.table.column", but the function processSQLNamePattern () can process only "schema.table".

In this regard, the question: is it still worth adding a new function capable of handling these cases, or should the psql user deal with output like "all_schemas.mathed_table.mathed_column"? And is it worth fixing the current behavior of "\dA foo.*"?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-06-06 11:30:52 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Previous Message David Rowley 2018-06-06 09:52:04 Re: why partition pruning doesn't work?