Skip to content

[DoctrineMessenger, Postgres] can't specify schema when configurate messenger table_name #46984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thamine-cleverside opened this issue Jul 19, 2022 · 1 comment

Comments

@thamine-cleverside
Copy link

thamine-cleverside commented Jul 19, 2022

Description

I am trying to configure messenger dsn as doctrine and i am using Postgres database.
I want to set the option table_name and specify the schema like the example below

I have the error bellow when trying to doctrine:schema:update

SQLSTATE[3F000]: Invalid schema name: 7 ERROR: schema "notify_property_management" does not exist

Because the framework here tries to create to create a function in the DB and the sprintf consider that the option table_name has no schema.

I would suggest :

  • add the option schema_name
  • Or making the option table_name support a schema name

Example

messenger:
        transports:
            transport_plan_2d_marked_as_delivered:
                dsn: '%env(MESSENGER_TRANSPORT_DSN_DOCTRINE)%'
                options:
                    table_name: property_management.queue_plan_2d_marked_as_delivered
fabpot added a commit that referenced this issue Jul 28, 2022
…bridge to support table name with schema (zimny9932)

This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[Messenger] Fix function name in TriggerSql on postgresql bridge to support table name with schema

…support table name with schema

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #46984
| License       | MIT

Allow use schema in table_name option when configure postgresql transport. There was a problem with procedure name in getTriggerSql function in Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection.

Commits
-------

64e7c9b [Messenger] Fix function name in TriggerSql on postgresql bridge to support table name with schema
@fabpot fabpot closed this as completed Jul 28, 2022
@thamine-cleverside
Copy link
Author

Thank you for @fabpot @zimny9932

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants