Skip to content

Support locks #157

@Yogurt4

Description

@Yogurt4

WP Version: 6.8.3
PG4WP Version: 3.4.1

Error:

LINE 1: SELECT GET_LOCK('aioseo_cache_clear_lock', 0)
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

RAW SQL

SELECT GET_LOCK('aioseo_cache_clear_lock', 0)

A PostgreSQL way of doing it would be something like

SELECT pg_try_advisory_lock(('x' || substr(md5('aioseo_cache_clear_lock'), 1, 16))::bit(64)::bigint)

The same goes for SELECT RELEASE_LOCK('aioseo_cache_clear_lock'); that should be changed to pg_advisory_unlock.

For the hashing, hashtextextended(lockname, 0) is more convenient but I'm not sure for its legacy compatibility.

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