Re: [HACKERS] WAL, xl_heap_insert and tuple oid mystry

2011-04-11 Thread Heikki Linnakangas
On 11.04.2011 23:35, jagan wrote: Hi, Suppose I create a table as follows: CREATE TABLE test2 (name TEXT, age INTEGER) WITH oids; Now, for every tuple in this table is associated with a unique oid, which I can retrieve by: SELECT oid, name, age FROM test2; which works great. So far so good.

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
On 2011-04-11 23:30, Alvaro Herrera wrote: Excerpts from Jesper Krogh's message of lun abr 11 17:07:33 -0300 2011: But when the locking is done "row-level" then it is correct to do it that way. It would allthough be nice with a weaker locklevel for that kind of updates (I have no clue if that i

[HACKERS] Calling Matlab function from Postgres

2011-04-11 Thread Susan M Farley
I'm trying to call MATLAB functions from PostgreSQL. I was trying to use Joshua Kaplan's java MATLAB control. I install my jar file which in turn calls MATLAB to run my algorithm, but get the error message "ERROR: java.lang.NoClassDefFoundError: matlabcontrol/RemoteMatlabProxyFactory" when I c

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread A.M.
On Apr 11, 2011, at 7:13 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Apr 11, 2011 at 3:11 PM, A.M. wrote: >>> What do you mean by "leakier"? The goal here is to extinguish SysV shared >>> memory for portability and convenience benefits. The mini-SysV proposal was >>> implemented and

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread A.M.
On Apr 11, 2011, at 7:25 PM, Tom Lane wrote: > Robert Haas writes: >> On Sun, Apr 10, 2011 at 5:03 PM, A.M. wrote: >>> To ensure that no two postmasters can startup in the same data directory, I >>> use fcntl range locking on the data directory lock file, which also works >>> properly on (pro

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread Tom Lane
Robert Haas writes: > On Sun, Apr 10, 2011 at 5:03 PM, A.M. wrote: >> To ensure that no two postmasters can startup in the same data directory, I >> use fcntl range locking on the data directory lock file, which also works >> properly on (properly configured) NFS volumes. Whenever a postmaster

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 11, 2011 at 3:11 PM, A.M. wrote: >> What do you mean by "leakier"? The goal here is to extinguish SysV shared >> memory for portability and convenience benefits. The mini-SysV proposal was >> implemented and shot down by Tom Lane. > I mean I'm not convinced th

[HACKERS] Postgre inner work question

2011-04-11 Thread Lucas Cotta
Hi! Does postgre execute the queries following a execution plan tree, where the leafs are table scans, and the nodes are joins? I'm looking for a database where I can get a cardinality from a partial result of the execution... for example, print the cardinality of the results until the next join

[HACKERS] Postgre inner work question

2011-04-11 Thread Lucas Cotta
Hi! Does postgre execute the queries following a execution plan tree, where the leafs are table scans, and the nodes are joins? I'm looking for a database where I can get a cardinality from a partial result of the execution... for example, print the cardinality of the results until the next join

Re: [HACKERS] lowering privs in SECURITY DEFINER function

2011-04-11 Thread Jim Nasby
On Apr 8, 2011, at 6:17 PM, Alvaro Herrera wrote: >> In other words, if you wrap an unprivileged operation inside of >> privileged operations, it seems like the unprivileged operation then >> becomes privileged. Right? > > Well, it's in the hands of the creator of the overall wrapper function > to

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread Robert Haas
On Mon, Apr 11, 2011 at 3:11 PM, A.M. wrote: > > On Apr 11, 2011, at 6:06 PM, Robert Haas wrote: > >> On Sun, Apr 10, 2011 at 5:03 PM, A.M. wrote: >>> To ensure that no two postmasters can startup in the same data directory, I >>> use fcntl range locking on the data directory lock file, which al

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread A.M.
On Apr 11, 2011, at 6:06 PM, Robert Haas wrote: > On Sun, Apr 10, 2011 at 5:03 PM, A.M. wrote: >> To ensure that no two postmasters can startup in the same data directory, I >> use fcntl range locking on the data directory lock file, which also works >> properly on (properly configured) NFS vo

Re: [HACKERS] POSIX shared memory redux

2011-04-11 Thread Robert Haas
On Sun, Apr 10, 2011 at 5:03 PM, A.M. wrote: > To ensure that no two postmasters can startup in the same data directory, I > use fcntl range locking on the data directory lock file, which also works > properly on (properly configured) NFS volumes. Whenever a postmaster or > postmaster child sta

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Alvaro Herrera
Excerpts from Jesper Krogh's message of lun abr 11 17:07:33 -0300 2011: > But when the locking is done "row-level" then it is correct > to do it that way. It would allthough be nice with a weaker > locklevel for that kind of updates (I have no clue if that is > a hard problem). http://www.command

[HACKERS] WAL, xl_heap_insert and tuple oid mystry

2011-04-11 Thread jagan
Hi, Suppose I create a table as follows: CREATE TABLE test2 (name TEXT, age INTEGER) WITH oids; Now, for every tuple in this table is associated with a unique oid, which I can retrieve by: SELECT oid, name, age FROM test2; which works great. So far so good. Now, if look at the corresponding W

Re: [HACKERS] Windows build issues

2011-04-11 Thread Peter Eisentraut
On tor, 2011-04-07 at 16:20 -0400, Robert Haas wrote: > It sure would be nice if someone would write a doc patch, or at least > a wiki page, explaining all the permutations here... I get the > impression it's not that hard to set up if you are reasonable > comfortable working in a Windows environm

Re: [HACKERS] lowering privs in SECURITY DEFINER function

2011-04-11 Thread Alvaro Herrera
Excerpts from Robert Haas's message of dom abr 10 13:37:46 -0300 2011: > It's maybe worth noting here that what's being asked for is roughly > what you get from UNIX's distinction between euid and ruid. Many > programs that run setuid root perform a few operations that require > root privileges u

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
On 2011-04-11 20:18, Jesper Krogh wrote: Hi. This seem a bit strange to me. In short: Not any more I.. I guess what made me a bit confused was that a "update table set key = value" would acually block out changes on tables referencing this tuple even if the referenced column wasn't effected by

[HACKERS] fn_collation in FmgrInfo considered harmful

2011-04-11 Thread Tom Lane
The fact that the collations patch put fn_collation into FmgrInfo, rather than FunctionCallInfo, has been bothering me for awhile. The collation is really a kind of argument, not a property of the function, so FmgrInfo is logically the wrong place for it. But I'd not found a concrete reason not t

Re: [HACKERS] Global variables in plpgsql

2011-04-11 Thread Pavel Stehule
Hello 2011/4/11 Nick Raj : > Hi, > Can anyone know how to define global variable in plpgsql? > Thanks > > Regards, > Raj > plpgsql doesn't support global or session variables. There are a few techniques - you can emulate it http://www.postgresql.org/docs/8.3/static/plperl-global.html Regards

Re: [HACKERS] how to keep/lock/ hide pg_hba.conf ?

2011-04-11 Thread Peter Eisentraut
On mån, 2011-04-11 at 07:35 -0700, john.cheng wrote: > I found that,if user modified the pg_hba.conf, modified the > "METHOD"field from md5 to "password" then,user can find out the > password by some the TCP/IP peep tool Don't do that then. Are you concerned that your users would do this? Well,

Re: [HACKERS] how to keep/lock/ hide pg_hba.conf ?

2011-04-11 Thread Jaime Casanova
On Mon, Apr 11, 2011 at 9:35 AM, john.cheng wrote: > I found that,if user modified the pg_hba.conf, modified the "METHOD"field > from md5 to "password" if it's a client/server app the user shouldn't have access to the server, so how could him to make the change? Also the directory in which the p

Re: [HACKERS] switch UNLOGGED to LOGGED

2011-04-11 Thread Robert Haas
On Mon, Apr 11, 2011 at 10:29 AM, Noah Misch wrote: > On Mon, Apr 11, 2011 at 11:41:18AM +0100, Leonardo Francalanci wrote: >> > > But re-reading  it, I don't understand: what's the difference in creating >> > > a new  "regular" table and crashing before emitting the abort record, >> > > and  conv

[HACKERS] how to keep/lock/ hide pg_hba.conf ?

2011-04-11 Thread john.cheng
Dear all: I am ready to release a client/server software (in windows xp),sure it's postgresql based application but I have to hide the password for sensitive data. I found that,if user modified the pg_hba.conf, modified the "METHOD"field from md5 to "password" then,user can find out the password by

Re: [HACKERS] Global variables in plpgsql

2011-04-11 Thread Christopher Browne
On Mon, Apr 11, 2011 at 7:33 AM, Nick Raj wrote: > Can anyone know how to define global variable in plpgsql? I expect you should consult the manual page on the command CREATE TABLE. That's what would be the nearest SQL equivalent to a "global variable." http://www.postgresql.org/docs/9.0/static

Re: [HACKERS] workaround for expensive KNN?

2011-04-11 Thread PostgreSQL - Hans-Jürgen Schönig
price has a problem :(. "iphone" can be a 20 cents bag or a sticker or a 900 euro thing signed by whoever ... so, words and the sort-number / price are not related in anyway. price is in this case no way to narrow down the problem (e.g. evaluate first or so). many thanks,

[HACKERS] Global variables in plpgsql

2011-04-11 Thread Nick Raj
Hi, Can anyone know how to define global variable in plpgsql? Thanks Regards, Raj

Re: [HACKERS] SSI bug?

2011-04-11 Thread Kevin Grittner
Heikki Linnakangas wrote: > I finally got around to look at this. Attached patch adds a > HASH_FIXED_SIZE flag, which disables the allocation of new entries > after the initial allocation. I believe we have consensus to make > the predicate lock hash tables fixed-size, so that there's no > comp

[HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
Hi. This seem a bit strange to me. In short: 2 tables, one with has a foreign key to the other one; CREATE TABLE test (id SERIAL primary key, data text); CREATE TABLE testref(id SERIAL primary key, test_id integer references test(id) not null, data text); INSERT INTO test(data) values('someth

Re: [HACKERS] Feature request: pg_basebackup --force

2011-04-11 Thread Kevin Grittner
Heikki Linnakangas wrote: > That's exactly what pg_basebackup does. Once you move into more > complicated scenarios with multiple standbys and WAL archiving, > it's inevitably going to be more complicated to set up. > > That doesn't mean that we can't make it easier - we can and we > should -

Re: [HACKERS] SSI bug?

2011-04-11 Thread Heikki Linnakangas
On 03.04.2011 09:16, Dan Ports wrote: I think I see what is going on now. We are sometimes failing to set the commitSeqNo correctly on the lock. In particular, if a lock assigned to OldCommittedSxact is marked with InvalidSerCommitNo, it will never be cleared. The attached patch corrects this:

Re: [HACKERS] SSI bug?

2011-04-11 Thread Heikki Linnakangas
On 11.04.2011 11:33, Heikki Linnakangas wrote: On 31.03.2011 22:06, Kevin Grittner wrote: Heikki Linnakangas wrote: That's not enough. The hash tables can grow beyond the maximum size you specify in ShmemInitHash. It's just a hint to size the directory within the hash table. We'll need to tea

Re: [HACKERS] switch UNLOGGED to LOGGED

2011-04-11 Thread Noah Misch
On Mon, Apr 11, 2011 at 11:41:18AM +0100, Leonardo Francalanci wrote: > > > But re-reading it, I don't understand: what's the difference in creating > > > a new "regular" table and crashing before emitting the abort record, > > > and converting an unlogged table to logged and crashing before > >

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-11 Thread Tom Lane
Heikki Linnakangas writes: > Does anyone object to making BETWEEN and IN more strict about the data > types? At the moment, you can do this: > postgres=# SELECT '1234' BETWEEN '10001'::text AND 10002::int4; > ?column? > -- > t > (1 row) > I'm thinking that it should throw an error.

Re: [HACKERS] pgfoundry down?

2011-04-11 Thread Marc G. Fournier
Apologies ... everything should be back up and running now ... On Mon, 11 Apr 2011, Tatsuo Ishii wrote: Does anybody know what's going on? -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-11 Thread Heikki Linnakangas
On 11.04.2011 19:06, Kevin Grittner wrote: Heikki Linnakangas wrote: On 05.04.2011 18:42, Heikki Linnakangas wrote: On 05.04.2011 13:19, Marti Raudsepp wrote: On Fri, Apr 1, 2011 at 14:24, Heikki Linnakangas wrote: We sometimes transform IN-clauses to a list of ORs: postgres=# explain SEL

Re: [HACKERS] Re: [COMMITTERS] pgsql: Don't make "replication" magical as a user name, only as a datab

2011-04-11 Thread Andrew Dunstan
On 04/10/2011 10:17 PM, Andrew Dunstan wrote: On 04/10/2011 09:47 PM, Fujii Masao wrote: On Mon, Apr 11, 2011 at 3:53 AM, Andrew Dunstan wrote: Don't make "replication" magical as a user name, only as a database name, in pg_hba.conf. Is it worth backporting this change to 9.0? I didn'

[HACKERS] pgfoundry down?

2011-04-11 Thread Tatsuo Ishii
Does anybody know what's going on? -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgs

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-11 Thread Kevin Grittner
Heikki Linnakangas wrote: > On 05.04.2011 18:42, Heikki Linnakangas wrote: >> On 05.04.2011 13:19, Marti Raudsepp wrote: >>> On Fri, Apr 1, 2011 at 14:24, Heikki Linnakangas >>> wrote: We sometimes transform IN-clauses to a list of ORs: postgres=# explain SELECT * FROM foo WHERE a

Re: [HACKERS] SSI bug?

2011-04-11 Thread Heikki Linnakangas
On 31.03.2011 22:06, Kevin Grittner wrote: Heikki Linnakangas wrote: That's not enough. The hash tables can grow beyond the maximum size you specify in ShmemInitHash. It's just a hint to size the directory within the hash table. We'll need to teach dynahash not to allocate any more entries af

Re: [HACKERS] developer.postgresql.org down

2011-04-11 Thread Marc G. Fournier
Everything should be back up and running now ... sorry for delay ... On Mon, 11 Apr 2011, Albert Cervera i Areny wrote: Maybe already known or in scheduled maintenance but developer.postgresql.org seems to be down right now. -- Albert Cervera i Areny http://www.NaN-tic.com OpenERP Partne

[HACKERS] developer.postgresql.org down

2011-04-11 Thread Albert Cervera i Areny
Maybe already known or in scheduled maintenance but developer.postgresql.org seems to be down right now. -- Albert Cervera i Areny http://www.NaN-tic.com OpenERP Partners Tel: +34 93 553 18 03 skype: nan-oficina http://twitter.com/albertnan http://www.nan-tic.com/blog

Re: [HACKERS] switch UNLOGGED to LOGGED

2011-04-11 Thread Leonardo Francalanci
> > But re-reading it, I don't understand: what's the difference in creating > > a new "regular" table and crashing before emitting the abort record, > > and converting an unlogged table to logged and crashing before > > emitting the abort record? How do the standby servers handle a > > "CREATE

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-11 Thread Heikki Linnakangas
On 05.04.2011 18:42, Heikki Linnakangas wrote: On 05.04.2011 13:19, Marti Raudsepp wrote: On Fri, Apr 1, 2011 at 14:24, Heikki Linnakangas wrote: We sometimes transform IN-clauses to a list of ORs: postgres=# explain SELECT * FROM foo WHERE a IN (b, c); QUERY PLAN Seq Scan on foo (cost=0.00..

Re: [HACKERS] SSI bug?

2011-04-11 Thread Heikki Linnakangas
On 11.04.2011 11:33, Heikki Linnakangas wrote: I also noticed that there's a few hash_search(HASH_ENTER) calls in predicate.c followed by check for a NULL result. But with HASH_ENTER, hash_search never returns NULL, it throws an "out of shared memory" error internally. I changed those calls to us

Re: [HACKERS] SSI bug?

2011-04-11 Thread YAMAMOTO Takashi
hi, > hi, > >> I think I see what is going on now. We are sometimes failing to set the >> commitSeqNo correctly on the lock. In particular, if a lock assigned to >> OldCommittedSxact is marked with InvalidSerCommitNo, it will never be >> cleared. >> >> The attached patch corrects this: >> Trans