Open OProf77 opened 1 month ago
I think that error appears on views
"06/07/2024 06:37:34 || LOG: Fetched data from public.ana_co_visure table of postgresql..."
because "public.ana_co_visure" it's a view and not a table.
Can I specify to migrate only tables and table data?
Thanks
I have modified this line in Service.cs file:
var getTablesQuery = $"SELECT table_name FROM information_schema.tables WHERE table_schema = '{sourceSchema}'";
with this:
var getTablesQuery = $"SELECT table_name FROM information_schema.tables WHERE table_schema = '{sourceSchema}' and table_type = 'BASE TABLE'";
...and now all works fine and I have migrated all my tables(only tables without views or more) with data from Postgres to MSSQL. 2,5GB size of Postgres
Thanks @OProf77 for creating an issue, sorry cannot reach you early but happy you got the solution. I'll keep this issue open and resolve with better approach what I can find.
Thanks for the application. While I was doing the migration I got this error...
06/07/2024 06:37:34 || LOG: Fetched data from public.ana_co_visure table of postgresql... Npgsql.Internal.NpgsqlConnector.ReadMessageLong(bool async, DataRowLoadingMode dataRowLoadingMode, bool.
GetResult(short token) Npgsql.NpgsqlDataReader.Read(bool async, CancellationToken cancellationToken)b0(StatusContext ctx) in /postgresql-to-mssql/Services/g DoStartUserAction|2790(ConnectorState newState, NpgsqlCommand command, CancellationToken
cancellationToken, bool attemptPgCancellation) Npgsql.NpgsqlCommand.ExecuteReader(bool async, CommandBehavior behavior, CancellationToken cancellationToken) Npgsql.NpgsqlCommand.ExecuteReader(bool async, CommandBehavior behavior, CancellationToken cancellationToken) /Dapper/SqlMapper.cs:1156 Dapper.SqlMapper.QueryImpl(IDbConnection cnn, CommandDefinition command, Type effectiveType) in //Dapper/SqlMapper.cs:1184 collection) /Dapper/SqlMapper.cs:737b 0(StatusContext ctx) in /postgresql-to-mssql/Services/b_0(StatusContext ctx) in //src/Spectre.Console/Live/Status/Status.cs:44 DisplayClass16_0.<b0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:79b 0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:120b_0>d.MoveNext() in //src/Spectre.Console/Live/Progress/Progress.cs:133 Spectre.Console.Internal.DefaultExclusivityMode.RunAsync(Func<Task> func) in //src/Spectre.Console/Internal/ Spectre.Console.Progress.StartAsync(Func<ProgressContext, Task> action) in / /src/Spectre.Console/Live/Progress/Progress.cs:116 Spectre.Console.Status.StartAsync(string status, Func<StatusContext, Task> func) in //src/Spectre.Console/Live/Status/Status.cs:117
at async Task Spectre.Console.Status.StartAsync(string status, Func<StatusContext, Task> action) in //src/Spectre.Console/Live/Status/Status.cs:77 action) in /_/src/Spectre.Console/Live/Status/Status.cs:48
Npgsql.NpgsqlException: Exception while reading from stream
System.TimeoutException: Timeout during reading attempt
…
at async ValueTask
readingNotifications, bool isReadingPrependedMessage)
at TResult System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder
1.StateMachineBox
1.System.Threading.Tasks.Sources.IValueTaskSourceat async Task
at bool Npgsql.NpgsqlDataReader.Read()
at int System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at int System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int startRecord, int maxRecords, DataColumn parentChapterColumn, object parentChapterValue)
at int System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, int startRecord, int maxRecords)
at void System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler)
at void Application.Service.<>cDisplayClass3_0.
Service.cs:95
Npgsql.NpgsqlOperationInProgressException: A command is already in progress: SELECT * FROM public.ana_co_visure at void Npgsql.ThrowHelper.ThrowNpgsqlOperationInProgressException(NpgsqlCommand command)
at UserAction Npgsql.Internal.NpgsqlConnector.
at async ValueTask
at async ValueTask
at DbDataReader Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, bool wasClosed, CommandBehavior behavior) in /
at IEnumerable
at System.Collections.Generic.List`1..ctor(IEnumerable
at IEnumerable
at void Application.Service.<>c__DisplayClass3_0.
Service.cs:76
at Task Spectre.Console.Status.<>cDisplayClass14_0.
at void Spectre.Console.Status.<>c
at void Spectre.Console.Status.<>c__DisplayClass17_0`1.<
at void Spectre.Console.Progress.<>c__DisplayClass28_0`1.<
at async Task
DefaultExclusivityMode.cs:40
at async Task
at async Task
at void Spectre.Console.Status.Start(string status, Action
at void Application.Service.Migrate() in /postgresql-to-mssql/Services/Service.cs:37
List of failed migration
table/views
Describe the bug A clear and concise description of what the bug is.
Desktop (please complete the following information):