Re: [GENERAL] Bad performace of a query

2007-02-28 Thread Kaloyan Iliev
Hi, The index doesn't cost you so much, seq SEQ Scan actully does: Seq Scan on isbns_a_descubrir  (cost=0.00..8067.91 rows=1 width=21) (actual time=30.044..30.044 rows=1 loops=2025) This seq scan is called once for every row of librosdisponibilidadtemp which passes the WHERE condition.

[GENERAL] pgagent install on windows

2007-02-28 Thread Howard Cole
Hi, I have a few of problems installing the pgagent on windows, running version 8.2 1. When I run the pgagent script on the postgres database, it seems to run and commit successfully, but when I view the schemas for the postgres database, there is no new schema for the pgagent. (is it

Re: [GENERAL] pgagent install on windows

2007-02-28 Thread Dave Page
Howard Cole wrote: Hi, I have a few of problems installing the pgagent on windows, running version 8.2 1. When I run the pgagent script on the postgres database, it seems to run and commit successfully, but when I view the schemas for the postgres database, there is no new schema for the

Re: [GENERAL] pgagent install on windows

2007-02-28 Thread Howard Cole
Thanks Dave, you were correct - pgadmin was connecting to template1. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Brandon Aiken
SQLite, MySQL, and MS Access each use indexes for unique constraints. Doesn't the SQL spec specify that CREATE INDEX can be used to create UNIQUE indexes? Are there any real systems that don't support indexes but that support unique? It seems silly, since the code for a primary key is a

Re: [GENERAL] How to Kill IDLE users

2007-02-28 Thread Shelby Cain
Since he has so many connections, perhaps the crash is related to bugs #2609 and #1641? 8.2.x seems to have the problem as well. Regards, Shelby Cain - Original Message From: Scott Marlowe [EMAIL PROTECTED] To: Goran Rakic [EMAIL PROTECTED] Cc: pgsql general

[GENERAL] Curious situation - running program cannot seem to delete records.

2007-02-28 Thread Andrew Edson
I've been given a file to maintain, the purpose of which is to purge the database of records more than two years old. (Database setup is pg 8.1.3) The program (written in perl) enters postgres as the user 'postgres', and is supposed to select foreign-key records from all tables that link

Re: [GENERAL] Curious situation - running program cannot seem to delete records.

2007-02-28 Thread Alban Hertroys
Andrew Edson wrote: I've been given a file to maintain, the purpose of which is to purge the database of records more than two years old. (Database setup is pg 8.1.3) The program (written in perl) enters postgres as the user 'postgres', and is supposed to select foreign-key records

Re: [GENERAL] Curious situation - running program cannot seem to delete records.

2007-02-28 Thread Dreas Nielsen
On 2/28/07, Andrew Edson [EMAIL PROTECTED] wrote: I've been given a file to maintain, the purpose of which is to purge the database of records more than two years old. (Database setup is pg 8.1.3) The program (written in perl) enters postgres as the user 'postgres', and is supposed to select

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/07 00:16, Tom Lane wrote: Jim C. Nasby [EMAIL PROTECTED] writes: In some databases if you know that an index just happens to be unique you might gain some query performance by defining the index as unique, but I don't think the PostgreSQL

[GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Rich Shepard
After having to reboot my server/workstation this morning, I've a problem with postgresql; one I've never before encountered. The postmaster is running: 9959 pts/1S 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data and the socket is present: srwxrwxrwx 1 root root 0 2007-02-28

Re: [GENERAL] Curious situation - running program cannot seem to delete records.

2007-02-28 Thread btober
Andrew Edson wrote: I've been given a file to maintain, the purpose of which is to purge the database of records more than two years old. (Database setup is pg 8.1.3) The program (written in perl) enters postgres as the user 'postgres', and is supposed to select foreign-key records from

Re: [GENERAL] Curious situation - running program cannot seem to delete records.

2007-02-28 Thread Arnaud Lesauvage
Andrew Edson a écrit : Does anyone know of anything in Postgres that might be causing this unusual behavior? Or should I check the perl mailing lists instead? Maybe you are beginning a transaction and that you are committing afterwards ? -- Arnaud ---(end of

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Joshua D. Drake
Rich Shepard wrote: After having to reboot my server/workstation this morning, I've a problem with postgresql; one I've never before encountered. The postmaster is running: 9959 pts/1S 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data and the socket is present: srwxrwxrwx

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Tom Lane
Rich Shepard [EMAIL PROTECTED] writes: The postmaster is running: 9959 pts/1S 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data and the socket is present: srwxrwxrwx 1 root root 0 2007-02-28 05:20 /tmp/.s.PGSQL.5432= The socket file should surely not be owned by root ... there's

[GENERAL] PostgreSQL 8.2.3, Jboss 4.0.3 and postgresql-8.2-504.jdbc4

2007-02-28 Thread Andrew Madu
Hi, i've just upgraded from posgreSQL 8.1 to 8.2.3. I placed postgresql-8.2-504.jdbc4 in /deploy/ejb3.deployer, restarted jboss and the proces breaks when it gets to detecting what postgresql driver is being used! I remove the jdbc4 driver and replace it with, my original driver,

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Tom Lane
Brandon Aiken [EMAIL PROTECTED] writes: SQLite, MySQL, and MS Access each use indexes for unique constraints. Doesn't the SQL spec specify that CREATE INDEX can be used to create UNIQUE indexes? No, there is no such command in the SQL spec. In fact the concept of an index does not appear

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Rich Shepard
On Wed, 28 Feb 2007, Joshua D. Drake wrote: psql -h localhost -U postgres databasename Joshua, Well, something's wrong: [EMAIL PROTECTED] ~]$ psql -h localhost -U postgres aesi Welcome to psql 8.1.4, the PostgreSQL interactive terminal. Type: \copyright for distribution terms

Re: [GENERAL] How to Kill IDLE users

2007-02-28 Thread Ezequias Rodrigues da Rocha
What a explanation ! Are you a teacher ? Thank you for your information. Now I am more calm about my idle coonections. I will mark this e-mail as a Star to further retrievings. Regards Ezequias 2007/2/27, Scott Marlowe [EMAIL PROTECTED]: On Tue, 2007-02-27 at 15:23, Goran Rakic wrote: I

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Rich Shepard
On Wed, 28 Feb 2007, Tom Lane wrote: The socket file should surely not be owned by root ... there's something pretty weird there. How did you start the postmaster? Tom, The startup script, /etc/rc.d/rc.postgresql is run when the system boots. The result is, 16648 pts/1S 0:00

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Alan Hodgson
On Wednesday 28 February 2007 08:12, Rich Shepard [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] ~]$ psql -h localhost -U postgres aesi Welcome to psql 8.1.4, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Ezequias Rodrigues da Rocha
This select doesn't return any row. What does it mean ? Ezequias. 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible -- FIXED

2007-02-28 Thread Rich Shepard
On Wed, 28 Feb 2007, Alan Hodgson wrote: Something happened to your /tmp directory after PostgreSQL started up. Alan, Seems so, doesn't it? Stop the postmaster, clean out the socket in /tmp, and restart the postmaster, and it will likely fix it up. Then you can investigate your boot

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Joshua D. Drake
I would imagine that other DBMSes also enforce uniqueness by means of indexes, because it'd be awful darn expensive to enforce the constraint without one; but I'm only guessing here, not having looked. Can anyone point to a real system that enforces unique constraints without an underlying

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Tom Lane
Rich Shepard [EMAIL PROTECTED] writes: Is there a method other than a reboot to remedy this? Stop the postmaster, remove the bogus socket file by hand, start the postmaster. I imagine that if you check the postmaster log you will notice a bleat near the beginning about failing to open the

Re: [GENERAL] Post-Reboot Issue: Postmaster Not Accessible

2007-02-28 Thread Rich Shepard
On Wed, 28 Feb 2007, Tom Lane wrote: Stop the postmaster, remove the bogus socket file by hand, start the postmaster. Tom, That did it. I imagine that if you check the postmaster log you will notice a bleat near the beginning about failing to open the socket file (because of the

Re: [GENERAL] PostgreSQL 8.2.3, Jboss 4.0.3 and postgresql-8.2-504.jdbc4

2007-02-28 Thread Kris Jurka
On Wed, 28 Feb 2007, Andrew Madu wrote: i've just upgraded from posgreSQL 8.1 to 8.2.3. I placed postgresql-8.2-504.jdbc4 in /deploy/ejb3.deployer, restarted jboss and the proces breaks when it gets to detecting what postgresql driver is being used! I remove the jdbc4 driver and replace it

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/07 10:31, Joshua D. Drake wrote: I would imagine that other DBMSes also enforce uniqueness by means of indexes, because it'd be awful darn expensive to enforce the constraint without one; but I'm only guessing here, not having looked. Can

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Joshua D. Drake
Bill Moran wrote: In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is,

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: I don't agree. I think that regular indexing is mandatory under some workloads. Example: ... There are some additional indexes that I've snipped from the output that also saw some benefit from reindexing, but let's just focus on file_fp_idx. Can you

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread John Jawed
Informix: http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls285.htm AFAICS, Oracle as well. John On 2/28/07, Tom Lane [EMAIL PROTECTED] wrote: Jim C. Nasby [EMAIL PROTECTED] writes: In some databases if you know that an index just happens to be

Re: [GENERAL] SQL names for C constants

2007-02-28 Thread Merlin Moncure
On 2/27/07, Vegard Bønes [EMAIL PROTECTED] wrote: Hi! I am writing a serverside function in plpgsql, which returns a part of a large object. To solve this problem I can do something like this: fd := lo_open( some_oid, 262144 ); PERFORM lo_lseek( fd, index, 0 ); RETURN loread( fd, read_size );

[GENERAL] /libexec/ld-elf.so.1: Shared object libpq.so.4 not found

2007-02-28 Thread Dino Vliet
Hi folks, when I start pgadmin3 on my system I get the following error: /libexec/ld-elf.so.1: Shared object libpq.so.4 not found, required by pgadmin3 The only thing I have done lately is upgrade the database to 8.2 in the freebsd ports system. Pgadmin did work in the past, so what could be

Re: [GENERAL] grant on sequence and pg_restore/pg_dump problem

2007-02-28 Thread Tony Caduto
Bruce Momjian wrote: Tony Caduto wrote: Hi, I did a quick search and didn't see anything on this, if I missed it sorry in advance. Anyway, I was doing a restore of a 8.1 database(on a 8.1 server) using the 8.2 pg_restore and it was throwing errors when it was trying to restore the

Re: [GENERAL] /libexec/ld-elf.so.1: Shared object libpq.so.4 not found

2007-02-28 Thread Martijn van Oosterhout
On Wed, Feb 28, 2007 at 10:04:06AM -0800, Dino Vliet wrote: Hi folks, when I start pgadmin3 on my system I get the following error: /libexec/ld-elf.so.1: Shared object libpq.so.4 not found, required by pgadmin3 The only thing I have done lately is upgrade the database to 8.2 in the

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Joshua D. Drake [EMAIL PROTECTED]: Bill Moran wrote: In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average

[GENERAL] About PostgreSQL Block Size

2007-02-28 Thread Iannsp
Hi, Some one people have one report/benchmark about using postgresql block size modified? What is the difference? thanks. -- Ivo Nascimento Iann tech - Desenvolvendo soluções com performance e segurança http://www.ianntech.com.br ---(end of

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: I don't agree. I think that regular indexing is mandatory under some workloads. Example: ... There are some additional indexes that I've snipped from the output that also saw some benefit from

Re: [GENERAL] grant on sequence and pg_restore/pg_dump problem

2007-02-28 Thread Bruce Momjian
Tony Caduto wrote: Bruce Momjian wrote: Tony Caduto wrote: Hi, I did a quick search and didn't see anything on this, if I missed it sorry in advance. Anyway, I was doing a restore of a 8.1 database(on a 8.1 server) using the 8.2 pg_restore and it was throwing errors when it was

[GENERAL] Select retrieval slowdown after db drop/reload. Suggestions?

2007-02-28 Thread Andrew Edson
I have a select statement, used in a Perl program, which is supposed to find all records related to those in one table which have a delete_dt field value of four years or older. This is the select statement: SELECT t2.dist_id, t1.clnt_seq, t2.cntrct_seq, t2.cntrct_id, t3.aunit_seq,

[GENERAL] giving a user permission to kill their processes only

2007-02-28 Thread George Nychis
Hey all, So the pg_cancel_backend() function by default is only available to super users, so I decided to write a wrapper function around, use a SECURITY DEFINER, and GRANT my user privilege to use the wrapper. BEGIN; CREATE FUNCTION kill_process(integer) RETURNS boolean AS 'select

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ... There are 21 jobs, each ranging in size from 2000 -

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ...

[GENERAL] Recursive/Wildcard Object Ownership Change

2007-02-28 Thread Brian A. Seklecki
All: Ideas for recursively changing the ownership of all objects in a database to a new user? - There is no way to specify recursion in ALTER TABLE OWNER TO rolename - Globbing table names in ALTER TABLE * OWNER TO rolename does not work. - To get a list of tables, you can do: SELECT

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-28 Thread Brandon Aiken
Problem number 6,534 with implementing an abstract concept such as an RDB on a digital computer with an electro-magno-mechanical storage system. :p -- Brandon Aiken CS/IT Systems Engineer -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007

Re: [GENERAL] Select retrieval slowdown after db drop/reload. Suggestions?

2007-02-28 Thread Scott Marlowe
On Wed, 2007-02-28 at 13:55, Andrew Edson wrote: I have a select statement, used in a Perl program, which is supposed to find all records related to those in one table which have a delete_dt field value of four years or older. This is the select statement: SELECT t2.dist_id, t1.clnt_seq,

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ...

[GENERAL] Differences in identical queries

2007-02-28 Thread Rob Schall
Question for anyone... I have to queries. One runs in about 2 seconds. The other takes upwards of 2 minutes. I have a temp table that is created with 2 columns. This table is joined with the larger database of call detail records. However, these 2 queries are handled very differently. The

[GENERAL] why can't I increase shared buffers to higher value?

2007-02-28 Thread Dino Vliet
I have the following config but increasing the shared buffers to a value greater then 32 doesn't let the database server start (I want a value of 256MB there because I will have a giant table of 12 million rows which will be qeuried extremely). I have a 3GB RAM amd64 system running freebsd

Re: [GENERAL] why can't I increase shared buffers to higher value?

2007-02-28 Thread Bill Moran
Dino Vliet [EMAIL PROTECTED] wrote: I have the following config but increasing the shared buffers to a value greater then 32 doesn't let the database server start (I want a value of 256MB there because I will have a giant table of 12 million rows which will be qeuried extremely). I

[GENERAL] Why does group by need to match select fields?

2007-02-28 Thread Omar Eljumaily
Sorry if this isn't exactly postgresql specific. I periodically run into this problem, and I'm running into it now. I'm wondering if there's something about group by that I don't understand. As an example what I'd want to do is return the id value for the check to each payee that has the

[GENERAL] PG periodic Error on W2K

2007-02-28 Thread Paul Lambert
I'm running PG 8.2.3 on We doze 2000 Server. (Should I apologise for that up front to appease the masses?) I am periodically getting errors pop up on the server console of the following nature: The File or directory D:\PostgresQL\Data\global\pgstat.stat is corrupt and unreadable. Please run

Re: [GENERAL] Why does group by need to match select fields?

2007-02-28 Thread Bill Moran
Omar Eljumaily [EMAIL PROTECTED] wrote: Sorry if this isn't exactly postgresql specific. I periodically run into this problem, and I'm running into it now. I'm wondering if there's something about group by that I don't understand. As an example what I'd want to do is return the id value

Re: [GENERAL] PG periodic Error on W2K

2007-02-28 Thread Joshua D. Drake
Paul Lambert wrote: I'm running PG 8.2.3 on We doze 2000 Server. (Should I apologise for that up front to appease the masses?) Probably ;) I am periodically getting errors pop up on the server console of the following nature: This showed no errors. I can also open the mentioned file -

Re: [GENERAL] Why does group by need to match select fields?

2007-02-28 Thread Omar Eljumaily
OK, I see what's going on. I can have more than one max(amount) with the same amount and payee. Thanks so much. Like I said, it's sort of dogged me off and on many times. Thanks. Bill Moran wrote: Omar Eljumaily [EMAIL PROTECTED] wrote: Sorry if this isn't exactly postgresql specific.

Re: [GENERAL] PG periodic Error on W2K

2007-02-28 Thread Paul Lambert
Joshua D. Drake wrote: Paul Lambert wrote: I'm running PG 8.2.3 on We doze 2000 Server. (Should I apologise for that up front to appease the masses?) Probably ;) I propound to all my sincerest of apologies for installing what I believe to be a marvel of human creation in Postgres on what

Re: [GENERAL] Select retrieval slowdown after db drop/reload. Suggestions?

2007-02-28 Thread Naz Gassiep
You have to run ANALYZE; on your db after a drop/reload to recollect the stats. In the rest db, jus run ANALYZE; and then see how fast it is. I'd guess that this is your issue. Regards, - Naz. Andrew Edson wrote: I have a select statement, used in a Perl program, which is supposed to find

Re: [GENERAL] Esay question, about the numeric format

2007-02-28 Thread Bruno Wolff III
On Thu, Feb 22, 2007 at 12:20:12 +0100, Rafa Comino [EMAIL PROTECTED] wrote: Hi every body I have this query SELECT 20.00::numeric(38,2) and postgre gives me 20, i need that postgre gives me 20.00 What can i do? i suppose this must be easy, but i dont find how to do ir thanks every body

[GENERAL] Assistance with Query Optimisation?

2007-02-28 Thread Shaun Johnston
Hi Apologies in advance for the verbosity of my explanation for this problem, but I think it's all pertinent. I have a fairly simple query which postgresql's query planner seems to be interpreting / optimising in interesting ways: Query: SELECT * FROM account_transaction WHERE account_id

Re: [GENERAL] [HACKERS] urgent: upgraded to 8.2, getting kernel panics

2007-02-28 Thread Bruno Wolff III
On Fri, Feb 23, 2007 at 18:14:25 -0500, Tom Lane [EMAIL PROTECTED] wrote: Merlin Moncure [EMAIL PROTECTED] writes: On friday we upgraded a critical backend server to postgresql 8.2 running on fedora core 4. Umm ... why that particular choice of OS? Red Hat dropped update support for

Re: [GENERAL] [HACKERS] urgent: upgraded to 8.2, getting kernel panics

2007-02-28 Thread Bruno Wolff III
On Mon, Feb 26, 2007 at 15:57:02 +0200, Devrim GUNDUZ [EMAIL PROTECTED] wrote: Upgrading OS will probably solve your problem; since there is no way to upgrade FC4 kernel unless you want to compile kernel source on your system. And good luck with that. Fedora still back patches stuff from