Skip to content

Generated Columns #450

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

Open
harrisonratcliffe opened this issue Mar 15, 2025 · 2 comments
Open

Generated Columns #450

harrisonratcliffe opened this issue Mar 15, 2025 · 2 comments

Comments

@harrisonratcliffe
Copy link

Pulse Version

1.2

Laravel Version

11.0

PHP Version

8.2

Livewire Version

N/A

Database Driver & Version

PostreSQL 15.12 on https://www.thenile.dev

Description

Can any changes be made to this package to remove the use of generated columns?

SQLSTATE[0A000]: Feature not supported: 7 ERROR:  GENERATED columns are not supported (Connection: newdatabase, SQL: create table "pulse_values" ("id" bigserial not null primary key, "timestamp" integer not null, "type" varchar(255) not null, "key" text not null, "key_hash" uuid not null generated always as (md5("key")::uuid) stored, "value" text not null))

Steps To Reproduce

Use Pulse with PostreSQL 15.12

@harrisonratcliffe
Copy link
Author

All good I think actually, I changed

match ($this->driver()) {
    'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'),
    'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
    'sqlite' => $table->string('key_hash'),
};

to:

$table->string('key_hash');

@timacdonald
Copy link
Member

timacdonald commented Mar 16, 2025

I'm surprised to see issues on Postgres 15. We are running our test suite against Postgres 14 and things are working as expected:

image: postgres:14

Although your change may allow the migrations to run, I feel that it would cause issues for you while running Pulse, as the key_hash column would never be generated. I imagine this will result in Pulse seeing every query as the same query, every request as the same route, every cache key as the same cache key, etc.

Can you triple check the Postgres version that you have configured for Pulse. Remember that Pulse can use a dedicated database.

If you continue to have issues on Postgres 15 and are using it because your current application is using that version, I would recommend spinning up a dedicated database for Pulse with the latest Postgres version.

Let us know how you go.

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

3 participants