Re: pg_restore error

From: pascal bérest <lists(at)magnetophone(dot)com>
To: Adam Witney <awitney(at)sghms(dot)ac(dot)uk>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore error
Date: 2002-10-10 13:23:54
Message-ID: a05111718b9cb2f7d712c@[80.236.54.8]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 13:38 +0100 10/10/2002, Adam Witney wrote:
>On 10/10/02 1:25 pm, "pascal bérest" <lists(at)magnetophone(dot)com> wrote:
>
>>> Are you sure the synd_article table and cable_id_cable_seq sequence aren't
>>> already in the database?
>>
>> yes, there are existing.
>>
>>> Presumably your dump file contains the create statements for these two
>>> objects and so the pg_restore is trying to create them.
>>>
>>> How did you create the dump file? The -a switch will allow you to dump only
>>> the data if that's what you need. Looks like you may be dumping the schema
>>> as well
>>
>> I tried with the -a option, and it was quite the same.
>> I just tried to delete the synd_article_pkey then restore the table
>> synd_article, but it didn't recreate the keys as they were. and i
>> don't know how to do that (as i am using mysql for my other projects
>> and that it seams to be more simple).
>>
>
>What happened when you tried the -a option?

i have quite the same error. i have a message telling that the key
can't be duplicate. i suppose that as the id is already existing, it
can't duplicate it, as in mysql.

>You can create a table with a primary key like so
>
>CREATE TABLE test (
> id int,
> PRIMARY KEY (id)
>);

yep, but is a way to create a primary key when the table already exists ?

thanx,
pascal.
--

http://www.magnetophone.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2002-10-10 13:25:23 Re: Problem running postgre as a windows NT service
Previous Message Cornelia Boenigk 2002-10-10 13:16:24 Announcement: New German PostgreSQL book