diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-06-13 17:43:13 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-06-13 17:43:13 +0000 |
commit | 26b7abfa32b657e21911e82b38eeb8fc81c9dc77 (patch) | |
tree | 5b1cc05119859da9e1676fc24962862aa17afd61 /src/backend/commands/comment.c | |
parent | a079efa641fbfa0ad32c6218e8dc6d949989a247 (diff) | |
download | postgresql-26b7abfa32b657e21911e82b38eeb8fc81c9dc77.tar.gz postgresql-26b7abfa32b657e21911e82b38eeb8fc81c9dc77.zip |
Fix ALTER LARGE OBJECT and GRANT ... ON LARGE OBJECT for large OIDs.
The previous coding failed for OIDs too large to be represented by
a signed integer.
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r-- | src/backend/commands/comment.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index 2cf8aff6aec..7fa09c8d2a0 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -7,7 +7,7 @@ * Copyright (c) 1996-2010, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.114 2010/02/26 02:00:38 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.115 2010/06/13 17:43:12 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -1404,32 +1404,9 @@ static void CommentLargeObject(List *qualname, char *comment) { Oid loid; - Node *node; Assert(list_length(qualname) == 1); - node = (Node *) linitial(qualname); - - switch (nodeTag(node)) - { - case T_Integer: - loid = intVal(node); - break; - case T_Float: - - /* - * Values too large for int4 will be represented as Float - * constants by the lexer. Accept these if they are valid OID - * strings. - */ - loid = DatumGetObjectId(DirectFunctionCall1(oidin, - CStringGetDatum(strVal(node)))); - break; - default: - elog(ERROR, "unrecognized node type: %d", - (int) nodeTag(node)); - /* keep compiler quiet */ - loid = InvalidOid; - } + loid = oidparse((Node *) linitial(qualname)); /* check that the large object exists */ if (!LargeObjectExists(loid)) |