title: PostgreSQL function : relation does not exist error
body: <p>I am getting below error while calling <strong>Postgresql function with argument containing dot (.) operator.</strong></p>
  <pre><code>SQL Error [42P01]: ERROR: relation &quot;es.article_data&quot; does not exist Where: PL/pgSQL function es.getrowcount(text) line 6 at EXECUTE....
  </code></pre>
  <p><strong>Query: select es.getrowcount(schemawithtable :='es.article_data');</strong></p>
  <p><strong>Function:</strong></p>
  <pre><code>CREATE FUNCTION es.getrowcount (schemawithtable text)
  RETURNS VARCHAR(50) AS $msg$
  declare
      msg VARCHAR(50);
      total integer;
  begin
    execute format('select count(*) from %I where until_ts is null', schemawithtable) into total;
     msg := CONCAT(total, ' records are there in ',schemawithtable);
     RETURN msg;
  END;
  $msg$ LANGUAGE plpgsql;
  </code></pre>
  <p><strong>Error traces from DBeaver:</strong></p>
  <pre><code>org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error [42P01]: ERROR: relation &quot;es.article_data&quot; does not exist
    Where: PL/pgSQL function es.getrowcount(text) line 6 at EXECUTE
  
      at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:134)
  
      at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:487)
  
      at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:424)
  
      at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:164)
  
      at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:416)
  
      at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:774)
  
      at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:2914)
  
      at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:110)
  
      at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:164)
  
      at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:108)
  
      at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$17.run(ResultSetViewer.java:3421)
  
      at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:103)
  
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
  
  Caused by: org.postgresql.util.PSQLException: ERROR: relation &quot;es.article_data&quot; does not exist
    Where: PL/pgSQL function es.getrowcount(text) line 6 at EXECUTE
  
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
  
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
  
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
  
      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
  
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
  
      at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
  
      at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
  
      at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
  
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
  
      at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:338)
  
      at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
  
      ... 12 more
  </code></pre>
  <p>I have figure out the workaround by passing schema name separately.</p>
  <p><strong>Working Query: select es.getrowcount(schemaname :='es',tablename :='article_data');</strong></p>
  <pre><code>CREATE FUNCTION es.getrowcount (schemaname text, tablename text)
  ...
  begin
    execute format('select count(*) from %I.%I where until_ts is null',schemaname, tablename) into total;
  ...
  $msg$ LANGUAGE plpgsql;
  </code></pre>
  <p><strong>Versions:</strong>
  <code>PostgreSQL - 10.12</code>
  <code>DBeaver (client) - 6.3.5</code></p>
  <p><strong>But I want to know why it is giving an error for argument containing dot (.) operator ?</strong></p>