[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-user
Subject:    [Qgis-user] Fwd: QGIS PGpool reconnections
From:       Frederico dos Santos Soares <fssunb () gmail ! com>
Date:       2015-05-26 14:40:37
Message-ID: CAOcRrpV_aGE9Nv8Ndxt8TLWUYqKtKkWeOPPAb3wJJ=66x9gBOA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi everyone.
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.

But in that architecture we are using PGPool2 (more informations here
http://www.pgpool.net/mediawiki/index.php/Main_Page) and when PGPool2 cut
the connection after  five minutes (client_idle_limit=300) my problems
begin.

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.

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'.

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(...".
This bring us the question: is it correct QGIS's behavior for reconnection
in data base?

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.

Does someone have an idea about how to configure the PGPool, QGIS or both?
Is this QGIS's behavior a bug?

Thank you all

Frederico Soares
Geographer

Logs from data base:

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 = '*dmif.dmif_autos_infracao*'

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","embarg \
o","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')
 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

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

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).
-- 

Frederico dos Santos Soares
Geógrafo
55 61 8416 0105
fssunb@gmail.com


[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hi \
everyone.</div><div>I&#39;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&#39;t make inserts because the \
Primary Key (that before had a autocomplete using &quot;nextvall ...&quot; assumed by \
QGIS), after the conection cut down, send &quot;null&quot; what brings me an error \
because de PK is &quot;not null&quot; 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 \
&#39;0&#39;.</div><div><br></div><div>We notice if we change the SQL excluding the \
shema&#39;s name the answer is &quot;1&quot;. If we exclude the &#39;count&#39; and \
the shema&#39;s name, we have a few parameters including the rule \
&quot;nextvall(...&quot;.  </div><div>This bring us the question: is it correct \
QGIS&#39;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 &quot;nextvall...&quot; \
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&#39;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 ~ &#39;nextval&#39;
 AND c.relname = &#39;<font \
color="FF0000"><b>dmif.dmif_autos_infracao</b></font>&#39;<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 \
&quot;dmif&quot;.&quot;dmif_autos_infracao&quot;(&quot;the_geom&quot;,&quot;gid&quot;, \
&quot;numero_ai&quot;,&quot;serie&quot;,&quot;tipo_multa&quot;,&quot;embargo&quot;,&qu \
ot;cpf&quot;,&quot;cnpj&quot;,&quot;outros_doc&quot;,&quot;autuado&quot;,&quot;desc_in \
fra&quot;,&quot;desc_sanc&quot;,&quot;decreto&quot;,&quot;art1&quot;,&quot;art2&quot;, \
&quot;capitulo&quot;,&quot;secao&quot;,&quot;subsecao&quot;,&quot;tipo_infra&quot;,&qu \
ot;x&quot;,&quot;y&quot;,&quot;valor_mult&quot;,&quot;autuante&quot;,&quot;nome_uc&quo \
t;,&quot;co_cnuc&quot;,&quot;municipio&quot;,&quot;uf&quot;,&quot;data_auto&quot;,&quot;ano&quot;,&quot;obs_ai&quot;,&quot;erro_auto&quot;) \
VALUES (st_geomfromwkb($1::bytea,4674),$2,&#39;6&#39;,&#39;6&#39;,&#39;6&#39;,&#39;1&# \
39;,6,6,&#39;6&#39;,&#39;6&#39;,&#39;6&#39;,&#39;6&#39;,6,6,6,&#39;6&#39;,&#39;6&#39;, \
&#39;6&#39;,&#39;6&#39;,&#39;6&#39;,&#39;6&#39;,6,&#39;6&#39;,&#39;6&#39;,6,&#39;6&#39;,&#39;6&#39;,&#39;2015-06-06&#39;,2015,&#39;6&#39;,&#39;6&#39;)<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 =
 &#39;\x010100000010ecd98c8e4d42c094f4d66f3e7320c0&#39;, $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 &quot;gid&quot; 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>



_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic