Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Teodor Sigaev
Tsearch was never minded as prefix search, and index structure doesn't support any kind of prefix or suffix. But you can write extension to tsearch, which will search by prefix. But such solution wiil not use index, only sequence scan. How efficient would tsearch be for really big expressions

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Hannu Krosing
Teodor Sigaev kirjutas K, 10.12.2003 kell 11:20: Tsearch was never minded as prefix search, and index structure doesn't support any kind of prefix or suffix. But you can write extension to tsearch, which will search by prefix. But such solution wiil not use index, only sequence scan.

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Teodor Sigaev
I meant that the expansion of 'hu%' is done before and outside of tsearch, so the question is how efficient will tsearch be for searching for hudreds or thousands of words in one expression. Ok, I see. The answer - bad. Index structure is signature tree with constant signature length, by default

Re: [HACKERS] ERROR: Index pg_toast_8443892_index is not a btree

2003-12-10 Thread strk
I agree about keeping it simple for the users. Anyway if that shows up a bad problems with either the implementation or the operating system of the users it would be nice to know how to inspect it further. In my case this could also help debugging a postgres extension (postgis) which is involved

Re: [HACKERS] 73.5 and uw 713

2003-12-10 Thread ohp
Hi Tom, At last I have a much better trace for the vacuum full bug. Can some one help me on this one? Image mémoire de postmaster (processus p1) créée FICHIER IMAGE MEMOIRE [swapn dans qsort.c] 11 (segv code[SEGV_MAPERR] address[0x842]) SIGNALE dans p1 0xbffae03f (swapn+47:)

[HACKERS] pljava revisited

2003-12-10 Thread Thomas Hallgren
Hi, I'm working on a new pl/java prototype that I hope will become production quality some time in the future. Before my project gets to far, I'd like to gather some input from other users. I've taken a slightly different approach than what seems to be the case for other attempts that I've managed

Re: [HACKERS] PostgreSQL port to pure Java?

2003-12-10 Thread Merlin Moncure
Robert Treat wrote: Someone did it but it didn't catch fire. I think what will catch fire in a big way is plphp. Managers will like an all php platform that is extremely capable and productive. Developers will enjoy php's natural syntax and agnostic approach to programming. PHP5, when it

Re: [HACKERS] ERROR: Index pg_toast_8443892_index is not a btree

2003-12-10 Thread Tom Lane
strk [EMAIL PROTECTED] writes: The question now is: what does that message mean ? It means that the magic number that should be on the first page of the btree index isn't right. We can deduce that something has clobbered the first page of the index, but guessing what and how requires much more

Re: [HACKERS] pljava revisited

2003-12-10 Thread Andrew Dunstan
Thomas Hallgren wrote: Hi, I'm working on a new pl/java prototype that I hope will become production quality some time in the future. Before my project gets to far, I'd like to gather some input from other users. I've taken a slightly different approach than what seems to be the case for other

Re: [HACKERS] ERROR: Index pg_toast_8443892_index is not a btree

2003-12-10 Thread Jan Wieck
Tom Lane wrote: strk [EMAIL PROTECTED] writes: The question now is: what does that message mean ? It means that the magic number that should be on the first page of the btree index isn't right. We can deduce that something has clobbered the first page of the index, but guessing what and how

Re: [HACKERS] pljava revisited

2003-12-10 Thread Andrew Rawnsley
On Dec 10, 2003, at 11:23 AM, Andrew Dunstan wrote: Thomas Hallgren wrote: Hi, I'm working on a new pl/java prototype that I hope will become production quality some time in the future. Before my project gets to far, I'd like to gather some input from other users. I've taken a slightly

Re: [HACKERS] pljava revisited

2003-12-10 Thread Thomas Hallgren
The JVM will be started on-demand. Although I realize that one JVM per connection will consume a fair amount of resources, I still think it is the best solution. The description of this system must of course make it very clear that this is what happens and ultimately provide the means of tuning

Re: [HACKERS] pljava revisited

2003-12-10 Thread Andrew Dunstan
Thomas Hallgren wrote: The JVM will be started on-demand. Although I realize that one JVM per connection will consume a fair amount of resources, I still think it is the best solution. The description of this system must of course make it very clear that this is what happens and ultimately

Re: [HACKERS] pljava revisited

2003-12-10 Thread Andrew Rawnsley
On Dec 10, 2003, at 1:51 PM, Andrew Dunstan wrote: Thomas Hallgren wrote: The JVM will be started on-demand. Although I realize that one JVM per connection will consume a fair amount of resources, I still think it is the best solution. The description of this system must of course make it very

Re: [HACKERS] pljava revisited

2003-12-10 Thread Jan Wieck
Andrew Rawnsley wrote: Other pl* (perl, python, tcl) languages have vanilla C glue code. Might be better to stick to this. If you aren't using advanced C++ features that shouldn't be too hard - well structured C can be just as readable as well structured C++. At the very lowest level, about

Re: [HACKERS] pljava revisited

2003-12-10 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Thomas Hallgren wrote: C++ or C is not a big issue. I might rewrite it into pure C. The main reason for C++ is to be able to use objects with virtual methods. I know how to do that in C too but I don't quite agree that its just as clean :-) Maybe not,

Re: [HACKERS] pljava revisited

2003-12-10 Thread Robert Treat
On Wed, 2003-12-10 at 13:04, Jan Wieck wrote: Andrew Rawnsley wrote: Other pl* (perl, python, tcl) languages have vanilla C glue code. Might be better to stick to this. If you aren't using advanced C++ features that shouldn't be too hard - well structured C can be just as readable as

Re: [HACKERS] pljava revisited

2003-12-10 Thread ow
--- Thomas Hallgren [EMAIL PROTECTED] wrote: The JVM will be started on-demand. Although I realize that one JVM per connection will consume a fair amount of resources, I still think it is the best solution. The description of this system must of course make it very clear that this is what

Re: [HACKERS] ERROR: Index pg_toast_8443892_index is not a btree

2003-12-10 Thread Robert Treat
On Tue, 2003-12-09 at 20:19, Jan Wieck wrote: Christopher Kings-Lynne wrote: I couldn't agree more. Look at this very instance. He now found the right reindex command and the corrupted file is gone. We don't have the slightest clue what happened to that file. Was it truncated? Did some

Re: [HACKERS] pljava revisited

2003-12-10 Thread Thomas Hallgren
Two comments. Context switches are of course much cheaper then loading a JVM. No argument there. The point is that the JVM is loaded once for each connection (when the connection makes the first call to a java function). Millions of calls may follow that reuses the same JVM. Each of those calls

[HACKERS] Canonicalization of WHERE clauses considered harmful

2003-12-10 Thread Tom Lane
I've been thinking about Josh's recent complaint about poor planning of queries like SELECT t1.a, t2.b FROM t1, t2 WHERE t1.a = t2.a AND ( ( t1.c = x AND t1.f IN (m, n, o) AND t2.d = v AND t2.e BETWEEN j AND k ) OR ( t1.c = y

Re: [HACKERS] Canonicalization of WHERE clauses considered harmful

2003-12-10 Thread Bruno Wolff III
On Wed, Dec 10, 2003 at 16:54:54 -0500, Tom Lane [EMAIL PROTECTED] wrote: In other words, we'd like the optimizer to transform (a AND b) OR (a AND c) to a AND (b OR c) Currently, this is accomplished by the roundabout method of converting the WHERE clause to CNF (AND-of-ORs)

Re: [HACKERS] Canonicalization of WHERE clauses considered harmful

2003-12-10 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: Shouldn't it be possible to simplify a AND (a OR c) AND (b OR a) AND (b OR c) to a AND (b or c) using a AND (a OR x) == a That would be one possible response, but it strikes me as a band-aid fix. It would add quite a bit of overhead (looking to see

Re: [HACKERS] Canonicalization of WHERE clauses considered harmful

2003-12-10 Thread Kurt Roeckx
On Wed, Dec 10, 2003 at 04:54:54PM -0500, Tom Lane wrote: Currently, this is accomplished by the roundabout method of converting the WHERE clause to CNF (AND-of-ORs) and then simplifying duplicate sub-clauses within an OR: (a AND b) OR (a AND c) expands by repeated application of the

Re: [HACKERS] Canonicalization of WHERE clauses considered harmful

2003-12-10 Thread Kurt Roeckx
On Wed, Dec 10, 2003 at 05:35:11PM -0500, Tom Lane wrote: Kurt Roeckx [EMAIL PROTECTED] writes: On Wed, Dec 10, 2003 at 04:54:54PM -0500, Tom Lane wrote: (a AND b) OR (a AND c) expands by repeated application of the distributive law to (a OR a) AND (a OR c) AND (b OR a) AND (b OR c)

[HACKERS] CSV hack

2003-12-10 Thread David Fetter
Kind people, I've come up with yet another little hack, this time for turning 1-d arrays into CSV format. It's very handy in conjunction with the array_accum aggregate (can this be made a standard aggregate?) in http://developer.postgresql.org/docs/postgres/xaggr.html. Here 'tis... CREATE OR

Re: [HACKERS] [pgadmin-support] Cannot add an column of type serial

2003-12-10 Thread Andreas Pflug
David Sigeti wrote: At 12:21 PM 12/10/2003 +0100, Andreas Pflug wrote: David Sigeti wrote: I am using pgadminIII 1.0.2 with PostgreSQL 7.4 under W2K SP4 and Cygwin (current as of 2 or 3 weeks ago). The server is running locally. If I attempt to add an column of type serial or bigserial to a

Re: [HACKERS] postgres panic error

2003-12-10 Thread Jason Tishler
Yurgis, On Tue, Dec 09, 2003 at 04:18:06PM -0800, Yurgis Baykshtis wrote: I tried to raise the question on pg-hackers forum and cygwin forum (regarding readdir() misbehavior) but could not get any help so far :( If you can produce a minimal test case that reproduces the problem, then one of

Re: [HACKERS] CSV hack

2003-12-10 Thread Joe Conway
David Fetter wrote: I've come up with yet another little hack, this time for turning 1-d arrays into CSV format. You mean like this (which is new in 7.4)? regression=# select array_to_string (array[1,2,3], ','); array_to_string - 1,2,3 (1 row) See:

Re: [Dbdpg-general] Re: [HACKERS] CSV hack

2003-12-10 Thread David Fetter
On Wed, Dec 10, 2003 at 05:08:19PM -0800, Joe Conway wrote: David Fetter wrote: I've come up with yet another little hack, this time for turning 1-d arrays into CSV format. You mean like this (which is new in 7.4)? regression=# select array_to_string (array[1,2,3], ',');

Re: [HACKERS] CSV hack

2003-12-10 Thread Andrew Dunstan
You also need to quote values containing the separator. cheers andrew (who used to set creating CSV as a programming exercise - students almost never get it right) David Fetter wrote: Kind people, I've come up with yet another little hack, this time for turning 1-d arrays into CSV format.