Indicate Postgres schema requirement
https://min.io/docs/minio/linux/reference/minio-server/settings/notifications/postgresql.html#minio-server-envvar-bucket-notification-postgresql
It seems that minio previously inferred the db schema from the string passed e.g. minio.minioevents, however. In the current minio server, we need to independently specify a db schema in order to setup postgres notifications else we hit pq: no schema has been selected to create in (*pq.Error). I believe that the documentation should change to reflect this.
@Docs team: Please help me communicate this appropriately. Some more documentation is needed to make this clear.
@Ravind This is the commit which introduced the change. https://github.com/minio/minio/commit/701da1282a50b05488dc02031e8eda5d16c59606 - this is the release https://github.com/minio/minio/releases/tag/RELEASE.2024-04-28T17-53-50Z
I understand the commit is for further sanitization of the sql inputs - however it also forces the user to perform the above command modifications.
e.g.
export MINIO_NOTIFY_POSTGRES_ENABLE_PRIMARY="on"
export MINIO_NOTIFY_POSTGRES_CONNECTION_STRING_PRIMARY="host=localhost port=5432 dbname=postgres user=postgres password=postgres sslmode=disable options='-c search_path=minio'"
export MINIO_NOTIFY_POSTGRES_TABLE_PRIMARY="minioevents"
export MINIO_NOTIFY_POSTGRES_FORMAT_PRIMARY="namespace"
export MINIO_NOTIFY_POSTGRES_MAX_OPEN_CONNECTIONS_PRIMARY="2"
export MINIO_NOTIFY_POSTGRES_COMMENT_PRIMARY="PostgreSQL Notification Event Logging for MinIO"
or
mc admin config set <alias> --insecure notify_postgres:PRIMARY \
enable="on" \
connection_string="host=localhost port=5432 dbname=postgres user=postgres password=postgres options='-c search_path=minio' sslmode=disable" \
table="minioevents" \
format="namespace" \
max_open_connections="2" \
comment="PostgreSQL Notification Event Logging for MinIO"
@allanrogerr The intention of my PR wasn't to remove schema detection. It only adds a check to make sure that the passed table-name is valid. It looks like it doesn't allow specifying a table-name with a schema anymore (so it's too strict). We probably should support specifying a table with a schema.
@ramondeklein with your latest changes is this "gone away"?
@ravindk89 Yes, with https://github.com/miniohq/eos/pull/766 the user can specify the schema with the table name again. There is no need to specify the "search path" anymore. You can use minio.minioevents again. When users hit this issue on a version before the PR, then we should just ask them to upgrade. Not accepting the schema in the table-name is a bug. The workaround is the search path, but there is no need to document it.
@ramondeklein that eos PR is not coming into minio/minio, is it?
@djwfyi Sorry, missed the remark. I do think we should merge that fix back into MinIO.