[HACKERS] lwlocks and starvation

2004-11-24 Thread Neil Conway
LWLockRelease() currently does something like (simplifying a lot): acquire lwlock spinlock decrement lock count if lock is free if first waiter in queue is waiting for exclusive lock, awaken him; else, walk through the queue and awaken all the shared waiters until we

Re: [HACKERS] Bitmap index

2004-11-24 Thread Neil Conway
On Mon, 2004-11-22 at 07:57 +, PaweX Niewiadomski wrote: I saw discussion about bitmap indexes few weeks ago. I wonder if any of you is working on it (in secret)? For what it's worth, I don't know of anyone working on them. I will be chosing subject of my master thesis and thougth about

Re: [HACKERS] [JDBC] Strange server error with current 8.0beta driver

2004-11-24 Thread Oliver Jowett
Barry Lind wrote: I also have the test case (in java) down to the bare minimum that generated the following output (that test case is attached). (Note that if the FETCH in the test case is not executed then the backend crashes; with the FETCH you get an error: ERROR: unrecognized node type: 0) I

Re: [HACKERS] [JDBC] Strange server error with current 8.0beta driver

2004-11-24 Thread Oliver Jowett
Oliver Jowett wrote: Perhaps PerformCursorOpen should copy the query tree before planning, or plan in a different memory context? Patch attached. It moves query planning inside the new portal's memory context. With this applied I can run Barry's testcase without errors, and valgrind seems OK

[HACKERS] valgrind complaints in pgstat_write_statsfile

2004-11-24 Thread Oliver Jowett
Seen in passing when running valgrind against a CVS HEAD build: ==28598== Syscall param write(buf) contains uninitialised or unaddressable byte(s) ==28598==at 0x1BABC558: write (in /lib/libc-2.3.4.so) ==28598==by 0x1BA7165D: (within /lib/libc-2.3.4.so) ==28598==by 0x1BA715FE:

Re: [HACKERS] patch: plpgsql - access records with rec.(expr)

2004-11-24 Thread Neil Conway
Mike Rylander wrote: As an alternative, what would be the possibility of creating a new PL as a contrib module, say PLPGSQL_NG, to move forward with extensions like this and perhaps EVALUATE? I think the idea of rewriting PL/PgSQL from scratch has merit (and it's something that I think would be

Re: [HACKERS] -V, --version -- deprecated?

2004-11-24 Thread Peter Eisentraut
Neil Conway wrote: The --help output for most of the binaries we install does not include the -V option (just its alias, --version). Is this intentional? (Note that we still document this option in the reference pages for some commands, and initdb's help output does include -V.) --help and

Re: [HACKERS] patch: plpgsql - access records with rec.(expr)

2004-11-24 Thread Joachim Wieland
On Tue, Nov 23, 2004 at 10:33:50AM -0500, Tom Lane wrote: We do need to do something about the fact that EXECUTE can't access plpgsql variables, though I'm afraid that fixing that is going to require a rather complete overhaul of plpgsql :-(. But it needs one anyway. Why do you think that it

Re: [HACKERS] Trouble with plpgsql on 7.4.6

2004-11-24 Thread D'Arcy J.M. Cain
On Tue, 23 Nov 2004 07:25:17 -0500 D'Arcy J.M. Cain [EMAIL PROTECTED] wrote: #0 0x483cafeb in kill () from /usr/lib/libc.so.12 #1 0x483cd0af in __libc_mutex_catchall_stub (m=1212478892) at /usr/src/lib/libc/thread-stub/thread-stub.c:112 #2 0x4843f0f7 in free (ptr=incomplete type)

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Bruce Momjian
Neil Conway wrote: LWLockRelease() currently does something like (simplifying a lot): acquire lwlock spinlock decrement lock count if lock is free if first waiter in queue is waiting for exclusive lock, awaken him; else, walk through the queue and awaken all

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Neil Conway
Bruce Momjian wrote: My guess is the existing behavior was designed to allow waking of multiple waiters _sometimes_ without starving of exclusive waiters. Well, I think the current algorithm *does* allow starvation, at least in some situations. Consider a workload in which a new shared reader

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Bruce Momjian
Neil Conway wrote: Bruce Momjian wrote: My guess is the existing behavior was designed to allow waking of multiple waiters _sometimes_ without starving of exclusive waiters. Well, I think the current algorithm *does* allow starvation, at least in some situations. Consider a workload in

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Neil Conway
Bruce Momjian wrote: I thought the new readers will sit after the writer in the FIFO queue so the writer will not starve. AFAICS, that is not the case. See lwlock.c, circa line 264: in LW_SHARED mode, we check if exclusive is zero; if so, we acquire the lock (increment the shared lock count and

Re: [HACKERS] -V, --version -- deprecated?

2004-11-24 Thread Neil Conway
Peter Eisentraut wrote: --help and --version are the standard options that are supported everywhere. In the era before we had long options everywhere, we implemented -V as an alternative in some programs, in particular those in and around initdb, because of the version cross-checking it does

Re: [HACKERS] patch: plpgsql - access records with rec.(expr)

2004-11-24 Thread Matt
I think the idea of rewriting PL/PgSQL from scratch has merit (and it's something that I think would be well worth doing). IMHO it's not really worth the trouble to fork the existing code base and add new features to something that, hopefully, has a limited life span. I dunno, I kind of

Re: [HACKERS] patch: plpgsql - access records with rec.(expr)

2004-11-24 Thread Tom Lane
Joachim Wieland [EMAIL PROTECTED] writes: On Tue, Nov 23, 2004 at 10:33:50AM -0500, Tom Lane wrote: We do need to do something about the fact that EXECUTE can't access plpgsql variables, though I'm afraid that fixing that is going to require a rather complete overhaul of plpgsql :-(. But it

Re: [Testperf-general] Re: [HACKERS] ExclusiveLock

2004-11-24 Thread Bort, Paul
Title: RE: [Testperf-general] Re: [HACKERS] ExclusiveLock From: Kenneth Marshall [mailto:[EMAIL PROTECTED]] [snip] The simplest idea I had was to pre-layout the WAL logs in a contiguous fashion on the disk. Solaris has this ability given appropriate FS parameters and we should be able

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: LWLockRelease() currently does something like (simplifying a lot): ... This has the nice property that locks are granted in FIFO order. Is it essential that we maintain that property? Not really, although avoiding indefinite starvation is important. If

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: AFAICS, that is not the case. See lwlock.c, circa line 264: in LW_SHARED mode, we check if exclusive is zero; if so, we acquire the lock (increment the shared lock count and do not block). And exclusive is set non-zero only when we _acquire_ a lock in

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: (Speaking of which, the exclusive field is declared as a char; I wonder if it wouldn't be more clear to declare it as bool, and treat it as a boolean field. I coded it that way because I was thinking of it as a count (0 or 1), for symmetry with the count

[HACKERS] Encrypt data type LO

2004-11-24 Thread Alberto Piña
Hi fellows, I need to encrypt fields of data type LO (LO is included in the contrib section of PostgreSQL) and I dont know if pgcrypto is the way to do that or there is another way.  If anyone knows the answer of my problem or know an alternative way to do this, Ill appreciate you can

Re: [HACKERS] valgrind complaints in pgstat_write_statsfile

2004-11-24 Thread Tom Lane
Oliver Jowett [EMAIL PROTECTED] writes: Seen in passing when running valgrind against a CVS HEAD build: ==28598== Syscall param write(buf) contains uninitialised or unaddressable byte(s) Anything to be concerned about? AFAIK this represents valgrind complaining because we have written out

Re: [HACKERS] Encrypt data type LO

2004-11-24 Thread James Robinson
We do all of our encryption in the middleware: 1) translate our data which requires encryption into an XML string 2) compress + encrypt, yielding byte []. 3) Store byte [] as a bytea column. The resulting byte arrays are relatively small in our case (1 - 3K), so bytea has

Re: [HACKERS] OpenBSD/Sparc status

2004-11-24 Thread Darcy Buskermolen
On November 23, 2004 06:18 pm, Michael Fuhr wrote: On Tue, Nov 23, 2004 at 12:47:28PM -0800, Darcy Buskermolen wrote: I'm guessing we need to add some more configure logic to detect gcc versions 3.4 on sparc trying to produce 64bit code and disable optimizations, or else bail out and ask

Re: [HACKERS] Beta5 now Available

2004-11-24 Thread Gavin M. Roy
No you can not, but the tracker isn't very resource intesive from my past experience. I can host it if needed. Gavin Marc G. Fournier wrote: On Wed, 24 Nov 2004, Thomas Hallgren wrote: Gaetano Mendola wrote: ...so the very first client is the real server that must be run 24/24. I don't think

Re: [HACKERS] Beta5 now Available

2004-11-24 Thread Marc G. Fournier
On Wed, 24 Nov 2004, Gavin M. Roy wrote: No you can not, but the tracker isn't very resource intesive from my past experience. I can host it if needed. It wasn't that that I was thinking of ... just wondering if there was some way of having it redundant, instead of centralized ... nice thing

Re: [HACKERS] Beta5 now Available

2004-11-24 Thread Joshua D. Drake
Marc G. Fournier wrote: On Wed, 24 Nov 2004, Gavin M. Roy wrote: No you can not, but the tracker isn't very resource intesive from my past experience. I can host it if needed. It wasn't that that I was thinking of ... just wondering if there was some way of having it redundant, instead of

Re: [HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-24 Thread Andrew Dunstan
Tom Lane said: Mark Kirkwood [EMAIL PROTECTED] writes: It seems that the check in src/pl/plperl/plperl.c eval_pv((safe_version 2.09 ? safe_bad : safe_ok), FALSE); is not working quite as expected (CVS HEAD from today): Yah know, I looked at that on Monday and said to myself Self, that

Re: [HACKERS] [JDBC] Strange server error with current 8.0beta driver

2004-11-24 Thread Barry Lind
Oliver, The patch works for me. Thanks. Things look good now against an 8.0 server. (I still have a lot more testing to do though). However I still have problems against a 7.4 server with the 8.0 jdbc driver. (ERROR: no value found for parameter 1). You mentioned that you had found this bug

Re: [HACKERS] MAX/MIN optimization via rewrite (plus query rewrites

2004-11-24 Thread Mark Kirkwood
I think a summary of where the discussion went might be helpful (especially for me after a week or so away doing perl). There were a number of approaches suggested, which I will attempt to summarize in a hand wavy fashion - (apologies for any misrepresentation caused): i) Rewrite max/min

[HACKERS] Intermittent bug

2004-11-24 Thread Thomas Hallgren
Hi, I have an intermittent bug in PL/Java that only shows up on Win32. Is there any way of debugging the postgres.exe process that corresponds to your connection on a win32 (MinGW) platform? I have a MinGW environment with gdb but I can't figure out how to make gdb attach to a running process

[HACKERS] plpgsql lacks generic identifier for record in triggers...

2004-11-24 Thread Sean Chittenden
Now that pgmemcache is getting more use, I've heard a couple of groans regarding the need to have two functions with exactly the same code body. This is necessary because there is no generic way of handling NEW/OLD. For example: db=# CREATE FUNCTION schma.tbl_ins_upd() RETURNS TRIGGER AS

Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...

2004-11-24 Thread Sean Chittenden
Now that pgmemcache is getting more use, I've heard a couple of groans regarding the need to have two functions with exactly the same code body. This is necessary because there is no generic way of handling NEW/OLD. For example: [snip] Err... wait, this is a classic case of send first then

Re: [HACKERS] -V, --version -- deprecated?

2004-11-24 Thread Bruce Momjian
Neil Conway wrote: Peter Eisentraut wrote: --help and --version are the standard options that are supported everywhere. In the era before we had long options everywhere, we implemented -V as an alternative in some programs, in particular those in and around initdb, because of the

Re: [HACKERS] How to make @id or $id as parameter name in plpgsql,

2004-11-24 Thread Francisco Figueiredo Jr.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Arnold.Zhu wrote: | I want to use @id, @name as plpgsql's parameter, then I've no need to change C# source, | only change Npgsql driver not to trim @ and stored procedure to plpgsql. | Hi Arnold, Npgsql already supports parameter names starting with @.

Re: [HACKERS] How to make @id or $id as parameter name in plpgsql,is it available?

2004-11-24 Thread Arnold.Zhu
Hello, Francisco Figueiredo Jr. plpgsql did not support @id as parameter(need double-quote), somebody suggest me to use vid for parameter. When use vid as parameter for plpgsql, in C# program we use @vid, Npgql will delete @, then pass vid to plpgsql. So I want to change Npgsql not to delete @

Re: [HACKERS] Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE

2004-11-24 Thread Bruce Momjian
ronzo wrote: Hi Was already implemented the timeout on the SELECT ... FOR UPDATE (non-blocking lock) and/or is possible known if the lock exist on the specified ROW before executing the SELECT? Please note: ours need is the timeout/verify at the ROW level, not at the table level.

Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...

2004-11-24 Thread Tom Lane
Sean Chittenden [EMAIL PROTECTED] writes: ... Better yet, could TRIGGER functions be allowed to return nothing (ala VOID)? Which would tell the backend to assume that the row wasn't changed and proceed with its handling. This is the preferred approach, IMHO... but I think is the hardest

Re: [HACKERS] Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE

2004-11-24 Thread Rod Taylor
On Wed, 2004-11-24 at 22:13 -0500, Bruce Momjian wrote: We have discussed this at length and no one could state why having an timeout per lock is any better than using a statement_timeout. Actually, I hit one. I have a simple queue and a number of processes pulling jobs out of the queue. Due

Re: [HACKERS] Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE

2004-11-24 Thread Bruce Momjian
Rod Taylor wrote: On Wed, 2004-11-24 at 22:13 -0500, Bruce Momjian wrote: We have discussed this at length and no one could state why having an timeout per lock is any better than using a statement_timeout. Actually, I hit one. I have a simple queue and a number of processes pulling

Re: [HACKERS] Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE

2004-11-24 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Rod Taylor wrote: Anyway, it shows a situation where it would be nice to differentiate between statement_timeout and lock_timeout OR it demonstrates that I should be using userlocks... Wouldn't a LOCK NOWAIT be a better solution? That is new in 8.0.

Re: [HACKERS] Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE

2004-11-24 Thread Rod Taylor
On Wed, 2004-11-24 at 22:47 -0500, Bruce Momjian wrote: Rod Taylor wrote: On Wed, 2004-11-24 at 22:13 -0500, Bruce Momjian wrote: We have discussed this at length and no one could state why having an timeout per lock is any better than using a statement_timeout. Actually, I hit

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Tom Lane
I wrote: Neil Conway [EMAIL PROTECTED] writes: AFAICS, that is not the case. See lwlock.c, circa line 264: in LW_SHARED mode, we check if exclusive is zero; if so, we acquire the lock (increment the shared lock count and do not block). And exclusive is set non-zero only when we _acquire_ a

[HACKERS] pg_dump for values inserted in last day

2004-11-24 Thread vertigo
Hello I need to pg_dump my database, but i want only to receive sql commands which will insert row which were inserted into database today. Is there any way to do it ? I have large database and i want to make incremential backups. Thanx Michal ---(end of

Re: [HACKERS] pg_dump for values inserted in last day

2004-11-24 Thread Christopher Browne
Oops! vertigo [EMAIL PROTECTED] was seen spray-painting on a wall: Hello I need to pg_dump my database, but i want only to receive sql commands which will insert row which were inserted into database today. Is there any way to do it ? I have large database and i want to make incremential

[HACKERS] Solaris 8 regression test failure with 8.0.0beta5

2004-11-24 Thread Kenneth Marshall
Here are the diffs for the regression test failures on Solaris 8. The tests work fine on Redhat9 and Redhat Enterprise Linux 3. Ken Marshall *** ./expected/errors.out Sat Mar 13 22:25:17 2004 --- ./results/errors.outTue Nov 23 14:09:45 2004 *** *** 297,303 --

Re: [Testperf-general] Re: [HACKERS] ExclusiveLock

2004-11-24 Thread Kenneth Marshall
On Wed, Nov 24, 2004 at 11:00:30AM -0500, Bort, Paul wrote: From: Kenneth Marshall [mailto:[EMAIL PROTECTED] [snip] The simplest idea I had was to pre-layout the WAL logs in a contiguous fashion on the disk. Solaris has this ability given appropriate FS parameters and we should be

Re: [HACKERS] Beta5 now Available

2004-11-24 Thread Marc G. Fournier
On Wed, 24 Nov 2004, Joshua D. Drake wrote: Marc G. Fournier wrote: On Wed, 24 Nov 2004, Gavin M. Roy wrote: No you can not, but the tracker isn't very resource intesive from my past experience. I can host it if needed. It wasn't that that I was thinking of ... just wondering if there was some

Re: [HACKERS] Beta5 now Available

2004-11-24 Thread Gavin M. Roy
To a degree you are correct. AFAIK new downloads could not start if the tracker crashed. The tracker is the traffic cop that tells peer nodes about each other. I dont believe the tracker that comes from the main bit torrent author allows for multiple trackers with a common data repository,

[HACKERS] follow-up to previous build problem for 8.0.0beta5 on SPARC

2004-11-24 Thread Kenneth Marshall
The failure that I posted earlier for 8.0.0beta5 on Solaris 8/SPARC with gcc-3.4.0 and -O3 can be worked around by disabling the interblock scheduling. I used the following gcc options and 8.0.0beta5 built fine on the SPARC Solaris 8 machine: gcc -O3 -fno-sched-interblock ... The Redhat 9 and

Re: [HACKERS] lwlocks and starvation

2004-11-24 Thread Neil Conway
On Wed, 2004-11-24 at 23:30 -0500, Tom Lane wrote: It is not a 100% solution because it does not cover the case where a waiting exclusive locker is released, then a new shared locker arrives at the lock before the exclusive locker is given any cycles to acquire the lock. However I don't see

[HACKERS] Help!

2004-11-24 Thread ElayaRaja S
Hi, While configuring OpenCRX by using Postgresql i am facing probmelm. The problem while creating db using the command ( createdb -h localhost -E utf8 -U system crx-CRX ) . Erro: createdb: could not connect to database template1: could not connect to server: Connection refused Is the

Re: [HACKERS] Solaris 8 regression test failure with 8.0.0beta5

2004-11-24 Thread Tom Lane
Kenneth Marshall [EMAIL PROTECTED] writes: Here are the diffs for the regression test failures on Solaris 8. The tests work fine on Redhat9 and Redhat Enterprise Linux 3. ... and most other platforms ... select 1/0; ! ERROR: floating-point exception ! DETAIL: An invalid floating-point