Prev: [HACKERS] parser handling of large object OIDs
Next: [HACKERS] 'create or replace function' no longer allows parameters
From: Robert Haas on 9 Jun 2010 20:45 On Wed, Jun 9, 2010 at 5:02 PM, Robert Haas <robertmhaas(a)gmail.com> wrote: > I believe that the comment code is probably right, because I think > IConst can only handle values < 2^31, whereas OIDs can be as large as > 2^32-1. I investigated this a little more and the above analysis turns out to be correct. ALTER LARGE OBJECT OWNER and GRANT ... ON LARGE OBJECT don't work for large objects outside the range of a signed integer. Session demonstrating the problem and proposed patch attached. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company
From: Tom Lane on 9 Jun 2010 22:26 Robert Haas <robertmhaas(a)gmail.com> writes: > On Wed, Jun 9, 2010 at 5:02 PM, Robert Haas <robertmhaas(a)gmail.com> wrote: >> I believe that the comment code is probably right, because I think >> IConst can only handle values < 2^31, whereas OIDs can be as large as >> 2^32-1. > I investigated this a little more and the above analysis turns out to > be correct. ALTER LARGE OBJECT OWNER and GRANT ... ON LARGE OBJECT > don't work for large objects outside the range of a signed integer. Yup. > Session demonstrating the problem and proposed patch attached. This patch seems extremely grotty, though. Surely that's not the way we were doing it in the comment code? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Robert Haas on 10 Jun 2010 07:09
On Wed, Jun 9, 2010 at 10:26 PM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: > Robert Haas <robertmhaas(a)gmail.com> writes: >> On Wed, Jun 9, 2010 at 5:02 PM, Robert Haas <robertmhaas(a)gmail.com> wrote: >>> I believe that the comment code is probably right, because I think >>> IConst can only handle values < 2^31, whereas OIDs can be as large as >>> 2^32-1. > >> I investigated this a little more and the above analysis turns out to >> be correct. �ALTER LARGE OBJECT OWNER and GRANT ... ON LARGE OBJECT >> don't work for large objects outside the range of a signed integer. > > Yup. > >> Session demonstrating the problem and proposed patch attached. > > This patch seems extremely grotty, though. �Surely that's not the way we > were doing it in the comment code? I pretty much just moved the existing code from CommentLargeObject() into a new function oidparse(). I couldn't really figure out where to put the oidparse() function so I eventually decided on oid.c, and therefore also ripped out the trip through the fmgr layer in favor of calling the appropriate code directly. Other than that it's the same code. I'm open to suggestions, but this is basically just a small bit of code rearrangement. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |