pg_tle icon indicating copy to clipboard operation
pg_tle copied to clipboard

Relax extension_update_paths argument to text

Open Rajanpandey opened this issue 1 year ago • 2 comments

Issue #, if available: #126

Description of changes: All of the other extension functions use text as name, so this appears to be an arbitrary restriction. Hence, relaxing the argument from name to text.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Rajanpandey avatar May 09 '24 12:05 Rajanpandey

To update the extension version you'll need to bump EXTVERSION in the Makefile as well. Not sure if that's causing these regression test failures though

adamguo0 avatar May 09 '24 16:05 adamguo0

Thanks @adamguo0, fixed it! 😄

Rajanpandey avatar May 13 '24 12:05 Rajanpandey

Sorry I haven't gotten to this in a while -- the change looks good to me. I did a manual sanity check to make sure that after updating pg_tle from 1.4.0 to 1.4.1, the function works as expected

adamguo0 avatar May 29 '24 15:05 adamguo0

Hi, do you mind elaborating what are the restrictions that you're facing before this change?

anth0nyleung avatar May 29 '24 16:05 anth0nyleung

Hi @anth0nyleung 😃, The name data type can hold 63 characters string only (ref #define NAMEDATALEN 64). Whereas text has no limit at all!

Note that install_extension already uses text instead of name data type for the extension-name's argument. So a user can create an extension with names that are >63 characters, but the operation will fail when trying to find its update paths using extension_update_paths() function because it's using a data type that limits the extension name to 63 chars!

This PR addresses a long time pending issue, #126 raised by @jkatz. 😄

Rajanpandey avatar May 29 '24 16:05 Rajanpandey

As a side-note there's another issue preventing users from creating extensions with almost-63 chars. Since function names are capped at 63 chars, I don't think our current implementation can handle this case. We'll need to address that separately

https://github.com/aws/pg_tle/issues/100

adamguo0 avatar May 29 '24 17:05 adamguo0