pip-services3-go / pip-services3-postgres-go

Postresql components for Pip.Services in Golang
MIT License
0 stars 0 forks source link

Error creating index for defined table schema (postgres persistence) #9

Closed alexnadeev closed 2 years ago

alexnadeev commented 2 years ago

There is a SQL error for defined table schema in config.yml (postgres persistence):

This error occurs for indexes creation: c.EnsureIndex(c.TableName+"name_idx", map[string]string{"name": "1"}, map[string]string{}) because of "." in index name: https://github.com/pip-services3-go/pip-services3-postgres-go/blob/34afd39ad7c36b46b0a11380b040185443d9709a/persistence/PostgresPersistence.go#L228

For schema name "test" and table name "tabletest" index name is going to be: "\"test\".\"tabletestname_idx\"". Index name with "." between schema name and tablename is causing an error for SQL query: "CREATE INDEX IF NOT EXISTS \"test\".\"tabletestname_idx\" ON \"test\".\""tabletest\"(name)"

levichevdmitry commented 2 years ago

Fixed, please update dependencies to v1.2.10 Thanks you for report!

alexnadeev commented 2 years ago

Thanks! I can confirm that this issue was resolved.