Thread: how can I tell it's postgresql data?

how can I tell it's postgresql data?

From
Ricardo Anguiano
Date:
Greetings,

I have recently been given some files and told they were "postgre SQL
database" files.  I have a couple of questions.

I am new to databases and postgresql.  I have managed to install
postgresql-7.2.2, initialize it, and get postmaster started under
FreeBSD 4.7-RELEASE.

Question #1: How can I tell if I have actual "postgresql database"
             files?  The files have no extension.  The `file` command
             reports the files are "MS-Windows true type font .ttf"
             files.

db_restore doesn't like the files:

        pg_restore: [archiver] input file does not appear to be a
        valid archive

Question #2: If these are database files, how can I get the data back
             in the database?

Any help will be appreciated.

Thanks,
--
Ricardo Anguiano
http://www.codesourcery.com

Re: how can I tell it's postgresql data?

From
Mike Grommet
Date:
Could they possibly be database dump files?  just text
files filled with the sql to build and populate
various tables?

you might be able to do a "more" of one of the
files...

Its an idea anyway... and I'm only guessing since I
have no idea what the files look like...


--- Ricardo Anguiano <anguiano@codesourcery.com>
wrote:
>
> Greetings,
>
> I have recently been given some files and told they
> were "postgre SQL
> database" files.  I have a couple of questions.
>
> I am new to databases and postgresql.  I have
> managed to install
> postgresql-7.2.2, initialize it, and get postmaster
> started under
> FreeBSD 4.7-RELEASE.
>
> Question #1: How can I tell if I have actual
> "postgresql database"
>              files?  The files have no extension.
> The `file` command
>              reports the files are "MS-Windows true
> type font .ttf"
>              files.
>
> db_restore doesn't like the files:
>
>         pg_restore: [archiver] input file does not
> appear to be a
>         valid archive
>
> Question #2: If these are database files, how can I
> get the data back
>              in the database?
>
> Any help will be appreciated.
>
> Thanks,
> --
> Ricardo Anguiano
> http://www.codesourcery.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: how can I tell it's postgresql data?

From
Ricardo Anguiano
Date:
Mike Grommet <mgrommet@yahoo.com> writes:

> Could they possibly be database dump files?  just text files filled
> with the sql to build and populate various tables?
>
> you might be able to do a "more" of one of the files...

I can open the file using emacs and see stuff like this in the
beginning:


Re: how can I tell it's postgresql data?

From
Aarni Ruuhimäki
Date:
Hi Ricardo !

If you edit the files and see something like below you have pgsql files. There
could also be DROP TABLE statements first, depending on the used dump switch.

You can read the dump files in the db by first creating a blank database

#createdb my_db

and then reading in the dump

# cat my_dump_file | psql my_db

You may bump into dump version mismatch problems if the dump files are much
older than your new system.

Hope this helps you.

BR,

aarni

>>>>>>>> snip >>>>>>>>>>>>>>>>>>>>>>
--
-- Selected TOC Entries:
--
\connect - postgres

--
-- TOC Entry ID 2 (OID 1057417)
--
-- Name: pga_queries Type: TABLE Owner: postgres
--

CREATE TABLE "pga_queries" (
    "queryname" character varying(64),
    "querytype" character(1),
    "querycommand" text,
    "querytables" text,
    "querylinks" text,
    "queryresults" text,
    "querycomments" text
);

--




On Wednesday 05 February 2003 10:36 pm, you wrote:
> Greetings,
>
> I have recently been given some files and told they were "postgre SQL
> database" files.  I have a couple of questions.
>
> I am new to databases and postgresql.  I have managed to install
> postgresql-7.2.2, initialize it, and get postmaster started under
> FreeBSD 4.7-RELEASE.
>
> Question #1: How can I tell if I have actual "postgresql database"
>              files?  The files have no extension.  The `file` command
>              reports the files are "MS-Windows true type font .ttf"
>              files.
>
> db_restore doesn't like the files:
>
>         pg_restore: [archiver] input file does not appear to be a
>         valid archive
>
> Question #2: If these are database files, how can I get the data back
>              in the database?
>
> Any help will be appreciated.
>
> Thanks,



Re: how can I tell it's postgresql data?

From
Tom Lane
Date:
Ricardo Anguiano <anguiano@codesourcery.com> writes:
> I have recently been given some files and told they were "postgre SQL
> database" files.  I have a couple of questions.

If the files contain text then they're probably dump scripts to feed to
psql.  They might also have been non-text pg_dump archives, but you seem
to have tried that possibility already.  The only other possibility is
that someone thought they could give you raw table files out of the
database innards ... in which case you'll have to go back to them and
ask for a proper pg_dump dump.  You cannot stick raw table files into
another installation.

            regards, tom lane