Обсуждение: pgsql: Documentation for logical decoding.

Поиск
Список
Период
Сортировка

pgsql: Documentation for logical decoding.

От
Robert Haas
Дата:
Documentation for logical decoding.

Craig Ringer, Andres Freund, Christian Kruse, with edits by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/49c0864d7ef5227faa24f903902db90e5c9d5d69

Modified Files
--------------
doc/src/sgml/catalogs.sgml           |   27 +-
doc/src/sgml/filelist.sgml           |    1 +
doc/src/sgml/func.sgml               |   99 ++++++
doc/src/sgml/logicaldecoding.sgml    |  560 ++++++++++++++++++++++++++++++++++
doc/src/sgml/postgres.sgml           |    1 +
doc/src/sgml/protocol.sgml           |   52 +++-
doc/src/sgml/ref/allfiles.sgml       |    1 +
doc/src/sgml/ref/alter_table.sgml    |    2 +-
doc/src/sgml/ref/create_table.sgml   |   15 +-
doc/src/sgml/ref/pg_recvlogical.sgml |  331 ++++++++++++++++++++
doc/src/sgml/reference.sgml          |    1 +
11 files changed, 1085 insertions(+), 5 deletions(-)


Re: pgsql: Documentation for logical decoding.

От
Thom Brown
Дата:
On 18 March 2014 17:21, Robert Haas <rhaas@postgresql.org> wrote:
> Documentation for logical decoding.
>
> Craig Ringer, Andres Freund, Christian Kruse, with edits by me.

In doc/src/sgml/logicaldecoding.sgml:

s/demonstartes/demonstrates/

s/ot at least 1/to at least 1/


In this example:

+postgres=# SELECT * FROM
pg_logical_slot_get_changes('regression_slot', NULL, NULL);
+ location  | xid |                     data
+-----------+-----+-----------------------------------------------
+ 0/16E0478 | 689 | BEGIN 689
+ 0/16E0478 | 689 | table public.data: INSERT: id[int4]:1 data[text]:'1'
+ 0/16E0580 | 689 | table public.data: INSERT: id[int4]:2 data[text]:'2'
+ 0/16E0650 | 689 | COMMIT 689
+(4 rows)

I actually get the "int4" shown as "integer":

# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
 location  | xid |                          data
-----------+-----+---------------------------------------------------------
 0/16B98E0 | 772 | BEGIN 772
 0/16B9910 | 772 | table public.data: INSERT: id[integer]:1 data[text]:'1'
 0/16B9A18 | 772 | table public.data: INSERT: id[integer]:2 data[text]:'2'
 0/16B9AF0 | 772 | COMMIT 772
(4 rows)

The same applies to subsequent examples.


"without loosing any changes"

s/loosing/losing/


"or have are marked as user"

s/are/been/


s/Successfull/Successful/

s/exectuded/executed/


"an replication slot"

s/an/a/


s/paramter/parameter/


I'd have put this in a patch, but I don't know if the output in the
example is wrong, or just dependent on environmental factors.

Regards

Thom


Re: pgsql: Documentation for logical decoding.

От
Andres Freund
Дата:
On 2014-03-18 18:12:25 +0000, Thom Brown wrote:
> I'd have put this in a patch, but I don't know if the output in the
> example is wrong, or just dependent on environmental factors.

It's out of date, it should be integer now, so please submit a bug.

I wonder if we should change stuff that types are always schema
prefixed, instead of just when required because of search_path?

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: pgsql: Documentation for logical decoding.

От
Thom Brown
Дата:
On 18 March 2014 18:16, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-03-18 18:12:25 +0000, Thom Brown wrote:
>> I'd have put this in a patch, but I don't know if the output in the
>> example is wrong, or just dependent on environmental factors.
>
> It's out of date, it should be integer now, so please submit a bug.
>
> I wonder if we should change stuff that types are always schema
> prefixed, instead of just when required because of search_path?

Patch attached.

--
Thom

Вложения

Re: pgsql: Documentation for logical decoding.

От
Fujii Masao
Дата:
On Wed, Mar 19, 2014 at 2:21 AM, Robert Haas <rhaas@postgresql.org> wrote:
> Documentation for logical decoding.
>
> Craig Ringer, Andres Freund, Christian Kruse, with edits by me.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/49c0864d7ef5227faa24f903902db90e5c9d5d69
>
> Modified Files
> --------------
> doc/src/sgml/catalogs.sgml           |   27 +-
> doc/src/sgml/filelist.sgml           |    1 +
> doc/src/sgml/func.sgml               |   99 ++++++
> doc/src/sgml/logicaldecoding.sgml    |  560 ++++++++++++++++++++++++++++++++++
> doc/src/sgml/postgres.sgml           |    1 +
> doc/src/sgml/protocol.sgml           |   52 +++-
> doc/src/sgml/ref/allfiles.sgml       |    1 +
> doc/src/sgml/ref/alter_table.sgml    |    2 +-
> doc/src/sgml/ref/create_table.sgml   |   15 +-
> doc/src/sgml/ref/pg_recvlogical.sgml |  331 ++++++++++++++++++++
> doc/src/sgml/reference.sgml          |    1 +
> 11 files changed, 1085 insertions(+), 5 deletions(-)

In the example of usage of pg_recvlogical, I think it's better to use
postgres database
instead of testdb because the document says "in the example below,
postgres" at the
top of the page and the postgres database is also used in the example
of usage of
pg_create_logical_replication_slot(). Attached patch changes the
example that way
and does some minor improvements.


Regards,

--
Fujii Masao

Вложения

Re: pgsql: Documentation for logical decoding.

От
Andres Freund
Дата:
On 2014-03-19 21:59:25 +0900, Fujii Masao wrote:
> Attached patch changes the example that way and does some minor improvements.

That patch is fine with me.

Thanks,

Andres Freund


Re: pgsql: Documentation for logical decoding.

От
Fujii Masao
Дата:
On Wed, Mar 19, 2014 at 10:06 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-03-19 21:59:25 +0900, Fujii Masao wrote:
>> Attached patch changes the example that way and does some minor improvements.
>
> That patch is fine with me.

Thanks for checking the patch! Will commit.

LOGICAL option was added into CREATE_REPLICATION_SLOT, but it's not
been documented.
protocol.sgml should be updated?

Regards,

--
Fujii Masao


Re: pgsql: Documentation for logical decoding.

От
Andres Freund
Дата:
On 2014-03-19 22:12:28 +0900, Fujii Masao wrote:
> LOGICAL option was added into CREATE_REPLICATION_SLOT, but it's not
> been documented.
> protocol.sgml should be updated?

Yes, it should. There's some other things I noticed should be expanded
upon, most notably the importance of feedbacks when receiving logical
changes... I plan to make a pass through the file, but I probably won't
get to it this week.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services