connection of collect with postgreSQL

  • Asked
  • Active
  • Viewed 8574 times
0

Hi every one, I want to connect my collect desktop with postgresql database. I followed the following procedure described here https://openforis.support/questions/1228/how-to-set-up-postgresql-server-for-new-collect I could not get success. how can I connect with it? Is there special process. what should I do in postgres database eg. the name of database, schema, username etc please guide me. thank you very much. The error msg was as this alt text

1

Accepted answer

Hi Raj kumar,
Good that you find yourself the way to setup Collect with PostgreSQL database.
The data you record is stored into the table ofc_record. Every record is stored into a binary column of that table (the columns data1 or data2 depending on the record's phase, entry or cleansing/analysis).
The reason why the data is stored in that format is because the structure of the data it's dynamic and depends on the survey schema structure. Anyway, we are planning to move from this way of storing the data into a more "open" way where the user can actually see the values stored for each record, but you will see the new structure only by the beginning of next year.
Many thanks,
Open Foris Team

0

Accepted answer

Hi all, I am successful to connect with postgres database. I changed username and password in collect.porperties file in Data folder. The password was that which I put when installing the postgres database. Now I can enter the data and save through collect desktop application.Now my new question is that in which table the data is stored that I entered? I have created a database named collect and schema also collect.

0

Accepted answer

Dear developers, is there any news about this issue? I also set up Collect with PostgreSQL and it would be a huge step forward if we would be able to access the data from there.

Regards, Lutz

0

Accepted answer

Dear Lutz,
We are still working on this, it will take time to change the way we store the records into the database.
Meanwhile, if you need to access the data using a relational database, you can consider accessing the relational database generated when using Saiku: this database is a SQLite database and is stored under c:\Users\YOUR_USERNAME\OpenForis\Collect\data\rdb.
For every survey there will be 3 different files (one per record "step").
Will it be sufficient for you?
Let us know, many thanks.
Open Foris Team

0

Accepted answer

Thank you, this is a solution I have not thought about so far. I tested it and it works nicely. I can now connect the sqlite .db directly to RStudio and can access all my tables and data there. Thank you for this hint, very useful!

For others who are looking for that, the respective R code to access the SQLite.db would be

library(RSQLite)

filename <- "C:/Users/YOUR USER ACCOUNT/OpenForis/Collect/data/rdb/YOUR.db"

sqlite.driver <- dbDriver("SQLite")

db <- dbConnect(sqlite.driver, dbname = filename)

dbListTables(db)

plots <- dbReadTable(db,"plot")

Lutz

0

Accepted answer

Hello, is there any news regarding saving data to a PostgreSQL database as normal entries which can be accessed from outside Open Foris (directly with SQL queries)?

0

Accepted answer

Dear Rok,
Unfortunately there are no new from this side. We will let you know when such a feature will be available.
Thanks,
Open Foris Team

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Tip: type a few words from the error message, or put a tag in [brackets] to look only there.

Menu

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.