From: | Thom Brown <thom(at)linux(dot)com> |
---|---|
To: | Andres Freund <andres(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Changeset Extraction v7.5 |
Date: | 2014-02-09 00:49:31 |
Message-ID: | CAA-aLv4RL_CudqpW9op8Quu5D6JjnuTTYC2nW74Z4d6=Z2SAiQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 8 February 2014 23:08, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-02-08 22:58:35 +0000, Thom Brown wrote:
>> Another question: in order for logical decoding/replication to be
>> useful, presumably one would need a primary key on every table? It's
>> just I haven't seen this mentioned on the changeset extraction page in
>> the docs.
>
> Hm, that's a good point. 07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65 added
> configurability for that, but there at least should be a link to
> http://www.postgresql.org/docs/devel/static/sql-altertable.html with
> some additional words.
# CREATE TABLE test (id serial primary key, val int);
CREATE TABLE
# INSERT INTO test (val) SELECT generate_series(1,3);
INSERT 0 3
# ALTER TABLE test ADD COLUMN a decimal DEFAULT 2.22;
ALTER TABLE
# ALTER TABLE test ADD COLUMN b json DEFAULT '{"a":[1,2,3],"b":[4,5,6]}';
ALTER TABLE
The output generated by those last 2 statements is:
BEGIN 891
table "pg_temp_16552": INSERT: id[int4]:1 val[int4]:1 a[numeric]:2.22
table "pg_temp_16552": INSERT: id[int4]:2 val[int4]:2 a[numeric]:2.22
table "pg_temp_16552": INSERT: id[int4]:3 val[int4]:3 a[numeric]:2.22
COMMIT 891
BEGIN 892
table "pg_temp_16552": INSERT: id[int4]:1 val[int4]:1 a[numeric]:2.22
b[json]:{"a":[1,2,3],"b":[4,5,6]}
table "pg_temp_16552": INSERT: id[int4]:2 val[int4]:2 a[numeric]:2.22
b[json]:{"a":[1,2,3],"b":[4,5,6]}
table "pg_temp_16552": INSERT: id[int4]:3 val[int4]:3 a[numeric]:2.22
b[json]:{"a":[1,2,3],"b":[4,5,6]}
COMMIT 892
This is showing inserts into the temp table as part of the operation.
Is that sufficient?
--
Thom
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2014-02-09 01:06:12 | Re: Changeset Extraction v7.5 |
Previous Message | Tom Lane | 2014-02-08 23:12:10 | Re: narwhal and PGDLLIMPORT |