diff --git a/src/Weasel.Postgresql/Tables/Partitioning/PartitionExtensions.cs b/src/Weasel.Postgresql/Tables/Partitioning/PartitionExtensions.cs index 3376018..95fbb82 100644 --- a/src/Weasel.Postgresql/Tables/Partitioning/PartitionExtensions.cs +++ b/src/Weasel.Postgresql/Tables/Partitioning/PartitionExtensions.cs @@ -40,7 +40,13 @@ public static string FormatSqlValue(this T value) /// public static string GetSuffixName(this DbObjectName identifier, string tableName) { - return tableName.TrimStart(identifier.Name.ToCharArray()).TrimStart('_'); + var suffix = tableName; + if (tableName.StartsWith(identifier.Name)) + { + suffix = suffix.Substring(identifier.Name.Length); + } + + return suffix.TrimStart('_'); } internal static string GetStringWithinParantheses(this string raw)