Re: [GENERAL] overhead of plpgsql functions over simple select

2008-10-24 Thread Ivan Sergio Borgonovo
On Fri, 24 Oct 2008 07:03:35 +0200 Pavel Stehule [EMAIL PROTECTED] wrote: 2008/10/24 Tom Lane [EMAIL PROTECTED]: Pavel Stehule [EMAIL PROTECTED] writes: postgres=# create function simplefce(a int, b int) returns int as $$select $1 + $2$$ language sql immutable strict; CREATE FUNCTION

[GENERAL] PostgreSQL 8.3.4 Solaris x86 compilation issues

2008-10-24 Thread Dot Yet
Hi everyone, i am facing some problem while compiling postgresql 8.3.4 on Solaris 10 x86 10u5. the compiler is SunStudio 12. The compilation happens without errors, but make check fails: OpenSSL 0.9.8i compiled as: ./Configure --prefix=/opt/usr/local -m64 -xmodel=medium PostgreSQL 8.3.4

Re: [GENERAL] Storing questionnaire data

2008-10-24 Thread Thom Brown
Thanks David and Jeff. I can see your point. The provided link might actually be useful, although I think I'd make some changes to it. I wouldn't have trouble data-mining such a structure for individual questionnaire results. The planner will be shrugging its shoulders, but I haven't actually

[GENERAL] partitioning question. need current month and archive partitions.

2008-10-24 Thread Sergey Levchenko
Hi All! I have a table - transaction pool - with a lot of rows, but I use only data for the latest month, or current year in my computations. How can I split data to partitions like that if I can't use CHECK constraints with non constant objects like, extract('month' from CURRENT_DATE),

[GENERAL] Query m:n-Combination

2008-10-24 Thread Ludwig Kniprath
Dear list, I have to solve a simple Problem, explained below with some sample-Data. A typical M:N-constellation, rivers in one table, communities in the other table, m:n-join-informations (which river is running in which community) in a third table. Table rivers: R_ID R_Name 1 river_1 2

Re: [GENERAL] Need Tool to sync databases with 8.3.1

2008-10-24 Thread Stefan Sturm
Hello, reopening this thread, because I just received e-mail from EMS that they just release EMS DB Comparer with PostgreSQL 8.3 support. I'm going to evaluate this, so I realized people here may be interested. http://sqlmanager.net/en/products/postgresql/dbcomparer/download this app looks

Re: [GENERAL] docbook xml into/out-of sql-tables

2008-10-24 Thread Peter Eisentraut
Otto Hirr wrote: I'm looking for pointers to info on storeing / retreving docbook, or other document type systems, in sql tables. Make a column of type xml and store it there. But we don't have schema validation for xml data yet. -- Sent via pgsql-general mailing list

Re: [GENERAL] Query m:n-Combination

2008-10-24 Thread Albe Laurenz
Ludwig Kniprath wrote: A typical M:N-constellation, rivers in one table, communities in the other table, m:n-join-informations (which river is running in which community) in a third table. Table rivers: R_ID R_Name 1 river_1 2 river_2 3 river_3 4 river_4 5

Re: [GENERAL] Query m:n-Combination

2008-10-24 Thread Thomas Markus
hi, try select r.* from rivers r join jointable j1 on r.r_id=j1.mn_2_r_id join communities c1 on j1.mn_2_c_id=c1.c_id and c1.C_Name='community_1' join jointable j2 on r.r_id=j2.mn_2_r_id join communities c2 on j2.mn_2_c_id=c2.c_id and c2.C_Name='community_2' join jointable j3

Re: [GENERAL] Query m:n-Combination

2008-10-24 Thread Sam Mason
On Fri, Oct 24, 2008 at 03:05:33PM +0200, Albe Laurenz wrote: Ludwig Kniprath wrote: I want to know, which river is running through communities 1,2,3 *and* 4? You can see the solution by just looking at the data above (only river_1 is running through all these countries), but how to

[GENERAL] Escape wildcard problems.

2008-10-24 Thread Gauthier, Dave
I read in the docs (section 9.7.1) that the backslash... \ ... is the default escape char to use in like expressions. Yet when I try it, it doesn't seem to work the ay I expect. Here's an example... select name from templates where name like '%\_cont\_%'; name

Re: [GENERAL] Annoying Reply-To

2008-10-24 Thread Michelle Konzack
Am 2008-10-23 15:52:30, schrieb ries van Twisk: anyways.. I don't care anymore... I will do a reply all. I do normaly: killall ;-) Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux

Re: [GENERAL] Query m:n-Combination

2008-10-24 Thread Harald Fuchs
In article [EMAIL PROTECTED], Ludwig Kniprath [EMAIL PROTECTED] writes: Dear list, I have to solve a simple Problem, explained below with some sample-Data. A typical M:N-constellation, rivers in one table, communities in the other table, m:n-join-informations (which river is running in which

Re: [GENERAL] Escape wildcard problems.

2008-10-24 Thread Sam Mason
On Fri, Oct 24, 2008 at 08:12:38AM -0700, Gauthier, Dave wrote: select name from templates where name like '%\_cont\_%'; name -- cgidvcontrol x8idvcontrol etc I would expect to NOT see these because the cont is not preceded by and followed

Re: [GENERAL] Escape wildcard problems.

2008-10-24 Thread Alan Hodgson
On Friday 24 October 2008, Gauthier, Dave [EMAIL PROTECTED] wrote: I read in the docs (section 9.7.1) that the backslash... \ ... is the default escape char to use in like expressions. Yet when I try it, it doesn't seem to work the ay I expect. Here's an example... select name from

Re: [GENERAL] Escape wildcard problems.

2008-10-24 Thread Craig Ringer
Alan Hodgson wrote: On Friday 24 October 2008, Gauthier, Dave [EMAIL PROTECTED] wrote: I read in the docs (section 9.7.1) that the backslash... \ ... is the default escape char to use in like expressions. Yet when I try it, it doesn't seem to work the ay I expect. Here's an example...

Re: [GENERAL] Escape wildcard problems.

2008-10-24 Thread Thom Brown
Or you could use: SELECT name FROM templates WHERE name ~ '\_cont\_'; This does it as a regular expression. ~* '\_aa\_'; On Fri, Oct 24, 2008 at 5:07 PM, Craig Ringer [EMAIL PROTECTED] wrote: Alan Hodgson wrote: On Friday 24 October 2008, Gauthier, Dave [EMAIL PROTECTED] wrote: I read in

Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Scott Ribe
Can postgres use combined indicies for queries that would only require part of it ? Even if not, if there is at least one index that reduces the potential matches to a small set, then scanning those rows against the other criteria won't take so long. (Assuming good stats and PG choosing a good

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-24 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein [EMAIL PROTECTED] writes: I may have simplified too far. Our application runs a number of different queries. All our WHERE clauses restrict dh and fh. For a given pair of (dh, fh) values, the initial query should come up empty and then insert this pair, and then

Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Grzegorz Jaśkiewicz
that index did the job, also reindexing, and getting rid of two other not quite often used indices helped a lot. Now, this whole machine is fairly simple two way p4, with two sata discs in software raid 1 on linux. And it seems to spend loads of time (40-60% sometimes) on waits. I guess this is

[GENERAL] Order by with spaces and other characters

2008-10-24 Thread mike stanton
Hello everyone. We have a simple problem...that we have keys that include blanks and various other commonly used characters like ,, ; and -. For some reason, the select we have, nothing complicated, ignores these special characters and happily sorts by the A-z range. How do we sort by the, say

[GENERAL] JDBC - Call stored function that returns user defined type

2008-10-24 Thread cyw
I am looking for info on how to call a stored function that returns a user defined type. Assume I have a type defined as: CREATE TYPE XYType AS (x int4, y int4); and I use CYType in a function such as this: CREATE FUNCTION test(IN z int4, OUT xy XYType, OUT status character) RETURNS

Re: [GENERAL] How to get user list and privileges?

2008-10-24 Thread Tomasz Myrta
Q napisal 24.10.2008 10:47: How to get (through SQL command, in PostgreSQL 8.0.14) users / groups / rules list and privileges for group / rule / table? /sth like psql's \z ... command; If you need some psql feature - append -E param. Psql will echo all internal sql-queries to screen. --

Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Alan Hodgson
On Friday 24 October 2008, Grzegorz Jaśkiewicz [EMAIL PROTECTED] wrote: with two sata discs in software raid 1 on linux. And it seems to spend loads of time (40-60% sometimes) on waits. I guess this is due to lack of aio support in postgresql, No, it's due to the fact that hard disks are

Re: [GENERAL] Storing questionnaire data

2008-10-24 Thread David Fetter
On Fri, Oct 24, 2008 at 09:34:20AM +0100, Thom Brown wrote: Thanks David and Jeff. I can see your point. The provided link might actually be useful, although I think I'd make some changes to it. Good :) It's not meant to be holy writ, just a way to see how you might approach this problem

Re: [GENERAL] stackbuilder updates

2008-10-24 Thread Dave Page
On Wed, Oct 22, 2008 at 11:38 PM, Jeff [EMAIL PROTECTED] wrote: Greetings: I successfully installed PostgreSQL 8.3.4-1 on Windows 2003 Server. Additionally, I used the stackbuilder to install Apache 2.2.4 and PHP 5.1.3. What is the suggested method of updating Apache and PHP? Re-run

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-24 Thread Tom Lane
Jack Orenstein [EMAIL PROTECTED] writes: - I created two schemas, NOVAC and VAC, each with a table T as described above. - Before loading data, I ran VACUUM ANALYZE on VAC.T. - I then started loading data. The workload is a mixture of INSERT, SELECT and UPDATE. For SELECT and UPDATE