I'm not a big fan of this; every time we needed to detect something we relied on counting; could we do the same ?
RES=$(su - postgres -c "psql -t -d rudder -c \"select count(*) from information_schema.columns where table_name='ruddersysevents' and column_name='id' and data_type='integer'")