Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading Error Message when extension name is > NAMEDATALEN #100

Open
JohnHVancouver opened this issue Oct 11, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@JohnHVancouver
Copy link
Contributor

postgres=# SELECT pgtle.install_extension
(
 'test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN',
 '0.1',
 'comment',
$_pg_tle_$                                                                         
    CREATE FUNCTION dist(x1 numeric, y1 numeric, x2 numeric, y2 numeric, l numeric)
    RETURNS numeric
    AS $$                                                                  
      SELECT ((x2 ^ l - x1 ^ l) ^ (1 / l)) + ((y2 ^ l - y1 ^ l) ^ (1 / l));
    $$ LANGUAGE SQL;
$_pg_tle_$
);
NOTICE:  identifier "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN.control" will be truncated to "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAM"
NOTICE:  identifier "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN--0.1.sql" will be truncated to "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAM"
ERROR:  Extension 'test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN' already installed.

It says the extension's already installed even though this is our first time installing it.

@jkatz jkatz added the bug Something isn't working label Oct 11, 2022
@jkatz jkatz added this to the 1.0 milestone Oct 11, 2022
@jkatz
Copy link
Contributor

jkatz commented Oct 11, 2022

I think #103 may address this. Going to try that out...

@jkatz jkatz self-assigned this Oct 11, 2022
@jkatz
Copy link
Contributor

jkatz commented Oct 11, 2022

I think there's a bug here, albeit at the edge.

NOTICE:  identifier "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN.control" will be truncated to "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAM"
NOTICE:  identifier "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN--0.1.sql" will be truncated to "test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAM"
ERROR:  Extension 'test9greaterthanNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALENNAMEDATALEN' already installed.

What's happening is that the two functions we create (control function, version function) are truncated to have the same name. So it's coming across as the extension is already installed when really it's just the name is too long.

So yes, it's a misleading error message, but we're not capping the name of the extension to an appropriate length.

@jkatz
Copy link
Contributor

jkatz commented Oct 12, 2022

Lowering the priority on this. I don't think this has v1.0.0 impact as it's an edge case. We should fix it in the fullness of time.

Leaving this in the milestone in case someone wants to pick it up, but deprioritizing it.

@jkatz jkatz removed their assignment Oct 12, 2022
@jkatz jkatz removed this from the 1.0 milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants