Re: Odd messages on reloading DB table

Поиск
Список
Период
Сортировка
От Steve Wampler
Тема Re: Odd messages on reloading DB table
Дата
Msg-id 1ee763b7-b6be-8561-f17c-7a384649072b@nso.edu
обсуждение исходный текст
Ответ на Odd messages on reloading DB table  (Steve Wampler <swampler@nso.edu>)
Список pgsql-general
On 2/7/19 9:28 AM, Steve Wampler wrote:
> With PostgreSQL 9.5.15, I ran:
> 
>     pg_dump -t targets -d atst.experimentdb >nT.db
> 
> then I ran:
> 
>     psql -h langley atst.experimentdb <nT.db
> 
> and got:
...
>     ERROR:  relation "targets" already exists
>     ALTER TABLE
>     ERROR:  relation "targets" does not exist
>     LINE 1: UPDATE targets SET             time_stamp=new.time_stamp,   ...
>                 ^
>     QUERY:  UPDATE targets SET             time_stamp=new.time_stamp,            modified=new.modified, 
> id=new.id,            targets=new.targets     WHERE (id=new.id)
>     CONTEXT:  PL/pgSQL function public.targets_insert_or_update() line 1 at SQL statement
>     COPY targets, line 1: "2017-10-31 09:37:28.798152    t    az_el_target 
> {"name":"AZ_EL_Targets","priority":10,"tags":["{\\"Tag.tag..."
>     ERROR:  relation "id_id_targets" already exists
>     ERROR:  relation "time_stamp_id_targets" already exists
>     ERROR:  trigger "targets_trigger_insert" for relation "targets" already exists
> ERROR:  trigger "targets_trigger_update" for relation "targets" already exists
> REVOKE
> REVOKE
> GRANT
> GRANT
> 
> Eh?  It looks like it worked (maybe), but why:
> 
>     (1) the table already exist and the immediately doesn't exist?
>     (2) report ERROR on UPDATE when there are no UPDATES in the input file?

I take it back.  The content of the table was not restored to the values in nT.db afterall.
-- 
Steve Wampler -- swampler@nso.edu
The gods that smiled on your birth are now laughing out loud.


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

Предыдущее
От: Steve Wampler
Дата:
Сообщение: Odd messages on reloading DB table
Следующее
От: Michel Pelletier
Дата:
Сообщение: Re: How to add a new psql command ?