unfortunately undocumented and a bit hidden. it's a two lines comment in a source file (plugins/imex/csv_.py#72).
# TODO: what happens when you export from one
database type and try
# and import into a different database, e.g.
postgres->sqlite
from time to time I've been converting batches of such lines into issues, but I've not been very consistent, and I never processed this particular file.
feel free to open an issue and since you have experimented, you can also add a description of what happens in the sqlite3->postgresql case.thank you!
let me know if you did manage with the procedure I was describing in my previous answer.
ciao,
Mario
--
You received this message because you are subscribed to the Google Groups "ghini/bauble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bauble+un...@googlegroups.com.
To post to this group, send email to bau...@googlegroups.com.
Visit this group at https://groups.google.com/group/bauble.
For more options, visit https://groups.google.com/d/optout.
Ciao Mario,
I was able to convert the sqlite database to postgres using pgloader. Unfortunately, ghini then does not work with the postgres connection.
This is the error:
Could not open connection.
(psycopg2.ProgrammingError) permission denied for relation bauble
[SQL: 'SELECT bauble.name AS bauble_name, bauble.value AS bauble_value, bauble.id AS bauble_id, bauble._created AS bauble__created, bauble._last_updated AS bauble__last_updated \nFROM bauble \nWHERE bauble.name = %(name_1)s \n LIMIT %(param_1)s'] [parameters: {'name_1': u'created', 'param_1': 1}]
Details:
Traceback (most recent call last):
File "/home/user/.virtualenvs/ghide/local/lib/python2.7/site-packages/ghini.desktop-1.0.86-py2.7.egg/bauble/__init__.py", line 316, in main
if db.open(uri, True, True):
File "/home/user/.virtualenvs/ghide/local/lib/python2.7/site-packages/ghini.desktop-1.0.86-py2.7.egg/bauble/db.py", line 314, in open
verify_connection(new_engine, show_error_dialogs)
File "/home/user/.virtualenvs/ghide/local/lib/python2.7/site-packages/ghini.desktop-1.0.86-py2.7.egg/bauble/db.py", line 415, in verify_connection
return verify_connection(engine, False)
File "/home/user/.virtualenvs/ghide/local/lib/python2.7/site-packages/ghini.desktop-1.0.86-py2.7.egg/bauble/db.py", line 463, in verify_connection
result = query(meta.BaubleMeta).filter_by(name=meta.CREATED_KEY).first()
File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2445, in first
ret = list(self[0:1])
File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2281, in __getitem__
return list(res)
File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2516, in __iter__
return self._execute_and_instances(context)
File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2531, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "build/bdist.linux-x86_64/egg/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "build/bdist.linux-x86_64/egg/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
ProgrammingError: (psycopg2.ProgrammingError) permission denied for relation bauble
[SQL: 'SELECT bauble.name AS bauble_name, bauble.value AS bauble_value, bauble.id AS bauble_id, bauble._created AS bauble__created, bauble._last_updated AS bauble__last_updated \nFROM bauble \nWHERE bauble.name = %(name_1)s \n LIMIT %(param_1)s'] [parameters: {'name_1': u'created', 'param_1': 1}]
You received this message because you are subscribed to a topic in the Google Groups "ghini/bauble" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bauble/60MHqR5dQk0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bauble+un...@googlegroups.com.
buongiorno Corrado!
postgresql, unlike sqlite, has a complete user permissions management system. you need to grant privileges to your users. this is (superficially) described in the docs (check the 'initial configuration' chapter), and I believe there should be links to the postgresql manuals.
»When connecting to a database server [other than SQLite], you have to manually do the following: Create at least one user; Create your database; Give at least one user full permissions on your database; If you plan having more database users: Give one of your users the CREATEROLE privilege; Consider the user with the CREATEROLE privilege as a super-user, not meant to handle data directly; Keep your super-user credentials in a very safe place.«
we also have a 'scripts/create-role.sh' file, which tells you
what it is that you need to do.
the 'alter role' following the 'create role' is in case the role already exists and you want to fix it.
once you manage to connect, you will find some minimal user management tools in ghini.desktop, straight from the main menu.
let me know if this helps.
ciao,
Mario
I don't know if this that you suggest would work too, what I meant is what is written in the script I mentioned.
I'll copy it here for your Italian laziness ;-)
#!/bin/bash
USER=$1
PASSWD=$2
shift 2
cat <<EOF | psql bauble -U bauble $@
create role $USER with login password '$PASSWD';
alter role $USER with login password '$PASSWD';
grant all privileges on all tables in schema public to $USER;
grant all privileges on all sequences in schema public to $USER;
grant all privileges on all functions in schema public to $USER;
EOF
I know that this works. if your version works, I don't know. try it out and you tell me.
ciao,
Mario
passiamo all'italiano perché ora sono io a non capire.
1. hai creato/alterato i tuoi utenti usando lo script che ti ho indicato e copiato?
2. hai creato un utente intermedio per la gestione del tuo database ghini?
3. hai letto e seguito in particolare la sezione espandibile 'Some more hints if you need PostgreSQL'?
4. sei riuscito a connetterti alla tua base dati con la linea menzionata a conclusione di quella sezione?
per aiutarti con la 4 ho bisogno che tu risponda "SI" alle prime
tre. ;-)
fammi sapere,
Mario
You received this message because you are subscribed to the Google Groups "ghini/bauble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bauble+un...@googlegroups.com.
d'accordo, niente --no-password,
ma per il resto, riesci, o non riesci a connetterti?
voglio dire: hai deciso di voler configurare ghini.desktop in modo che si connetta utilizzando un utente specifico.
puoi o non puoi ora utilizzare questo stesso utente per
connetterti da linea di comando?
non ho capito se hai (modificato ed) eseguito lo script che ti ho indicato, per alterare o per creare l'utente che hai deciso di utilizzare.
fammi capire,
Mario
You received this message because you are subscribed to the Google Groups "ghini/bauble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bauble+un...@googlegroups.com.
Hi Corrado!
I can confirm that the procedure I was describing, even if it's a bit of work on your side, would just work.
so you let ghini.desktop create a fresh database in your database
server, using the credentials you prefer. part of what ghini does
you need to undo, namely you need to remove everything from the
genus_synonym, genus, family_synonym, family, in this order. and
you need to remove everything from the bauble table. just to be
safe, remove everything, but take care of the order in which you
do this.
the extra work you need to execute is:
- remove all create statements.
- replace them with the corresponding delete from <table>;
- put these delete from statements in the correct order (as described above),
- correct the boolean values. this is the nasty/boring part.
you need to replace all zeroes and ones that really mean 'f' and
't' (false and true). you need to do this by hand, or you can
write a script, or you can trust the search and replace of your
text editor of choice. the fastest for you (and possibly also for
me) would be if you would send me the dump and let me edit it. by
the way: donations are always welcome. ;-)
anyhow, I've done the above for a smallish database and it just worked.

so, try again, or let me know.
ciao,
Mario
sembrano centinaia di errori, ma è il primo che ti dice che cosa è successo, mentre gli altri sono semplicemente "ho incontrato un primo errore, e non posso proseguire".
leggi l'altro messaggio che ho appena inviato alla lista, in inglese, che ti descrive la procedura che ho seguito e che mi ha prodotto un database utilizzabile.
prima o poi potrei scrivere uno script che automatizza i passi.
non sono per nulla complicati, se fatti in automatico, l'unico
minimo problema è il parsing dello SQL.
ciao,
Mario
You received this message because you are subscribed to the Google Groups "ghini/bauble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bauble+un...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "ghini/bauble" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bauble/60MHqR5dQk0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bauble+un...@googlegroups.com.
I am trying to migrate from Sqlite to PostgreSQL. I exported the Sqlite database in all possible forms and tried to re import it, but cannot make it work. Help! :)