<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hi everyone.</div><div>I'm using QGIS 2.8 in a Windows 7 (professional-64bits), at my work. We are trying to use an architecture with PostGIS 2.0.6, where multiple users populate a data base.</div><div><br></div><div>But in that architecture we are using PGPool2 (more informations here <a href="http://www.pgpool.net/mediawiki/index.php/Main_Page" target="_blank">http://www.pgpool.net/mediawiki/index.php/Main_Page</a>) and when PGPool2 cut the connection after  five minutes (client_idle_limit=300) my problems begin.</div><div><br></div><div>At this time, I can't make inserts because the Primary Key (that before had a autocomplete using "nextvall ..." assumed by QGIS), after the conection cut down, send "null" what brings me an error because de PK is "not null" and serial type.</div><div><br></div><div>Observing the log in bank we saw that: when QGIS restart the conection he make an SQL (that count something) using the name of schema with the name of table (that is not in public schema), the answer of SQL is '0'.</div><div><br></div><div>We notice if we change the SQL excluding the shema's name the answer is "1". If we exclude the 'count' and the shema's name, we have a few parameters including the rule "nextvall(...". </div><div>This bring us the question: is it correct QGIS's behavior for reconnection in data base?</div><div><br></div><div>Unfortunately remove PGPoll is not a option. we think that a good way is, when QGIS reconnect to data base the rule "nextvall..." in PK column reestablish automatically.</div><div><br></div><div>Does someone have an idea about how to configure the PGPool, QGIS or both?</div><div>Is this QGIS's behavior a bug? </div><div><br></div><div>Thank you all</div><div><br></div><div>Frederico Soares</div><div>Geographer</div><div><br></div><div>Logs from data base:</div><div><br></div><div>2015-05-13 18:04:31.847 BRT; host: 10.197.94.11; user: frederico.soares;
 session: 5553bbde.1bfa; database: db_geo_compartilhado; LOG:  execute 
pgpool7083/pgpool7083: SELECT count(*) FROM pg_catalog.pg_attrdef AS d, 
pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND d.adsrc ~ 'nextval'
 AND c.relname = '<font color="FF0000"><b>dmif.dmif_autos_infracao</b></font>'<br><br>2015-05-13
 18:04:31.873 BRT; host: 10.197.94.11; user: frederico.soares; session: 
5553bbde.1bfa; database: db_geo_compartilhado; LOG:  execute 
addfeatures: INSERT INTO "dmif"."dmif_autos_infracao"("the_geom","gid","numero_ai","serie","tipo_multa","embargo","cpf","cnpj","outros_doc","autuado","desc_infra","desc_sanc","decreto","art1","art2","capitulo","secao","subsecao","tipo_infra","x","y","valor_mult","autuante","nome_uc","co_cnuc","municipio","uf","data_auto","ano","obs_ai","erro_auto") VALUES (st_geomfromwkb($1::bytea,4674),$2,'6','6','6','1',6,6,'6','6','6','6',6,6,6,'6','6','6','6','6','6',6,'6','6',6,'6','6','2015-06-06',2015,'6','6')<br>2015-05-13
 18:04:31.873 BRT; host: 10.197.94.11; user: frederico.soares; session: 
5553bbde.1bfa; database: db_geo_compartilhado; DETAIL:  parameters: $1 =
 '\x010100000010ecd98c8e4d42c094f4d66f3e7320c0', $2 = NULL<br><br>2015-05-13
 18:04:31.873 BRT; host: 10.197.94.11; user: frederico.soares; session: 
5553bbde.1bfa; database: db_geo_compartilhado; ERROR:  null value in 
column "gid" violates not-null constraint<br><br>2015-05-13 18:04:31.873
 BRT; host: 10.197.94.11; user: frederico.soares; session: 
5553bbde.1bfa; database: db_geo_compartilhado; DETAIL:  Failing row 
contains (null, 6, 6, 6, t, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
 6, 6, 6, 6, 6, 6, 2015-06-06, 2015, 6, 6, 
01010000204212000010ECD98C8E4D42C094F4D66F3E7320C0).<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><span style="color:rgb(34,34,34)">-- </span><br></div></font></span></div></div><div><div dir="ltr"><br>Frederico dos Santos Soares<br>Geógrafo<br>55 61 8416 0105<br><a href="mailto:fssunb@gmail.com" target="_blank">fssunb@gmail.com</a><br></div></div>
</div>