Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Need to TRIM when using RDB$USER_PRIVILEGES #8075

Unanswered
prrvchr asked this question in Q&A
Discussion options

Hi all,

I don't know if I'm using it wrong, but I can't execute this query without the TRIM function. Is this normal?

SELECT TRIM(P.RDB$USER) FROM RDB$USER_PRIVILEGES AS P INNER JOIN SEC$USERS AS U ON TRIM(P.RDB$USER) = U.SEC$USER_NAME WHERE P.RDB$PRIVILEGE = 'M' AND P.RDB$USER_TYPE = 8 AND P.RDB$OBJECT_TYPE = 13 AND P.RDB$RELATION_NAME = ?

You must be logged in to vote

Replies: 2 comments

Comment options

Yes, this is normal, because the metadata tables use CHAR(63) (or (CHAR(31) in Firebird 3.0 and older) columns, which means they are padded with spaces up to the declared length.

You must be logged in to vote
0 replies
Comment options

That said, the comparison itself in the join condition shouldn't require a trim.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #8074 on April 09, 2024 06:18.

AltStyle によって変換されたページ (->オリジナル) /