Re: [GENERAL] Statistics collection question

2007-09-04 Thread Phoenix Kiula
On 04/09/07, Tom Lane [EMAIL PROTECTED] wrote: Phoenix Kiula [EMAIL PROTECTED] writes: On 04/09/07, Richard Broersma Jr [EMAIL PROTECTED] wrote: Thats odd, I wonder why the EXPLAIN ANALYZE time id some much less that the logged select statement times? Because the statement has been

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Gregory Williamson
Sounds like index bloat to me ... lots of updates of indexed columns = lots of extra dead index entries. Since IIRC PostgreSQL indexes (indicii?) don't store information about the liveness of the referenced rows, indexed reads would have to sort through a lot of dead wood to find the few live

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Martijn van Oosterhout
On Tue, Sep 04, 2007 at 03:07:41PM +0800, Phoenix Kiula wrote: How can I check what is causing the lack? When I restart pgsql it goes away. The log is empty for a day or too (I'm only logging errors or slow queries) and the queries are super fast, but after a day it starts filling up with

Re: [GENERAL] Instances where enable_seqscan = false is good

2007-09-04 Thread Gregory Stark
Ow Mun Heng [EMAIL PROTECTED] writes: Have not changed anything in that area. Question is.. Do I need to? or should I try out something just to see how it is? (any) Recommendations would be good. Sorry, I don't have all the original plans. Can you post the explain analyze with and without

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Alban Hertroys
Phoenix Kiula wrote: On 04/09/07, Tom Lane [EMAIL PROTECTED] wrote: I'm wondering about some transaction taking exclusive lock on the table and sitting on it for a minute or so, and also about network problems delaying transmission of data to the client. How can I check what is causing the

Re: [GENERAL] Suggestion for new function on pg_catalog: get_config()

2007-09-04 Thread Alvaro Herrera
Luiz K. Matsumura wrote: By the way, select setting AS default_tablespace from pg_show_all_settings() x(name text, setting text, unit text, category text, short_desc text, extra_desc text, context text, vartype text, source text, min_val text, max_val text) where name =

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Tom Lane
Phoenix Kiula [EMAIL PROTECTED] writes: Basically, what I am missing is some info on actually tweaking the postgresql.conf to suit my system. No, that's *not* what you're missing. I'm not sure what the problem is in your system, but I'm pretty sure that everything you have frantically been

Re: [GENERAL] Data Warehousing

2007-09-04 Thread Ken . Colson
I am on a Linux platform but I'm going to need some pointers regarding the cron job. Are you suggesting that I parse the dump file? I assume I would need to switch to using inserts and then parse the dump looking for where I need to start from? Something that you may want to consider is dblink

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Tom Lane
Phoenix Kiula [EMAIL PROTECTED] writes: Would appreciate any help. Why do indexed queries take so much time? It's a simple DB with 10 relations including tables and indexes. Simple inserts and updates, about 5000 a day, but non-trivial concurrent selects (about 45 million a day). Works fine

Re: [GENERAL] Obtaining random rows from a result set

2007-09-04 Thread Alban Hertroys
To follow up on my own post, I came up with a workable solution based on scrolling cursors. The SP approach didn't work out for me, I didn't manage to declare a cursor in PL/pgSQL that could be positioned absolutely (maybe that's due to us still using PG 8.1.something?). A solution to that would

Re: [GENERAL] Obtaining random rows from a result set

2007-09-04 Thread Alban Hertroys
Alban Hertroys wrote: To follow up on my own post, I came up with a workable solution based on scrolling cursors. The SP approach didn't work out for me, I didn't manage to declare a cursor in PL/pgSQL that could be positioned absolutely (maybe that's due to us still using PG 8.1.something?).

[GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Madison Kelly
Hi all, Hopefully a quick question... Why does: nmc= SELECT 'Y' AS local FROM domains WHERE dom_name='test.com'; local --- Y (1 row) Work but: nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN ('[EMAIL PROTECTED]'); local --- (0 rows) Not work? I am sure I

[GENERAL] Database owner can't analyze/vacuum all of the database tables

2007-09-04 Thread Yonatan Ben-Nes
Hi all, When I try to analyze (or vacuum) the database with the owner of the database I receive the following warnings: help2.com= ANALYZE ; WARNING: skipping pg_authid --- only table or database owner can analyze it WARNING: skipping pg_tablespace --- only table or database owner can analyze

Re: [GENERAL] Reporting services for PostgreSQL

2007-09-04 Thread Ned Lilly
Try OpenRPT - server side rendering engine, and client-side GUI designer. http://sourceforge.net/projects/openrpt Cheers, Ned On 9/1/2007 7:12 AM Andrus wrote: I'm looking for a report generator which renders reports in server and sends rendering result to client. any idea ? Andrus.

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Rodrigo De León
On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote: I am sure I am missing something simple. :) Yeah... '[EMAIL PROTECTED]' '@test.com' ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] UTF8 frustrations

2007-09-04 Thread jesse . waters
Trying to do pg_restore from one UTF8 encoded db to another UTF8 encoded db DB_source: Red Hat Enterprise Linux AS release 4 (Nahant Update 4) psql 8.2.4 DB Destination: Debian GNU/Linux 4.0 psql 8.1.9 I've tried: pg_dump from the source box from destination box from destination server

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Scott Marlowe
On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote: Hi all, Hopefully a quick question... Why does: nmc= SELECT 'Y' AS local FROM domains WHERE dom_name='test.com'; local --- Y (1 row) Work but: nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN ('[EMAIL

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Richard Huxton
Madison Kelly wrote: nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN ('[EMAIL PROTECTED]'); local --- (0 rows) Not work? I don't think IN does what you think it does. It's not a substring-test, but a set test: SELECT 1 WHERE 'x' IN ('a','b','c','x'); SELECT a FROM foo

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Madison Kelly
Rodrigo De León wrote: On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote: I am sure I am missing something simple. :) Yeah... '[EMAIL PROTECTED]' '@test.com' Well now, don't I feel silly. *sigh* Thanks! Madi ---(end of broadcast)--- TIP

Re: [GENERAL] Database owner can't analyze/vacuum all of the database tables

2007-09-04 Thread Richard Huxton
Yonatan Ben-Nes wrote: Hi all, When I try to analyze (or vacuum) the database with the owner of the database I receive the following warnings: WARNING: skipping pg_authid --- only table or database owner can analyze ... WARNING: skipping pg_auth_members --- only table or database owner

Re: [GENERAL] UTF8 frustrations

2007-09-04 Thread Michael Glaesemann
On Sep 4, 2007, at 14:48 , [EMAIL PROTECTED] wrote: Trying to do pg_restore from one UTF8 encoded db to another UTF8 encoded db DB_source: Red Hat Enterprise Linux AS release 4 (Nahant Update 4) psql 8.2.4 DB Destination: Debian GNU/Linux 4.0 psql 8.1.9 UTF8 to UTF8 and everything

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Madison Kelly
Richard Huxton wrote: Madison Kelly wrote: nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN ('[EMAIL PROTECTED]'); local --- (0 rows) Not work? I don't think IN does what you think it does. It's not a substring-test, but a set test: SELECT 1 WHERE 'x' IN

Re: [GENERAL] SELECT question (splitting a field)

2007-09-04 Thread Richard Huxton
Madison Kelly wrote: SELECT 'Y' AS local FROM domains d, users u WHERE u.usr_dom_id=d.dom_id AND u.usr_email||'@'||d.dom_name IN ('[EMAIL PROTECTED]'); Though this may not be the most efficient. In my case, the 'usr_email' is the LHS of the '@' sign and 'dom_name' is the domain name. If I

Re: [GENERAL] UTF8 frustrations

2007-09-04 Thread Scott Marlowe
On 9/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Trying to do pg_restore from one UTF8 encoded db to another UTF8 encoded db DB_source: Red Hat Enterprise Linux AS release 4 (Nahant Update 4) psql 8.2.4 DB Destination: Debian GNU/Linux 4.0 psql 8.1.9 I've tried: pg_dump from

[GENERAL] psql hanging

2007-09-04 Thread Steve Crawford
What would cause psql to hang indefinitely when the backend disappears? We have a script that uses psql to insert a record (TCP connection to DB on different machine). The command is basically psql connection_stuff -c insert into... A while back I had to restart the server and today discovered

[GENERAL] Documentation fix regarding atan2

2007-09-04 Thread Andrew Maclean
In Table 9.4 of the documentation atan2 is described as follows: atan2(*x*, *y*) inverse tangent of *x*/*y* I am sure it should read as: atan2(*y*, x) inverse tangent of y/x This looks to be the standard C++/c atan2(y,x) function. You can easily test this: If y = 2, x = 1, then

[GENERAL] Controlling locale and impact on LIKE statements

2007-09-04 Thread Martin Langhoff
Hi! I am having a bit of trouble with indexes, locales and LIKE queries. Background -- Using Pg8.1/8.2 on a utf-8 database, my left-anchored LIKE clauses were forcing a full table scan instead of using the index. After a bit of digging, I found that Pg can only use the normal index for

[GENERAL] Controlling locale and impact on LIKE statements

2007-09-04 Thread Martin Langhoff
Hi! Background: Using Pg8.1/8.2 on a utf-8 database, I found out that my left-anchored LIKE clauses were forcing a full table scan instead of using the index. After a bit of digging, I found that Pg can only use the normal index for left-anchored LIKE queries if locale is 'C'. The optimizer can

Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-04 Thread Albe Laurenz
it is my first shot using Mono and I failed to get the example from http://www.mono-project.de/wiki/keyword/PostgreSQL/ working. The reason is obviousely that whatever I tried NpgsqlConnection tries to use password authentication but I have configured my system that ident

[GENERAL] How to 'register' functions, so they can be called (plpythonu)

2007-09-04 Thread blay bloo
I am defining some functions using plpythonu, through the standard means. Here I have one function (test1) which calls another (testfunc). When I excute this I get the following error: ERROR: plpython: function test1 failed DETAIL: type 'exceptions.NameError': global name 'testfunc' is not

[GENERAL] Partition Reindexing

2007-09-04 Thread Nik
What is the effect of reindexing a partition on the inherited table? For example I have a table 'test' with partitions 'test_01_07', 'test_02_07', 'test_03_07', 'test_04_07', corresponding to data from January 2007, February 2007, and so on. I noticed that when I run a reindex on 'test_02_07'

Re: [GENERAL] Controlling locale and impact on LIKE statements

2007-09-04 Thread Alvaro Herrera
Martin Langhoff escribió: As I have a Pg install where the locale is already en_US.UTF-8, and the database already exists, is there a DB-scoped way of controlling the locale? Not really. Is there a better way? In this specific install I can create the additional index. However, this needs

Re: [GENERAL] Documentation fix regarding atan2

2007-09-04 Thread Bruno Wolff III
On Wed, Sep 05, 2007 at 10:37:18 +1000, Andrew Maclean [EMAIL PROTECTED] wrote: In Table 9.4 of the documentation atan2 is described as follows: atan2(*x*, *y*) inverse tangent of *x*/*y* I am sure it should read as: atan2(*y*, x) inverse tangent of y/x Aren't those two statements

Re: [GENERAL] Controlling locale and impact on LIKE statements

2007-09-04 Thread Gregory Stark
Alvaro Herrera [EMAIL PROTECTED] writes: Martin Langhoff escribió: the whole thing of figuring out what the locale is and whether to add magical additional indexes just for Pg makes me look like a loony. You are right and Eloy is wrong on that discussion. There is not anything the DB can

Re: [GENERAL] Documentation fix regarding atan2

2007-09-04 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: Andrew Maclean [EMAIL PROTECTED] wrote: In Table 9.4 of the documentation atan2 is described as follows: atan2(*x*, *y*) inverse tangent of *x*/*y* I am sure it should read as: atan2(*y*, x) inverse tangent of y/x Aren't those two statements

Re: [GENERAL] How to 'register' functions, so they can be called (plpythonu)

2007-09-04 Thread Alvaro Herrera
blay bloo wrote: I am defining some functions using plpythonu, through the standard means. Here I have one function (test1) which calls another (testfunc). When I excute this I get the following error: ERROR: plpython: function test1 failed DETAIL: type 'exceptions.NameError': global

[GENERAL] work hour calculations

2007-09-04 Thread novice
Hello All, SELECT notification_time, finished_time, sum(finished_time - notification_time) as actual FROM log GROUP BY notification_time, finished_time; gives me: notification_time| finished_time | actual ++-

Re: [GENERAL] work hour calculations

2007-09-04 Thread novice
correction: The result I'm expecting for the above to be notification_time| finished_time | actual ++- 2007-07-06 15:50:00+10 | 2007-07-09 07:10:00+10 | 01:20:00 2007-07-07 12:30:00+10 | 2007-07-09

Re: [GENERAL] Documentation fix regarding atan2

2007-09-04 Thread Andrew Maclean
A Cartesian coordinate system is generally assumed i.e there exists an x-y coordinate system so there is an inherent ordering property here. Regarding atan2, this makes interesting reading: http://en.wikipedia.org/wiki/Atan2 All I am asking is the documentation for atan2 conform with the

Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-04 Thread Andreas Tille
On Mon, 4 Sep 2007, Albe Laurenz wrote: The best list for this kind of thing is certainly the Npgsql mailing list: http://gborg.postgresql.org/mailman/listinfo/npgsql-general Just subscribed. What error messages do you get when you try to connect? When I use the connection string