Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 888546

Summary: select count(*) from null in postgres log
Product: [JBoss] JBoss Operations Network Reporter: Viet Nguyen <vnguyen>
Component: DatabaseAssignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Armine Hovsepyan <ahovsepy>
Severity: low Docs Contact:
Priority: unspecified    
Version: JON 3.1.2CC: hrupp, mfoley, mkoci, myarboro, tsegismo, vnguyen
Target Milestone: ER01   
Target Release: JON 3.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:03:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
postgresql log. go to 15:08:49
none
rhq server log none

Description Viet Nguyen 2012-12-18 21:09:45 UTC
Description of problem:

A handful of "SELECT COUNT(*) from NULL generated in postgresql log every time an agent was imported.  These warning/errors however were generated by postgres user, not rhqadmin.


Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Import an agent (or uninventory re-import)
2. Navigate to Platform view
3. see  postgresql log /var/lib/pgsql/data/pg_log/
  
Actual results:


Expected results:


Additional info:

Comment 1 Viet Nguyen 2012-12-18 21:11:37 UTC
Created attachment 665757 [details]
postgresql log. go to 15:08:49

Comment 2 Viet Nguyen 2012-12-18 21:12:29 UTC
Created attachment 665758 [details]
rhq server log

Comment 3 Heiko W. Rupp 2013-08-12 14:40:38 UTC
This is very likely created by postgres instrumentation or postgres plugin

The connection log shows:


2012-12-18 15:08:48 EST 50d0cd50.10ba postgres LOG:  execute <unnamed>: select relname from pg_stat_user_tables

and then

2012-12-18 15:08:49 EST 50d0cd50.10ba postgres ERROR:  syntax error at or near "null" at character 22
2012-12-18 15:08:49 EST 50d0cd50.10ba postgres STATEMENT:  SELECT COUNT(*) FROM null
2012-12-18 15:08:49 EST 50d0cd4b.10b0 postgres LOG:  execute <unnamed>: select relname from pg_stat_user_tables
2012-12-18 15:08:49 EST 50d0cd4b.10b0 postgres ERROR:  syntax error at or near "null" at character 22
2012-12-18 15:08:49 EST 50d0cd4b.10b0 postgres STATEMENT:  SELECT COUNT(*) FROM null

Note, all those entries have the same connection id.

As the postgres plugin has both "select relname from pg_stat_user_tables" and "SELECT COUNT(*) FROM" defined, this is most likely.

Note for a fix that "select count(*) may be very expensive on postgres and should be omitted".

Viet: can you try with the postgres plugin "disabled"

Comment 5 Thomas Segismont 2014-08-22 13:16:17 UTC
Tried the steps above and could not reproduce. There has been a lot of Postgres plugin work in master before 3.3 branch was cut-off.

Comment 6 Jan Bednarik 2014-08-26 12:14:26 UTC
Moving to VERIFIED.

Tested both on JON 3.3.0 ER01 and JON 3.2.0 GA. The warning in question is never logged in postgresql log file.

Version:3.3.0.ER01
Build Number:23b3476:f3aa7e7