Message-ID: From: "lukaseder (@lukaseder)" To: "pgjdbc/pgjdbc" Date: Mon, 12 Dec 2022 09:57:27 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #538: Why getSchemaName return empty string or exists getBaseSchemaName and getColumnName return getColumnLabel? In-Reply-To: References: List-Id: X-GitHub-Author-Login: lukaseder X-GitHub-Comment-Id: 1346193264 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 538 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/538#issuecomment-1346193264 Content-Type: text/plain; charset=utf-8 I wonder if this could be implemented relatively easily by now? It was implemented for `PgResultSetMetaData::getTableName`, in case of which a query like this one is issued: ```sql SELECT c.oid, a.attnum, a.attname, c.relname, n.nspname, a.attnotnull OR (t.typtype = 'd' AND t.typnotnull), a.attidentity != '' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%nextval(%' FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON (c.relnamespace = n.oid) JOIN pg_catalog.pg_attribute a ON (c.oid = a.attrelid) JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid) LEFT JOIN pg_catalog.pg_attrdef d ON (d.adrelid = a.attrelid AND d.adnum = a.attnum) JOIN (...) vals ON (c.oid = vals.oid AND a.attnum = vals.attnum) ``` That query produces the schema name (`n.nspname`) and the information is cached. Since users are likely going to call `PgResultSetMetaData::getTableName` as well when they call `PgResultSetMetaData::getSchemaName`, I suspect there wouldn't be any additional overhead?