将 Power BI 连接到 Postgresql 会引发重复键错误
Connecting Power BI to Postgresql throw a duplicate key error
我正在尝试将 PowerBI 连接到 Postgres。我们有:
- Office 2016
- Npgsql 3.0.3
x86_64-unknown-linux-gnu
上的 PostgreSQL 9.4.1,由 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) 编译,64 位
当我单击所需的 table 时,出现此错误:
Error inesperado: Ya existe una entrada con la misma clave.
Detalles:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> System.ArgumentException: Ya existe una entrada con la misma clave.
en System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
en System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
en System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RetrieveIncomingRelationshipsForTable(String schemaName, String tableName)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.RetrieveLinks(NavigationPropertiesRecord navigationPropertyRecord, TableValue table, DbEnvironment environment)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.AddNavigationPropertiesToTable(NavigationPropertiesRecord record, DbEnvironment environment, TableValue table, NameGenerator nameGenerator)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.NavigationPropertiesRecord.get_Item(SchemaItem key)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.LinkTableFunctionValue.TypedInvoke()
en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue0`1.Invoke()
en Microsoft.Mashup.Engine1.Runtime.Relationship.EnsureRightKeyColumns()
en Microsoft.Mashup.Engine1.Runtime.Relationship.get_RightKeyColumns()
en Microsoft.Mashup.Engine1.Runtime.Relationship.Microsoft.Mashup.Engine.Interface.IRelationship.OtherKeyColumn(Int32 index)
en Microsoft.Mashup.Evaluator.ArrayHelpers.NewArray[T](Int32 count, Func`2 getter)
en Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.WriteIRelationship(BinaryWriter writer, IRelationship relationship)
en Microsoft.Mashup.Evaluator.BinaryReaderWriterExtensions.WriteArray[T](BinaryWriter writer, T[] array, Action`2 writeItem)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.TableSourceMessage.Serialize(BinaryWriter writer)
en Microsoft.Mashup.Evaluator.BinarySerializer.Serialize(Action`1 serializer)
en Microsoft.Mashup.Evaluator.Interface.BufferedMessage.Prepare()
en Microsoft.Mashup.Evaluator.ChannelMessenger.Post(MessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass10.<OnBeginGetPreviewValueSource>b__f(EvaluationResult2`1 result)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.EvaluationHost.Run()
en Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
en Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
en Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.OnEvaluationException(IMessageChannel channel, EvaluationExceptionMessage message)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.PreviewValueSourceRemoteEvaluation.GetResult(Boolean enableFirewall)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryCompleteWithException(Exception exception)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
en System.Threading.ThreadPoolWorkQueue.Dispatch()
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.Interface.EvaluationResult2`1.get_Result()
en Microsoft.Mashup.Host.Document.Preview.PreviewEvaluation.<>c__DisplayClassb.<StartEvaluation>b__8(EvaluationResult2`1 result)
这绝对是 Power Query 中的错误。
能否让错误再次发生,然后选择[发送皱眉]将错误输入我们的系统?
谢谢!
我能够在以下情况下重现:
tableA, tableB, tableC
tableA has a foreign key directed to tableC's primary key
tableB has a foreign key directed to tableC's primary key
both of these foreign keys have the same constraint name.
你能确认你的数据库是这样的吗? (tableC 不必是您尝试连接的 table,它可以是您数据库中的任何 table。)
修复将在几个月后出现在 PowerQuery 中,您可以尝试重命名这些外键约束之一,而不是等待它。
感谢您向我们报告问题,
奥古兹
我正在尝试将 PowerBI 连接到 Postgres。我们有:
- Office 2016
- Npgsql 3.0.3
x86_64-unknown-linux-gnu
上的 PostgreSQL 9.4.1,由 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) 编译,64 位
当我单击所需的 table 时,出现此错误:
Error inesperado: Ya existe una entrada con la misma clave.
Detalles:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> System.ArgumentException: Ya existe una entrada con la misma clave.
en System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
en System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
en System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RetrieveIncomingRelationshipsForTable(String schemaName, String tableName)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.RetrieveLinks(NavigationPropertiesRecord navigationPropertyRecord, TableValue table, DbEnvironment environment)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.AddNavigationPropertiesToTable(NavigationPropertiesRecord record, DbEnvironment environment, TableValue table, NameGenerator nameGenerator)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.NavigationPropertiesRecord.get_Item(SchemaItem key)
en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.LinkTableFunctionValue.TypedInvoke()
en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue0`1.Invoke()
en Microsoft.Mashup.Engine1.Runtime.Relationship.EnsureRightKeyColumns()
en Microsoft.Mashup.Engine1.Runtime.Relationship.get_RightKeyColumns()
en Microsoft.Mashup.Engine1.Runtime.Relationship.Microsoft.Mashup.Engine.Interface.IRelationship.OtherKeyColumn(Int32 index)
en Microsoft.Mashup.Evaluator.ArrayHelpers.NewArray[T](Int32 count, Func`2 getter)
en Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.WriteIRelationship(BinaryWriter writer, IRelationship relationship)
en Microsoft.Mashup.Evaluator.BinaryReaderWriterExtensions.WriteArray[T](BinaryWriter writer, T[] array, Action`2 writeItem)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.TableSourceMessage.Serialize(BinaryWriter writer)
en Microsoft.Mashup.Evaluator.BinarySerializer.Serialize(Action`1 serializer)
en Microsoft.Mashup.Evaluator.Interface.BufferedMessage.Prepare()
en Microsoft.Mashup.Evaluator.ChannelMessenger.Post(MessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass10.<OnBeginGetPreviewValueSource>b__f(EvaluationResult2`1 result)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.EvaluationHost.Run()
en Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
en Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
en Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.OnEvaluationException(IMessageChannel channel, EvaluationExceptionMessage message)
en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
en Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.PreviewValueSourceRemoteEvaluation.GetResult(Boolean enableFirewall)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryCompleteWithException(Exception exception)
en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
en System.Threading.ThreadPoolWorkQueue.Dispatch()
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Mashup.Evaluator.Interface.EvaluationResult2`1.get_Result()
en Microsoft.Mashup.Host.Document.Preview.PreviewEvaluation.<>c__DisplayClassb.<StartEvaluation>b__8(EvaluationResult2`1 result)
这绝对是 Power Query 中的错误。
能否让错误再次发生,然后选择[发送皱眉]将错误输入我们的系统?
谢谢!
我能够在以下情况下重现:
tableA, tableB, tableC
tableA has a foreign key directed to tableC's primary key
tableB has a foreign key directed to tableC's primary key
both of these foreign keys have the same constraint name.
你能确认你的数据库是这样的吗? (tableC 不必是您尝试连接的 table,它可以是您数据库中的任何 table。)
修复将在几个月后出现在 PowerQuery 中,您可以尝试重命名这些外键约束之一,而不是等待它。
感谢您向我们报告问题,
奥古兹