Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aTlDD-0007sO-Nu for pgsql-jdbc@arkaria.postgresql.org; Thu, 11 Feb 2016 06:58:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aTlDD-0002NV-5X for pgsql-jdbc@arkaria.postgresql.org; Thu, 11 Feb 2016 06:58:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aTlCi-0001pY-C5 for pgsql-jdbc@postgresql.org; Thu, 11 Feb 2016 06:58:16 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aTlCa-0003YC-NZ for pgsql-jdbc@postgresql.org; Thu, 11 Feb 2016 06:58:15 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aTlCW-0004IU-5i for pgsql-jdbc@postgresql.org; Thu, 11 Feb 2016 07:58:04 +0100 Received: from ppp-46-244-213-174.dynamic.mnet-online.de ([46.244.213.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Feb 2016 07:58:04 +0100 Received: from spam_eater by ppp-46-244-213-174.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Feb 2016 07:58:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: System Query hit to Database Date: Thu, 11 Feb 2016 07:57:54 +0100 Lines: 41 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-46-244-213-174.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Pg-Spam-Score: -2.8 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org dhaval jaiswal schrieb am 11.02.2016 um 06:02: > Kindly redirect me to the correct forum, If below question is not relevant to you. > > > I am getting lot of following queries on my Database. I need your help to stop hitting this kind of queries to database. > > While going through search found the following article saying it's caused by jdbc driver. > > http://stackoverflow.com/questions/5453992/a-very-strange-sql-of-postgresql > > SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS > TABLE_NAME, CASE n.nspname ~ '^pg_' OR n.nspname = > 'information_schema' WHEN true THEN CASE WHEN n.nspname = > 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind > WHEN 'r' THEN 'SYSTEM TABLE' WHEN 'v' THEN 'SYSTEM VIEW' WHEN 'i' > THEN 'SYSTEM INDEX' ELSE NULL END WHEN n.nspname = 'pg_toast' > THEN CASE c.relkind WHEN 'r' THEN 'SYSTEM TOAST TABLE' WHEN 'i' > THEN 'SYSTEM TOAST INDEX' ELSE NULL END ELSE CASE c.relkind WHEN > 'r' THEN 'TEMPORARY TABLE' WHEN 'i' THEN 'TEMPORARY INDEX' WHEN > 'S' THEN 'TEMPORARY SEQUENCE' WHEN 'v' THEN 'TEMPORARY VIEW' ELSE > NULL END END WHEN false THEN CASE c.relkind WHEN 'r' THEN > 'TABLE' WHEN 'i' THEN 'INDEX' WHEN 'S' THEN 'SEQUENCE' WHEN 'v' > THEN 'VIEW' WHEN 'c' THEN 'TYPE' ELSE NULL END ELSE NULL END AS > TABLE_TYPE, d.description AS REMARKS FROM pg_catalog.pg_namespace n, > pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_description d ON > (c.oid = d.objoid AND d.objsubid = 0) LEFT JOIN pg_catalog.pg_class > dc ON (d.classoid=dc.oid AND dc.relname='pg_class') LEFT JOIN > pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND > dn.nspname='pg_catalog') WHERE c.relnamespace = n.oid AND c.relname > LIKE 'PROBABLYNOT' AND (false OR ( c.relkind = 'r' AND n.nspname !~ > '^pg_' AND n.nspname <> 'information_schema' ) ) ORDER BY > TABLE_TYPE,TABLE_SCHEM,TABLE_NAME > this is the query sent by getTables() (as mention on Stackoverflow). There are some connection pools out there that have a stupid default configuration and use getTables() as the query to validate if a connection is still alive. If you additionally have enabled validating connections when they are taken out or returned to the pool, this will be called for each "getConnection()" inside your code. Check the configuration of your connection pool. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc