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

Data-only migration fails on PostgreSQL-dialect target #644

Open
joshbautista opened this issue Sep 26, 2023 · 0 comments
Open

Data-only migration fails on PostgreSQL-dialect target #644

joshbautista opened this issue Sep 26, 2023 · 0 comments

Comments

@joshbautista
Copy link

Expected Behavior

Migration succeeds.

Actual Behavior

Migration throws an error:

can't migrate database: error while validating existing database:
can't read spanner schema: error trying to read and convert spanner schema:
couldn't get indexes for table public.test_table: couldn't read row while fetching interleaved tables:
spanner: code = "InvalidArgument", desc = "Statements with DISTINCT clauses are not supported"
smt-web-ui-distinct-error

SELECT DISTINCT is not currently supported with PostgreSQL dialect databases:
https://cloud.google.com/spanner/docs/reference/postgresql/query-syntax#select

smt-select-distinct-query

Also, this part of the error message, couldn't read row while fetching interleaved tables, seems to be a copy-paste error.
Error line in GetIndexes() vs error line in GetInterleaveTables().

Steps to Reproduce the Problem

  1. Create a PostgreSQL database with one table and one index (indexes don't really matter, but for the purposes of this error we'll include one)
  2. Run a schema-only migration from PostgreSQL to a PostgreSQL-dialect Spanner database
  3. Restart SMT
  4. Run a data-only migration from PostgreSQL to the database created before

Specifications

  • Version: v3.1.1
  • Platform:
# Server running SMT
> uname -a
Linux <redacted> 6.1.0-11-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux

> go version
go version go1.21.0 linux/amd64

# Browser
Chrome Version 117.0.5938.92 (Official Build) (x86_64) on MacOS 13.5.2
@joshbautista joshbautista changed the title Data-only Migration Fails on PostgreSQL-Dialect Target Data-only migration fails on PostgreSQL-dialect target Sep 26, 2023
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

1 participant