If there is already a retention policy "1h" you should get an error if you create one with this name "1h"

> show retention policies
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 0s       168h0m0s           1        true
1h      1h0m0s   1h0m0s             1        false
1h2     1h0m0s   1h0m0s             1        false
> CREATE RETENTION POLICY "1h2" ON collections DURATION 1h REPLICATION 1
>

Query should either return an error or create it. The latter probably the least wanted.

Hi ,

i don’t think that the command should return an error ,
your goal is to have the retention policy you specify ,
and the result is what you wanted even if the RP already existed.
On the other hand , an error is returned if you create a retention policy that already exists with a different duration .

> create retention policy "1h2" on telegraf duration 1h replication 1 
> create retention policy "1h2" on telegraf duration 1h replication 1 
> create retention policy "1h2" on telegraf duration 2h replication 1 
ERR: retention policy already exists
>

Indeed you want to be consistent in the way you report errors or successes.

I am not to sure about these retention policies, but if an existing one can have different data than a newly created. Than you have to report the error it was not created, because it was not.