Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to replicate table with generated columns #335

Open
danielkucera opened this issue Aug 19, 2021 · 5 comments
Open

Unable to replicate table with generated columns #335

danielkucera opened this issue Aug 19, 2021 · 5 comments

Comments

@danielkucera
Copy link

read from bottom up:

2021-08-19 08:30:08.503 UTC [31947]: [2-1] db=platform,user=logicalrepluser LOG:  unexpected EOF on client connection with an open transaction
--
2021-08-19 08:30:08.502 UTC [31947]: [1-1] db=platform,user=logicalrepluser LOG:  could not receive data from client: Connection reset by peer
2021-08-19 08:30:08.502 UTC [284683]: [4-1] db=platform,user=logicalrepluser LOG:  could not receive data from client: Connection reset by peer
2021-08-19 08:30:08.502 UTC [284682]: [5-1] db=platform,user=logicalrepluser LOG:  unexpected EOF on client connection with an open transaction
2021-08-19 08:30:08.502 UTC [7]: [18-1] db=,user= LOG:  background worker "pglogical apply 16441:822708183" (PID 31944) exited with exit code 1
2021-08-19 08:30:08.502 UTC [284682]: [4-1] db=platform,user=logicalrepluser LOG:  could not receive data from client: Connection reset by peer
2021-08-19 08:30:08.500 UTC [31944]: [4-1] db=platform,user=[unknown] LOG:  apply worker [31944] at slot 2 generation 5 exiting with error
 
DETAIL:  Generated columns cannot be used in COPY.
2021-08-19 08:30:08.498 UTC [31944]: [3-1] db=platform,user=[unknown] DETAIL:  Query 'COPY "public"."users" ("id","email","email_valid","password","tmp_password","guest","login_tries","locked_at","merchant_id","language","reset_token","reset_at","created_at","updated_at","deleted_at","type","activated_at","first_name","family_name","full_name","settings") TO stdout': ERROR:  column "full_name" is a generated column
2021-08-19 08:30:08.498 UTC [31944]: [2-1] db=platform,user=[unknown] ERROR:  table copy failed
2021-08-19 08:30:08.483 UTC [284683]: [3-1] db=platform,user=logicalrepluser STATEMENT:  COPY "public"."users" ("id","email","email_valid","password","tmp_password","guest","login_tries","locked_at","merchant_id","language","reset_token","reset_at","created_at","updated_at","deleted_at","type","activated_at","first_name","family_name","full_name","settings") TO stdout
2021-08-19 08:30:08.483 UTC [284683]: [2-1] db=platform,user=logicalrepluser DETAIL:  Generated columns cannot be used in COPY.
2021-08-19 08:30:08.483 UTC [284683]: [1-1] db=platform,user=logicalrepluser ERROR:  column "full_name" is a generated column
2021-08-19 08:30:08.452 UTC [284682]: [3-1] db=platform,user=logicalrepluser LOG:  exported logical decoding snapshot: "0000000E-0004EF0B-1" with 0 transaction IDs
2021-08-19 08:30:08.452 UTC [284682]: [2-1] db=platform,user=logicalrepluser DETAIL:  There are no running transactions.
2021-08-19 08:30:08.452 UTC [284682]: [1-1] db=platform,user=logicalrepluser LOG:  logical decoding found consistent point at 491/AFD80BC8

Is there anything I can do about this?

@petere
Copy link
Member

petere commented Aug 20, 2021

Looks like support for generated columns is missing. We'll leave this issue open as a reminder to fix that.

@asmolcic
Copy link

asmolcic commented Jun 1, 2022

Hi, has the support for generated columns been added in 2.4? Is there a workaround? Thanks.

@petere
Copy link
Member

petere commented Jun 3, 2022

At the moment, there are no plans to work on that. pglogical is in maintenance mode. For more features, try the built-in logical replication in PostgreSQL.

@asmolcic
Copy link

asmolcic commented Jun 6, 2022

At the moment, there are no plans to work on that. pglogical is in maintenance mode. For more features, try the built-in logical replication in PostgreSQL.

Thank you for your answer. I tried having a generated column on the source database and regular column on the target but actually COPY command complains. I switched to triggers.

@postsql
Copy link

postsql commented Apr 18, 2024

please see pull request #466 for a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants