[pmg-devel] [PATCH pmg-api v2 04/10] add rule attributes and/invert (for each relevant type)

Dominik Csapak d.csapak at proxmox.com
Thu Feb 22 08:34:28 CET 2024

On 2/22/24 07:46, Thomas Lamprecht wrote:
> Am 21/02/2024 um 13:24 schrieb Dominik Csapak:
>> +my $rule_attributes_cmd = <<__EOD;
>> +    CREATE TABLE Rule_Attributes (
>> +      Rule_ID INTEGER NOT NULL,
>> +      Name VARCHAR(20) NOT NULL,
>> +      Value BYTEA NULL,
> FWIW, with this being such limited to only support a boolean value, the
> name could have been a boolean type for invert/and too..
> Else it would make more sense to have this either more generic, or make
> it a very explicit table (name) like "Rule_Flags".
> As of now the name suggests that its generic, but the schema really isn't.
> I.e., this feels a bit like the worst of both worlds.

huh? i'm not sure i understand completely what you want to say:

Value is a BYTEA is a 'binary string' [0]
so we can store arbitrary information there, not only booleans
(i reused the data types we already have for the 'Attribut' table, which
stores attributes for the Objects, e.g. for the Notify Action)

0: https://www.postgresql.org/docs/current/datatype-binary.html

More information about the pmg-devel mailing list