# How to extract data from postgresql to knime?

**URL:** <https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560>\
**Category:** BioInformatics\
**Tags:** database\
**Created:** [April 15, 2023, 3:55pm UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560 "2023-04-15T15:55:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valunce](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/v/71e660/32.png) [@Valunce](https://forum.knime.com/u/Valunce)\
**Post date:** [April 15, 2023, 3:55pm UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/1 "2023-04-15T15:55:10Z")

</div>

I want to move data of chembl\_32 into knime to analyze, therefore i take the steps as below. Currently, I take my action on the step 4 and don’t know how to process. I am very grateful if someone can guide me directly or send me the tutorial.

Questions:

1. Could you please tell me if my action is right?
2. Could you tell me how to make sure the data had been moved into KNIME and how to extract them?

Actions:

1. Download documents of chembl\_32.dmp file from CheMBL.
2. Install postgreSQL
3. Enter data of chembl\_32.dmp into postgresql
4. Setting up the postgreSQL connector in knime to connect data chembl\_32. The figure of configuration is shown below.

Forgive me, I am a beginner.  
Thank you very much!  
Daiyan

 ![configuration](https://forum-cdn.knime.com/uploads/default/original/3X/2/1/2115a0edfe8e9c6ffc46d38782e42677b2e223c9.jpeg)

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [April 16, 2023, 1:03pm UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/2 "2023-04-16T13:03:36Z")

</div>

Hi,  
Welcome to the KNIME Forum! It depends on how exactly you imported the data into Postgres. It seems like you use the name of your dataset as the database name, but generally a dataset corresponds to one of many tables inside a database. I believe the default database in Postgres is named “postgres”. After successful connection to the right database, you have to append a [DB Table Selector](https://kni.me/n/PEWSVICzt9HX-3cd) and then a [DB Reader](https://kni.me/n/d8TQIqNnO3XRVTjQ) to read the data.  
Kind regards  
Alexander

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [April 16, 2023, 3:48pm UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/3 "2023-04-16T15:48:16Z")

</div>

> [@Valunce](#):
>
> chembl\_32.dmp file from CheMBL

This sounds like a Postgres SQL dump file. I could not immediately found it. You will have to import it into the database first most likely:

> **[26.1. SQL Dump](https://www.postgresql.org/docs/current/backup-dump.html)**
>
> 26.1. SQL Dump # 26.1.1. Restoring the Dump 26.1.2. Using pg\_dumpall 26.1.3. Handling Large Databases The idea behind this dump method …

Then there seem to be SQLite versions of this database - I was not immediately able to find them though. SQLite might be easier to import into KNIME without additional installations necessary.

> **[KNIME and SQLite - simple example (4.0 New DB nodes) – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/sqlite_knime_40/t_001_sqlite_knime_40_db_nodes~TXkb0Dqco-l8mx95/current-state)**
>
> this demonstrates the use of a local SQLite database where you can store data and keep the variable type and perform database operations on. Also the data is r…

---

<div class="post-metadata">

**Author:** ![Valunce](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/v/71e660/32.png) [@Valunce](https://forum.knime.com/u/Valunce)\
**Post date:** [April 17, 2023, 2:31am UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/4 "2023-04-17T02:31:46Z")

</div>

Dear Alexander,

Thanks a lot! It works now. I think my question is the configuration of the node postgreSQL connector and DB Table Selector.

Best regards,  
Daiyan

---

<div class="post-metadata">

**Author:** ![Valunce](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/v/71e660/32.png) [@Valunce](https://forum.knime.com/u/Valunce)\
**Post date:** [April 17, 2023, 2:37am UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/5 "2023-04-17T02:37:30Z")

</div>

Dear mlauber71,

Thanks for you help and send me the tutorial of SQLite. It seems that SQLite is more friendly and I did meet so many problems when I install postgreSQL and send data into it.

It works now after I correct the configuration of node postgreSQL connector. I will try the SQLite again following the example you supplied. I just see that you create one day ago. Anyway, thanks for your kindly help.

Best regards,  
Daiyan

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [April 17, 2023, 4:37am UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/6 "2023-04-17T04:37:33Z")

</div>

> [@Valunce](#):
>
> I will try the SQLite again following the example you supplied. I just see that you create one day ago.

Glad you like it. The example is in fact much older but I took your question as an inspiration to give it an update and add the Python part.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [July 16, 2023, 4:38am UTC](https://forum.knime.com/t/how-to-extract-data-from-postgresql-to-knime/65560/7 "2023-07-16T04:38:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
