Re: [GENERAL] Question about loading up a table

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: [GENERAL] Question about loading up a table
Дата
Msg-id CAOR=d=2LTUXwTheztHuw5aE-jX--bFvsYiVvAjNLi+M5OrSVwA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Question about loading up a table  (vinny <vinny@xs4all.nl>)
Ответы Re: [GENERAL] Question about loading up a table
Список pgsql-general
On Mon, Jul 31, 2017 at 2:31 AM, vinny <vinny@xs4all.nl> wrote:
> On 2017-07-31 11:02, Alex Samad wrote:
>>
>> Hi
>>
>> I am using pg_dump | psql to transfer data from my old 9.2 psql into a
>> 9.6 psql.

Note that you should be doing pg_dump with 9.6's pg_dump, as it's
possible for 9.2's pg_dump to not know about a 9.6 feature.

>> The new DB server is setup as master replicating to a hot standby
>> server.
>>
>> What I have noticed is that the rows don't get replicated over until
>> the copy from stdin is finished...  hard to test when you have M+ lines
>> of rows.

SNIP

>> Is there a way to tell the master to replicate earlier
>
> I highly doubt it, because the master cannot know what to replicate until
> your transaction is ended with a COMMIT. If you end with ROLLBACK,
> or your last query is DELETE FROM (your_table>;
> then there isn't even anything to replicate at all...

This is actually a visibility issue. All the new changes are
replicated to the slave, but just like on the master, other
connections can't see the change because it's not visible. The slave,
except for some small delay (seconds etc) is an exact replica of the
master. So even a delete at the end gets replicated. You just don't
see anything but possible table bloat to show for it.

To prove this to oneself, start the copy, and get into another session
to the master. You don't see any rows there either until the commit
after the copy.


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

Предыдущее
От: Ed Behn
Дата:
Сообщение: Re: [GENERAL] Partitioned TEMP tables
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: [GENERAL] partitioning question