Skip to content

DBAL insert with PostgreSQL throws "…invalid input syntax for type boolean: """" #1398

@Hydoc

Description

@Hydoc

I ran into this issue where our messages wont be inserted into the PostgreSQL enqueue table using the DBAL adapter. After some investigation I found that the DbalContext.php creates the table with a boolean for the column redelivered. However, when trying to send the message, the type in the insert is DbalType::SMALLINT in the DbalProducer.php. Was this intentional?

File: DbalContext.php

public function createDataBaseTable(): void
    {
        // …
        // here it gets created as a boolean
        $table->addColumn('redelivered', DbalType::BOOLEAN, ['notnull' => false]); 
        // …
    }

File: DbalProducer.php

$rowsAffected = $this->context->getDbalConnection()->insert($this->context->getTableName(), $dbalMessage, [
                'id' => DbalType::GUID,
                'published_at' => DbalType::INTEGER,
                'body' => DbalType::TEXT,
                'headers' => DbalType::TEXT,
                'properties' => DbalType::TEXT,
                'priority' => DbalType::SMALLINT,
                'queue' => DbalType::STRING,
                'time_to_live' => DbalType::INTEGER,
                'delayed_until' => DbalType::INTEGER,
                // here it is defined as a SMALLINT
                'redelivered' => DbalType::SMALLINT,
                'delivery_id' => DbalType::STRING,
                'redeliver_after' => DbalType::BIGINT,
            ]);

If I manually change it to DbalType::BOOLEAN the insert works as expected.

Have I done something wrong or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions