viragtripathi commented on PR #69555:
URL: https://github.com/apache/airflow/pull/69555#issuecomment-5054222440

   > The uuid_generate_v7 fn we create already copes with pg_crypto not 
installed:
   > 
   > ```
   >     IF pgcrypto_installed THEN
   >         buffer := unix_time_ms || gen_random_bytes(10);
   >     ELSE
   >         buffer := unix_time_ms || substring(uuid_send(gen_random_uuid()) 
FROM 1 FOR 5) ||
   >                   substring(uuid_send(gen_random_uuid()) FROM 12 FOR 5);
   >     END IF;
   > ```
   > 
   > so why do we need any changes at all?
   
   The fallback never gets a chance to matter on cockroachdb: the function body 
itself is PL/pgSQL, and creating it fails there with SQLSTATE 0A000 
(unimplemented, cockroachdb/cockroach#110080). I ran the exact pg_uuid7_fn SQL 
from this file against 26.3 to confirm. Separately, the postgres branch's 
drop-then-create of the primary key is also rejected on that dialect (a PK 
cannot be dropped without a replacement in the same statement), so the branch 
is needed regardless of how the UUIDs are generated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to