Getting rid of duplicate tables.

Поиск
Список
Период
Сортировка
От Jared Carr
Тема Getting rid of duplicate tables.
Дата
Msg-id 400C0674.2090007@89glass.com
обсуждение исходный текст
Ответы Re: Getting rid of duplicate tables.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
First I wish I knew how this was caused but here is our problem.

Sometime in the recent past we got a duplicate table.  Here is the
result of a pg_dump with a pg_restore for just that table.

--
-- TOC entry 59 (OID 11462032)
-- Name: order_to_do; Type: TABLE; Schema: public; Owner: www
-- Data Pos: 0
--

CREATE TABLE order_to_do (
    order_id integer DEFAULT 0 NOT NULL,
    to_do_id text DEFAULT ''::text NOT NULL,
    date_time timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    csr_id integer DEFAULT 0 NOT NULL,
    supplement text DEFAULT ''::text NOT NULL
);


--
-- TOC entry 60 (OID 11462032)
-- Name: order_to_do; Type: TABLE; Schema: public; Owner: www
-- Data Pos: 0
--

CREATE TABLE order_to_do (
    order_id integer DEFAULT 0 NOT NULL,
    to_do_id text DEFAULT ''::text NOT NULL,
    date_time timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    csr_id integer DEFAULT 0 NOT NULL,
    supplement text DEFAULT ''::text NOT NULL
);

So somehow it appears that we managed to get an *exact* duplicate of the table well at least
a duplicate reference to the table somewhere important.

First of all how do we get rid of this "extra" table?

Note:
  live=# drop table order_to_do;
  ERROR: duplicate key violates unique constraint "pg_class_oid_index"

Secondly any ideas on how it got there in the first place?

Can this just happen? Or did someone here have to accidentally do something
to create it.

Sorry for not having any idea on what caused this, but thanks for any help you can
give.

Jared



В списке pgsql-general по дате отправления:

Предыдущее
От: "Mark Cave-Ayland"
Дата:
Сообщение: Re: indexing with lower(...) -> queries are not optimised very well - Please Help
Следующее
От: Mental
Дата:
Сообщение: Re: importing data