pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Importing Database
4+ messages / 4 participants
[nested] [flat]

* Importing Database
@ 2002-06-24 15:30  acchung@mit.edu
  0 siblings, 3 replies; 4+ messages in thread

From: acchung@mit.edu @ 2002-06-24 15:30 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I'm trying to import this database into postgresql.
The file is called 20020422_project_summaries.gz.
When I gunzip it, I get:

postgres@E52BPS588R /Databases
$ gunzip 20020422_project_summaries.gz

gunzip: 20020422_project_summaries.gz: not in gzip format

When I type less 20020422_project_summaries.gz, I get the
text of the database of this file.  So it seems that it's already unzipped
but has the .gz extension.  how do I import this file 
as a database into postgresql?  I'm running cygwin and pgAdmin II
on a win2k computer.

Alex





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Importing Database
@ 2002-06-25 00:32  Lee Harr <missive@frontiernet.net>
  parent: acchung@mit.edu
  2 siblings, 0 replies; 4+ messages in thread

From: Lee Harr @ 2002-06-25 00:32 UTC (permalink / raw)
  To: pgsql-admin

> When I type less 20020422_project_summaries.gz, I get the
> text of the database of this file.  So it seems that it's already unzipped
> but has the .gz extension.  how do I import this file 
> as a database into postgresql?  I'm running cygwin and pgAdmin II
> on a win2k computer.
> 


I am no w2k or cygwin expert, but you could try:

cd /dir/where/20020422_... exists
psql
create database my_new_db;
\c my_new_db
\i 20020422_project_summaries.gz

This sort of assumes that file is from pg_dump and is not
just a csv (or some other format) of plain data.
If it is just data, you would need to create your
table structure, then \copy or COPY the data in to
the tables.






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Importing Database
@ 2002-06-25 01:57  Nick Fankhauser <nickf@ontko.com>
  parent: acchung@mit.edu
  2 siblings, 0 replies; 4+ messages in thread

From: Nick Fankhauser @ 2002-06-25 01:57 UTC (permalink / raw)
  To: acchung@mit.edu; pgsql-admin

Well, since it is already in text format, just load it normally:

psql <database name> -f 20020422_project_summaries.gz

psql doesn't care what the name is so long as the internal format is OK.

If you want to, you can rename it. (I probably would to avoid confusion
among the humans.)

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/

> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of acchung@mit.edu
> Sent: Monday, June 24, 2002 10:30 AM
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] Importing Database
>
>
> Hi,
>
> I'm trying to import this database into postgresql.
> The file is called 20020422_project_summaries.gz.
> When I gunzip it, I get:
>
> postgres@E52BPS588R /Databases
> $ gunzip 20020422_project_summaries.gz
>
> gunzip: 20020422_project_summaries.gz: not in gzip format
>
> When I type less 20020422_project_summaries.gz, I get the
> text of the database of this file.  So it seems that it's already unzipped
> but has the .gz extension.  how do I import this file
> as a database into postgresql?  I'm running cygwin and pgAdmin II
> on a win2k computer.
>
> Alex
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Importing Database
@ 2002-06-25 03:58  Rajesh Kumar Mallah. <mallah@trade-india.com>
  parent: acchung@mit.edu
  2 siblings, 0 replies; 4+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-06-25 03:58 UTC (permalink / raw)
  To: acchung@mit.edu; pgsql-admin


rename 20020422_project_summaries.gz as 20020422_project_summaries.sql

and load it using psql.

regds
mallah

On Monday 24 June 2002 21:00, acchung@mit.edu wrote:
> Hi,
>
> I'm trying to import this database into postgresql.
> The file is called 20020422_project_summaries.gz.
> When I gunzip it, I get:
>
> postgres@E52BPS588R /Databases
> $ gunzip 20020422_project_summaries.gz
>
> gunzip: 20020422_project_summaries.gz: not in gzip format
>
> When I type less 20020422_project_summaries.gz, I get the
> text of the database of this file.  So it seems that it's already unzipped
> but has the .gz extension.  how do I import this file
> as a database into postgresql?  I'm running cygwin and pgAdmin II
> on a win2k computer.
>
> Alex
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.







^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-06-25 03:58 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-24 15:30 Importing Database acchung@mit.edu
2002-06-25 00:32 ` Lee Harr <missive@frontiernet.net>
2002-06-25 01:57 ` Nick Fankhauser <nickf@ontko.com>
2002-06-25 03:58 ` Rajesh Kumar Mallah. <mallah@trade-india.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox