Setup with PostGis db / Multiple PostGis stores?

8 views
Skip to first unread message

CoreyC

unread,
Mar 10, 2011, 7:18:25 AM3/10/11
to Studio
When I run "(env) $ paster setup-app my_studio.ini" with a PostGis
enabled database configured, I am receiving the error:

raise exc.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
sqlalchemy.exc.IntegrityError: (IntegrityError) column name is not
unique u'INSERT INTO "group" (name) VALUES (?)' ['admin']

I have installed the psycopg2 egg under python 2.6.5, the database
configuration line is correct.

I am able to setup and run Studio if I do not specify a PostGis db.

Also, is it possible to define more than one PostGis db? Can I define
the db from the javascript console?

Thanks!

Bruno Binet

unread,
Mar 10, 2011, 7:45:16 AM3/10/11
to studio-...@googlegroups.com, CoreyC
On 10 March 2011 13:18, CoreyC <fruit...@gmail.com> wrote:
> When I run "(env) $ paster setup-app my_studio.ini" with a PostGis
> enabled database configured, I am receiving the error:
>
> raise exc.DBAPIError.instance(statement, parameters, e,
> connection_invalidated=is_disconnect)
> sqlalchemy.exc.IntegrityError: (IntegrityError) column name is not
> unique u'INSERT INTO "group" (name) VALUES (?)' ['admin']

The paster setup-app command should be executed only once. The second
time you execute the paster setup-app command, it will fail because it
tries to insert the admin user in db which already exists. Drop the db
first if you want to execute setup-app again.

> I have installed the psycopg2 egg under python 2.6.5, the database
> configuration line is correct.
>
> I am able to setup and run Studio if I do not specify a PostGis db.
>
> Also, is it possible to define more than one PostGis db?

No, for the moment you can specify only one postgis datastore which
have to be defined in your .ini file by setting the
default_datastore_postgis conf key.

> Can I define
> the db from the javascript console?

No, the postgis datastore is defined on server side.

> Thanks!
>

--
Bruno Binet

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Mail : bruno...@camptocamp.com
http://www.camptocamp.com

fruitwerks

unread,
Mar 10, 2011, 7:55:51 AM3/10/11
to Bruno Binet, studio-...@googlegroups.com
Thanks Bruno,

But this error will pop up on a fresh PostGis db in a new studio install. If you swear this should not happen, I will try again to make sure I can replicate this every time.

- Corey C

Bruno Binet

unread,
Mar 10, 2011, 8:44:17 AM3/10/11
to fruitwerks, studio-...@googlegroups.com
Yes, I think this should not happen if the database does not already
contain a group 'admin'.
The error log sounds quite explicit to me: (IntegrityError) column name is

not unique u'INSERT INTO "group" (name) VALUES (?)' ['admin']

fruitwerks

unread,
Mar 10, 2011, 10:02:54 AM3/10/11
to studio-...@googlegroups.com, Bruno Binet
Thanks again - I realized this has nothing to do with postgres in my case. I was using an sqlite db for Studio and added a PostGis db for data. Since I had no work to preserve, I simply deleted the sqlite db and ran the script again.

Working great now!
--
_______________________________________________________________________________
Any use, dissemination, distribution, posting on Internet bulletin boards, disclosure or copying of this e-mail or any information contained herein by or to anyone other than the intended recipient(s) is strictly prohibited. Use of this content for any other purpose is a violation of International Copyright Laws.

Reply all
Reply to author
Forward
0 new messages