dbTalk Databases Forums  

[PHP] Importing data in postgres from .sql file

mailing.database.pgsql-php mailing.database.pgsql-php


Discuss [PHP] Importing data in postgres from .sql file in the mailing.database.pgsql-php forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Archana K N
 
Posts: n/a

Default [PHP] Importing data in postgres from .sql file - 09-05-2012 , 02:19 AM






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
--------------------

Reply With Quote
  #2  
Old   
Fabrízio de Royes Mello
 
Posts: n/a

Default Re: [PHP] Importing data in postgres from .sql file - 09-05-2012 , 06:42 AM






2012/9/5 Archana K N <archanakknn (AT) gmail (DOT) com>

Quote:
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
Quote:
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.