Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

HOW TO ACCESS OPENERP7 DATABASE TABLES, VIA PSQL COMMAND LINE ?

By
Yassine TEIMI
on 11/17/14, 6:42 AM 1,673 views

On shell, I changed the user to the postgres user, and I accessed my desired DATABASE, with "psql db_name", I want now to access tables of "db_name"  , so as to access the openerp views table for example.

Wich command line necessary to do that ? I'm on ubuntu server 12.04 LTS.

3

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 11/17/14, 7:19 AM

First You can check available database list using \l command(ie. backslash el)

Now type the below command to connect/select a desired database: here i try to connect to the testdb database:

\c testdb;

Then a message appears --> You are now connected to database "testdb" as user "postgres"

After this you can enter your query...

You can use \dt  to lists all tables in the current database

Thanks a lot, I want to update modules list for specified database, via command line, how to do that ?

Yassine TEIMI
on 11/17/14, 7:39 AM

Done, Now about update modules list, I tried to go on the location of the openerp-server file, on my specidied PATH: /opt/openerp/server, and I typed : python openerp-server --update=all But it shows me following error : Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 504, in run self.__target(*self.__args, **self.__kwargs) File "/opt/openerp/server/openerp/service/wsgi_server.py", line 436, in serve httpd = werkzeug.serving.make_server(interface, port, application, threaded=True) File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 399, in make_server passthrough_errors, ssl_context) File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 331, in __init__ HTTPServer.__init__(self, (host, int(port)), handler) File "/usr/lib/python2.7/SocketServer.py", line 408, in __init__ self.server_bind() File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind SocketServer.TCPServer.server_bind(self) File "/usr/lib/python2.7/SocketServer.py", line 419, in server_bind self.socket.bind(self.server_address)

Yassine TEIMI
on 11/17/14, 8:19 AM

For example I have a table : T1 on the current database I'm connected to. How to list the columns of this table T1 ? After connecting to the database I did : SELECT * FROM ir_ui_view But no result displayed on the screen ...

Yassine TEIMI
on 11/17/14, 9:26 AM
0
Yassine TEIMI
On 11/17/14, 8:52 AM

Baiju,

I'm now able to list the tables of a database, the purpose of this manipulation is because of an issue : 

I deleted a custom field x_entrpt, via the configuration module, but the field x_entrpt still exist on the view, so it generated xml architecture error, and now I am enable to connect to my openerp erp account via web client.

The field deleted still exist on the res_users view, so now I decided to enter the res_users view, from pgsql, there is a table ir_ui_view, it contains all the views of the current database, I need to access the views table, and delete from the res_users view the field x_entrpt.

I need to know the sql query to do that. thanks.

 

You can use normal sql queries like " select * from ir_ui_view; "

Baiju
on 11/17/14, 10:53 AM

Yassine, you check the commands for psql (command line tool for PostgreSQL) using \?. If you need help on SQL commands you can use \h [SQL Commands].

Ivan
on 11/18/14, 3:40 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/17/14, 6:42 AM
Seen: 1673 times
Last updated: 3/16/15, 8:10 AM