Re: [BUGS] bad message or bad privilege check in foreign key constraint

2008-01-22 Thread Stephan Szabo
On Tue, 22 Jan 2008, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > On Tue, 22 Jan 2008, Tom Lane wrote: > >> Hmm. I wonder why we are bothering with FOR SHARE locks on the > >> referencing table, when we don't have any intention to change > >> those rows. Is there some race con

Re: [BUGS] bad message or bad privilege check in foreign key constraint

2008-01-22 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Tue, 22 Jan 2008, Tom Lane wrote: >> Hmm. I wonder why we are bothering with FOR SHARE locks on the >> referencing table, when we don't have any intention to change >> those rows. Is there some race condition that's needed to prevent? > I think it m

Re: [BUGS] bad message or bad privilege check in foreign key constraint

2008-01-22 Thread Stephan Szabo
On Tue, 22 Jan 2008, Tom Lane wrote: > hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > > apparently revoking update rights on referencing table blocks deletes on > > master table: > > >> revoke update on b from test; > > REVOKE > > >> delete from a where id = 1; > > ERROR: permission den

Re: [BUGS] bad message or bad privilege check in foreign key constraint

2008-01-22 Thread Tom Lane
hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > apparently revoking update rights on referencing table blocks deletes on > master table: >> revoke update on b from test; > REVOKE >> delete from a where id = 1; > ERROR: permission denied for relation b > CONTEXT: SQL statement "SELECT 1

Re: [BUGS] why provide cross type arithmetic operators

2008-01-22 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "ykhuang" <[EMAIL PROTECTED]> writes: >> there are many cross type arithmetic operators, like int2 + int4, int8 + >> int4, I think these can be deleted. Here are the reasons, after deleted, >> int2 + int4 will choose the operator int4 + int4, int8 + int4

Re: [BUGS] BUG #3881: lo_open leaks memory

2008-01-22 Thread Tom Lane
Michael Akinde <[EMAIL PROTECTED]> writes: > Why does it make a difference to lo_open what the size of the blob is? > Other than simply opening the blob to get the file descriptor, after > all, we don't touch the blob itself. I believe lo_open() fetches the first chunk of the blob's data, essent

Re: Gentoo shared_buffers setting (was: [BUGS] BUG #3888: postmaster...)

2008-01-22 Thread Alvaro Herrera
Marti wrote: > Gentoo defaults to launching PostgreSQL 8.2 with "-N 40 -B 80" which > is how I hit this problem; this was set in a distro-specific > configuration file which I previously hadn't even looked at. Does this > mean that these defaults are insane and I should complain loudly? Why waste

Gentoo shared_buffers setting (was: [BUGS] BUG #3888: postmaster...)

2008-01-22 Thread Marti
On 1/20/08, Tom Lane <[EMAIL PROTECTED]> wrote: >> Marti Raudsepp wrote: >>> However, as of PostgreSQL 8.3, postmaster requires that the number of >>> buffers is at least (max_connections*2 + 6) > It's sort of irrelevant IMHO, as any useful setting is orders of > magnitude larger than that anyway.

Re: [BUGS] BUG #3881: lo_open leaks memory

2008-01-22 Thread Michael Akinde
Thanks for the reply, Tomasz. We have now done some more performance tests working with pure C/C++ code, and the results we are finding seem to indicate that the disk thrashing has to do with the OS disk cache, and not as a result of the lo_open call. Notably, we have been unable to recreate t

Re: [BUGS] BUG #3881: lo_open leaks memory

2008-01-22 Thread Tomasz Ostrowski
On Tue, 22 Jan 2008, Michael Akinde wrote: >> What I *do* see is that the process size as reported by "top" >> quickly jumps to 900MB plus and then sits there. This is not a >> memory leak though, it is just a side effect of the way "top" >> reports usage of shared memory. > > Also, since the blo

Re: [BUGS] BUG #3881: lo_open leaks memory

2008-01-22 Thread Michael Akinde
Sorry, I forgot to mention: When we were building the test case, we ran a lot of experiments with 1 GB of shared buffers, and were taking a clear performance hit anytime the shared buffers seemed to hit the 1GB barrier. Increasing the shared buffer size to 2GB, improved performance significant

Re: [BUGS] why provide cross type arithmetic operators

2008-01-22 Thread Gregory Stark
"ykhuang" <[EMAIL PROTECTED]> writes: > there are many cross type arithmetic operators, like int2 + int4, int8 + > int4, I think these can be deleted. Here are the reasons, after deleted, > int2 + int4 will choose the operator int4 + int4, int8 + int4 choose int8 + > int8, Is that ok? Thanks.

Re: [BUGS] BUG #3881: lo_open leaks memory

2008-01-22 Thread Michael Akinde
Thanks for taking the time to look into the problem. It is much appreciated. Tom Lane wrote: Michael Akinde <[EMAIL PROTECTED]> writes: I use the following script to create a test table. For /tmp/oidfile.temp, I use "FAQ_farsi" from the PostgreSQL installation (about 140kb). Okay, I r

[BUGS] bad message or bad privilege check in foreign key constraint

2008-01-22 Thread hubert depesz lubaczewski
apparently revoking update rights on referencing table blocks deletes on master table: (user test, database test, user test is not superuser) > create table a (id serial primary key, x text); NOTICE: CREATE TABLE will create implicit sequence "a_id_seq" for serial column "a.id" NOTICE: CREATE

[BUGS] why provide cross type arithmetic operators

2008-01-22 Thread ykhuang
there are many cross type arithmetic operators, like int2 + int4, int8 + int4, I think these can be deleted. Here are the reasons, after deleted, int2 + int4 will choose the operator int4 + int4, int8 + int4 choose int8 + int8, Is that ok? Thanks. ---(end of broadcast)

Re: [BUGS] why provide cross type arithmetic operators

2008-01-22 Thread ykhuang
for example, postgres=# select int2'1' + int8'1'; ERROR: operator is not unique: smallint + bigint LINE 1: select int2'1' + int8'1'; ^ HINT: Could not choose a best candidate operator. You may need to add explicit type casts. there are int4 + int8 and int8 + int8, but no