aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/postgres/postgres_sql_gen.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-03-30 00:25:01 -0700
committerGitHub <noreply@github.com>2021-03-30 00:25:01 -0700
commitbec74c3e6a4279288c790fb052eb2844e3b9bc36 (patch)
tree555d0e3edf71e66f404185c3148b7553b7c9c50c /weed/filer/postgres/postgres_sql_gen.go
parenta95929e53ca609181dddda04ece0e6d482234161 (diff)
parent9f1cab179c1c41deb1db627e8bfbc632a2dffba7 (diff)
downloadseaweedfs-bec74c3e6a4279288c790fb052eb2844e3b9bc36.tar.xz
seaweedfs-bec74c3e6a4279288c790fb052eb2844e3b9bc36.zip
Merge pull request #1948 from LazyDBA247-Anyvision/master
add enableUpsert=true
Diffstat (limited to 'weed/filer/postgres/postgres_sql_gen.go')
-rw-r--r--weed/filer/postgres/postgres_sql_gen.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filer/postgres/postgres_sql_gen.go b/weed/filer/postgres/postgres_sql_gen.go
index 21a87ef5a..6cee3d2da 100644
--- a/weed/filer/postgres/postgres_sql_gen.go
+++ b/weed/filer/postgres/postgres_sql_gen.go
@@ -10,7 +10,7 @@ import (
type SqlGenPostgres struct {
CreateTableSqlTemplate string
DropTableSqlTemplate string
- InsertQueryTemplate string
+ UpsertQueryTemplate string
}
var (
@@ -18,8 +18,8 @@ var (
)
func (gen *SqlGenPostgres) GetSqlInsert(tableName string) string {
- if gen.InsertQueryTemplate != "" {
- return fmt.Sprintf(gen.InsertQueryTemplate, tableName)
+ if gen.UpsertQueryTemplate != "" {
+ return fmt.Sprintf(gen.UpsertQueryTemplate, tableName)
} else {
return fmt.Sprintf(`INSERT INTO "%s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4)`, tableName)
}