diff --git a/callback_create.go b/callback_create.go index bded5324..1bd8ff05 100644 --- a/callback_create.go +++ b/callback_create.go @@ -54,7 +54,7 @@ func Create(scope *Scope) { if len(columns) == 0 { scope.Raw(fmt.Sprintf("INSERT INTO %v DEFAULT VALUES %v", scope.QuotedTableName(), - scope.Dialect().ReturningStr(scope.TableName(), returningKey), + scope.Dialect().ReturningStr(scope.QuotedTableName(), returningKey), )) } else { scope.Raw(fmt.Sprintf( @@ -62,7 +62,7 @@ func Create(scope *Scope) { scope.QuotedTableName(), strings.Join(columns, ","), strings.Join(sqls, ","), - scope.Dialect().ReturningStr(scope.TableName(), returningKey), + scope.Dialect().ReturningStr(scope.QuotedTableName(), returningKey), )) } diff --git a/foundation.go b/foundation.go index 07968ad3..422fcc60 100644 --- a/foundation.go +++ b/foundation.go @@ -52,7 +52,7 @@ func (foundation) SqlTag(value reflect.Value, size int, autoIncrease bool) strin } func (s foundation) ReturningStr(tableName, key string) string { - return fmt.Sprintf("RETURNING %v.%v", s.Quote(tableName), key) + return fmt.Sprintf("RETURNING %v.%v", tableName, key) } func (s foundation) HasTable(scope *Scope, tableName string) bool { diff --git a/postgres.go b/postgres.go index 357f9842..db15b114 100644 --- a/postgres.go +++ b/postgres.go @@ -60,7 +60,7 @@ func (postgres) SqlTag(value reflect.Value, size int, autoIncrease bool) string } func (s postgres) ReturningStr(tableName, key string) string { - return fmt.Sprintf("RETURNING %v.%v", s.Quote(tableName), key) + return fmt.Sprintf("RETURNING %v.%v", tableName, key) } func (s postgres) HasTable(scope *Scope, tableName string) bool {