Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-10 Thread Bernhard Ströbl



Am 10.04.2014 07:58, schrieb Paolo Cavallini:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Il 09/04/2014 20:45, Giovanni Manghi ha scritto:


What versions are affected - dev / 2.2 / both?



I think both, for sure on master.


It's a long standing problem, present since I can remember.


Me, too. This problem is present as far as I use QGIS together with 
PostGIS (QGIS 1.5 maybe). As far as I can remember only DDL statements 
(e.g. ALTER TABLE) are affected, whereas e.g. SELECT works as expected.
However I do not remember running into this in the last couple of months 
but this was maybe just luck :)
What has to be investigated, too, is if it happens with the same db user 
(role) accessing a table through QGIS and pgadmin. Background is I have 
dozens of db roles accessing the db with QGIS and as said above did not 
run into this problem recently when administrating the db with pgadmin.
Anybody has an idea what the reason is? Does QGIS lock a table so it 
cannot be altered?


Bernhard



it happens that pgadmin/psql operations remain freezed, then when
closing qgis they immediately start and finish as expected.


confirmed.

thanks.

- --
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlNGMwoACgkQ/NedwLUzIr48IACeKi0zj6R1iMIo+8JzQa4MAQEu
NYsAoIEZtgt9Q1skPwfSJk5dtfgRd5xA
=ubt+
-END PGP SIGNATURE-
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


__ Information from ESET Security, version of virus signature database 
9658 (20140410) __

The message was checked by ESET Security.

 part000.txt - is OK

http://www.eset.com







__ Information from ESET Security, version of virus signature database 
9658 (20140410) __

The message was checked by ESET Security.

   part000.txt - is OK

http://www.eset.com


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-10 Thread Nyall Dawson
On 10/04/2014 4:21 pm, Bernhard Ströbl bernhard.stro...@jena.de wrote:


.
 Anybody has an idea what the reason is? Does QGIS lock a table so it
cannot be altered?

Yes - here's some more info/bug reports:

http://hub.qgis.org/issues/7679

http://osgeo-org.1560.x6.nabble.com/Issue-with-standalone-python-script-and-PostGIS-Layers-td5098329.html

http://hub.qgis.org/issues/9357

Nyall
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-10 Thread Bernhard Ströbl

Hi Nyall,

Am 10.04.2014 08:59, schrieb Nyall Dawson:


On 10/04/2014 4:21 pm, Bernhard Ströbl bernhard.stro...@jena.de
mailto:bernhard.stro...@jena.de wrote:
 
 
.
  Anybody has an idea what the reason is? Does QGIS lock a table so it
cannot be altered?

Yes - here's some more info/bug reports:

http://hub.qgis.org/issues/7679


I remember this problem and have been looking into it some 2 years ago 
(estimated). My conclusion then was (if I remember correctly) that the 
psycopg2 transaction is not commited and thus locks the relation. 
(Closing DB manager closes the connection and thus terminates all 
transactions). Maybe setting the connection to autocommit solves this 
issue? I did not care any further because I do not use DB manager (but 
pgAdmin) for two reasons:

1) the named problem (it locks tables)
2) the need to install psycopg2 on all my clients' computers (IMHO a db 
plugin for QGIS should use QtSql because one can assume that it is 
installed).


but this Problem is (as far as I understand) not related to the problem 
described in the OP: tables are locked because they are loaded as layers 
into QGIS


Benhard



http://osgeo-org.1560.x6.nabble.com/Issue-with-standalone-python-script-and-PostGIS-Layers-td5098329.html

http://hub.qgis.org/issues/9357

Nyall





__ Information from ESET Security, version of virus signature database 
9658 (20140410) __

The message was checked by ESET Security.

   part000.txt - is OK

http://www.eset.com


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-10 Thread Giovanni Manghi

 Yes - here's some more info/bug reports:

 http://hub.qgis.org/issues/7679

 http://osgeo-org.1560.x6.nabble.com/Issue-with-standalone-python-script-and-PostGIS-Layers-td5098329.html

 http://hub.qgis.org/issues/9357


I see now that in pgadmin - tools - server status there are a lot
of locks after adding postgis layers in qgis and that they do
disappear only when closing qgis itself. Pressing new project does
not remove the locks.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-10 Thread Stott, James
This was the problem I was having a few months ago before 2.2 was released. I 
would run queries and they would never disappear on the server. So eventually 
the queries would stop running as the number of connections reached 100. 

I only got around it by adding layers and specifying that the layer does not 
look for styles in the PostGIS database (the False at the end there).

vlayer = QgsVectorLayer(uri.uri(), layerName, postgres, False)

I don't know if it is related to the code that looks for styles in the 
database, and if doesn't find one it doesn't shut down the connection?

James

-Opprinnelig melding-
Fra: qgis-developer-boun...@lists.osgeo.org 
[mailto:qgis-developer-boun...@lists.osgeo.org] På vegne av Giovanni Manghi
Sendt: 10. april 2014 13:46
Til: qgis-developer@lists.osgeo.org
Emne: Re: [Qgis-developer] working with qgis and pgadmin/psql...


 Yes - here's some more info/bug reports:

 http://hub.qgis.org/issues/7679

 http://osgeo-org.1560.x6.nabble.com/Issue-with-standalone-python-scrip
 t-and-PostGIS-Layers-td5098329.html

 http://hub.qgis.org/issues/9357


I see now that in pgadmin - tools - server status there are a lot of locks 
after adding postgis layers in qgis and that they do disappear only when 
closing qgis itself. Pressing new project does not remove the locks.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] working with qgis and pgadmin/psql...

2014-04-09 Thread Giovanni Manghi
Hi all,

while working with QGIS plus pgadmin and/or psql I often need to close
DB Manager or even QGIS entirely in oder to be able to perform some
operations with pgadmin/psql, even when QGIS is completely idle.

Is there any way to avoid this?

cheers

-- Giovanni --
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-09 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Il 09/04/2014 18:03, Giovanni Manghi ha scritto:
 Hi all,
 
 while working with QGIS plus pgadmin and/or psql I often need to close
 DB Manager or even QGIS entirely in oder to be able to perform some
 operations with pgadmin/psql, even when QGIS is completely idle.

confirmed, it's quite annoying.
all the best.

- -- 
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlNFcBIACgkQ/NedwLUzIr5ThACcCLozQr3jHJ4eMLWn7VRpZRVP
Ko8An1h9Hr5/RwHvJ3puUcgoMvKonI4n
=GbiQ
-END PGP SIGNATURE-
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-09 Thread Martin Dobias
Hi Giovanni

On Wed, Apr 9, 2014 at 6:03 PM, Giovanni Manghi
giovanni.man...@faunalia.pt wrote:
 Hi all,

 while working with QGIS plus pgadmin and/or psql I often need to close
 DB Manager or even QGIS entirely in oder to be able to perform some
 operations with pgadmin/psql, even when QGIS is completely idle.

 Is there any way to avoid this?

What versions are affected - dev / 2.2 / both?
What happens with QGIS / DB manager open? Waiting indefinitely / crash / ... ?

Maybe you are running out of available connections on the PostgreSQL
server - increasing their number in server configuration may help.

Cheers
Martin
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-09 Thread Giovanni Manghi
Hi Martin,

thanks for the answer.



 What versions are affected - dev / 2.2 / both?


I think both, for sure on master.


 What happens with QGIS / DB manager open? Waiting indefinitely / crash / ... ?


it happens that pgadmin/psql operations remain freezed, then when
closing qgis they immediately start and finish as expected.


 Maybe you are running out of available connections on the PostgreSQL
 server - increasing their number in server configuration may help.

on my local machine, for local work (just one user connected, me) I
have set postgresql.conf to accept max 100 connections, and still this
issue.
Should I put an higher value?


cheers!

-- G --
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] working with qgis and pgadmin/psql...

2014-04-09 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Il 09/04/2014 20:45, Giovanni Manghi ha scritto:

 What versions are affected - dev / 2.2 / both?
 
 
 I think both, for sure on master.

It's a long standing problem, present since I can remember.

 it happens that pgadmin/psql operations remain freezed, then when
 closing qgis they immediately start and finish as expected.

confirmed.

thanks.

- -- 
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlNGMwoACgkQ/NedwLUzIr48IACeKi0zj6R1iMIo+8JzQa4MAQEu
NYsAoIEZtgt9Q1skPwfSJk5dtfgRd5xA
=ubt+
-END PGP SIGNATURE-
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer