Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Importing data in postgres from .sql file

0 views
Skip to first unread message

Archana K N

unread,
Sep 5, 2012, 3:19:44 AM9/5/12
to





Hi,

    I used the "Export" option in the phpPgAdmin for exporting certain database and i got a zip file with .sql file inside it. I dont know how to import it back to postgres as i dont see any option for importing. I am a bit confused with the psql command prompt. Can anyone please help me to import the data back.
    

--
-------------------
regards
archana
--------------------



--
-------------------
regards
archana
--------------------

Fabrízio de Royes Mello

unread,
Sep 5, 2012, 7:42:34 AM9/5/12
to

2012/9/5 Archana K N <archa...@gmail.com>


    I used the "Export" option in the phpPgAdmin for exporting certain database and i got a zip file with .sql file inside it. I dont know how to import it back to postgres as i dont see any option for importing. I am a bit confused with the psql command prompt. Can anyone please help me to import the data back.
    

Hi,

You can use the psql command line:

$ unzip -c name_of_your_file.zip | psql -U postgres name_of_your_database
 
Regards,

-- 
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com

0 new messages