jrgemignani commented on issue #1986:
URL: https://github.com/apache/age/issues/1986#issuecomment-2246428988

   @MironAtHome It appears that if the PG type Name is used, then it will 
always be truncated at `NAMEDATALEN` on input -
   
   ```
   Datum
   namein(PG_FUNCTION_ARGS)
   {
           char       *s = PG_GETARG_CSTRING(0);
           Name            result;
           int                     len;
   
           len = strlen(s);
   
           /* Truncate oversize input */
           if (len >= NAMEDATALEN)
                   len = pg_mbcliplen(s, len, NAMEDATALEN - 1);
   
           /* We use palloc0 here to ensure result is zero-padded */
           result = (Name) palloc0(NAMEDATALEN);
           memcpy(NameStr(*result), s, len);
   
           PG_RETURN_NAME(result);
   }
   ```
   
   This also means that there won't be any warning if it exceeds `NAMEDATALEN` 
:(


-- 
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: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to