Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-27 Thread Douglas Alan
On Wed, May 27, 2009 at 8:54 PM, Jeff Davis wrote: > If you're putting a LIMIT on it, why does it return millions of results? > It *doesn't* return millions of results with the LIMIT on it. It just does a sequential scan of the table and doesn't find any results until it gets to the last quart

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-27 Thread Jeff Davis
On Wed, 2009-05-27 at 19:53 -0400, Douglas Alan wrote: > We have a very large table (150 million rows) where the rows are not > in a random order. Some common queries will have millions of results, > and this of course is slow. For an interactive interface to the > database, we want to put a limi

Re: [GENERAL] Bloated Table

2009-05-27 Thread Tom Lane
Christophe writes: > Given this, is there is a recommended way of detecting bloat in > indices automatically, rather than just looking at them once in a > while and saying, "Hm, that looks pretty big"? contrib/pgstattuple works; it's just too expensive to run every few minutes ...

Re: [GENERAL] Bloated Table

2009-05-27 Thread Christophe
On May 27, 2009, at 3:25 PM, Greg Smith wrote: Interesting and an extremely common request. I just added an item to the Vacuum section of the TODO list while you were listing issues and potential solutions here: "Provide more information in order to improve user-side estimates of dead spa

Re: [GENERAL] vista failed to install postgresql

2009-05-27 Thread Dave Page
Excuse the top-post... Normally it works fine, but we have recently seen cases like yours which we've been unable to reproduce. Noone has tried their own build yet though, so hopefully you may be able to help us figure it out. Did you get the mingw build to initdb, or is that what failed? If so,

[GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-27 Thread Douglas Alan
We have a very large table (150 million rows) where the rows are not in a random order. Some common queries will have millions of results, and this of course is slow. For an interactive interface to the database, we want to put a limit on all queries so that queries will return quickly even if th

[GENERAL] vista failed to install postgresql

2009-05-27 Thread douglas
tried to install postgresql on vista ultimate, with uac turned off,( install user belongs to administrators group) tried the binary install and then the source install with mingw the binary , wouldn't start service, install ended then and there . the source with mingw gave me an error 2 is th

Re: [GENERAL] How to speed up the first-time-searching in pgsql?

2009-05-27 Thread zxo102 ouyang
Hi there, Thanks for your suggestions. I do have an application running on the machine all the time. In fact, the application keeps writing real-time monitoring data into the database. Based on my understanding of your messages, I can't do anything to speed up the first-time-searching. Probably I c

Re: [GENERAL] Table inheritance and partitioning

2009-05-27 Thread Jeff Davis
On Wed, 2009-05-27 at 15:52 -0500, Kevin Barnard wrote: > I am making the move to partition a table. I am trying to figure out > the best way to migrate data to the partitions. I would prefer to not > have down time. Does anybody have advice to give on this? One strategy is to create a trig

Re: [GENERAL] Bloated Table

2009-05-27 Thread Greg Smith
On Wed, 27 May 2009, Tom Lane wrote: It's an interesting exercise in trying to estimate bloat without groveling through the whole relation Interesting and an extremely common request. I just added an item to the Vacuum section of the TODO list while you were listing issues and potential sol

Re: [GENERAL] Table inheritance and partitioning

2009-05-27 Thread Vick Khera
On Wed, May 27, 2009 at 4:52 PM, Kevin Barnard wrote: > I am making the move to partition a table.  I am trying to figure out the > best way to migrate data to the partitions.  I would prefer to not have down > time.  Does anybody have advice to give on this?  Is there any easy way to > determine

Re: [GENERAL] Favorite/Recommended ERD tools

2009-05-27 Thread Greg Smith
On Wed, 27 May 2009, Kevin Kempter wrote: I'm looking for suggestions per good ERD tools (Linux based preferred). There's a giant list that includes lots of ERD tools at http://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools -- * Greg Smith gsm...@gregsmith.com http://www.g

[GENERAL] Table inheritance and partitioning

2009-05-27 Thread Kevin Barnard
I am making the move to partition a table. I am trying to figure out the best way to migrate data to the partitions. I would prefer to not have down time. Does anybody have advice to give on this? Is there any easy way to determine what records are in the master table and which ones are

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: well, I need database to guard data, not application. Application can check things too, but database's job is to make sure data is integral. Who said anything about the application level? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] composite type and domain

2009-05-27 Thread Grzegorz Jaśkiewicz
well, I need database to guard data, not application. Application can check things too, but database's job is to make sure data is integral. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Pl/java in 8.4 bet1 sources compilation failed

2009-05-27 Thread Emanuel Calvo Franco
Hi community, I'm trying to compile pl/java sources for 8.4 beta1 (for a test) but it gives me 20 errors at the end: "... /home/ubuntu/Desktop/pljava-1.4.0/src/java/pljava/org/postgresql/pljava/jdbc/ObjectResultSet.java:290: reference to updateBlob is ambiguous, both method updateBlob(int,java.sq

Re: [GENERAL] Favorite/Recommended ERD tools

2009-05-27 Thread Ben Chobot
On Wed, 27 May 2009, Kevin Kempter wrote: I'm looking for suggestions per good ERD tools (Linux based preferred). My needs are a tool which gives me a diagram of a database I maintain with my own scripts. I don't need a query tool, a stored proceedure editor, or the ability to build my datab

Re: [GENERAL] Best way to monitor, control, or rewrite data definition commands?

2009-05-27 Thread Turner, Ian
Erik, Thanks for the advice. Unfortunately, postgresql/src/camend/commands/variable.c contains the following remark: /* * Disallow SET ROLE inside a security definer context. We need to do * this because when we exit the context, GUC won't be noti

Re: [GENERAL] Favorite/Recommended ERD tools

2009-05-27 Thread raul . giucich
Hi Kevin, Schemaspy for DER diagram presentation and structure description. http://schemaspy.sourceforge.net/ For a initial design don't know a tool. R. On May 27, 2009 3:44pm, Kevin Kempter wrote: Hi All; I'm looking for suggestions per good ERD tools (Linux based preferred). Thou

Re: [GENERAL] Bloated Table

2009-05-27 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> It's an interesting exercise in trying to estimate bloat without >> groveling through the whole relation, but I seriously doubt you could >> ever get numbers this way that are trustworthy enough to drive >> maintenance decisions. > Well, pg_stattuple is

Re: [GENERAL] Multidimensional array definition in composite type appears parsed as string

2009-05-27 Thread Tom Lane
miller_2555 writes: > I am trying to declare an array of the following compound type: > CREATE TYPE myschema.mytype AS ( > sometexttext, > onedimarray text[], > multidimarray text[][] > ); > The current assignment occurs as follows:

Re: [GENERAL] Bloated Table

2009-05-27 Thread Alvaro Herrera
Tom Lane wrote: > It's an interesting exercise in trying to estimate bloat without > groveling through the whole relation, but I seriously doubt you could > ever get numbers this way that are trustworthy enough to drive > maintenance decisions. Well, pg_stattuple is way too expensive to be runnin

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Alan McKay
> Depending on your exact needs, which the terminology you're using only allow > to guess about, you might enjoy this reading: >  http://wiki.postgresql.org/wiki/Image:Moskva_DB_Tools.v3.pdf Thanks. To be honest I don't even know myself what my needs are yet. I've only been on the job here for a

[GENERAL] Multidimensional array definition in composite type appears parsed as string

2009-05-27 Thread miller_2555
Hi - I am trying to declare an array of the following compound type: CREATE TYPE myschema.mytype AS ( sometexttext, onedimarray text[], multidimarray text[][] ); The current assignment occurs as follows: myvar mysch

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Dimitri Fontaine
Hi, Le 27 mai 09 à 19:57, Alan McKay a écrit : I have done some googling and found a few things on the matter. But am looking for some suggestions from the experts out there. Got any good pointers for reading material to help me get up to speed on PostgreSQL clustering? What options are avai

[GENERAL] Favorite/Recommended ERD tools

2009-05-27 Thread Kevin Kempter
Hi All; I'm looking for suggestions per good ERD tools (Linux based preferred). Thoughts? Thanks in advance

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Kevin Kempter
On Wednesday 27 May 2009 13:33:55 Alan McKay wrote: > > Continuent works (AFAIK) like pgpool clustering, it sends the same > > statements to both/all servers in the cluster but it has no insight to > > the servers beyond this, so if via a direct connection server A becomes > > out of sync with serv

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Alan McKay
> Continuent works (AFAIK) like pgpool clustering, it sends the same > statements to both/all servers in the cluster but it has no insight to the > servers beyond this, so if via a direct connection server A becomes out of > sync with server B then continuent is oblivious. So can the same be said

Re: [GENERAL] Bloated Table

2009-05-27 Thread Tom Lane
Alvaro Herrera writes: > Brad Nicholson wrote: >> On Wed, 2009-05-27 at 11:15 -0400, Tom Lane wrote: >>> I wouldn't trust the calculations that view does in the least. > If "ma" is supposed to be "maxalign", then this code is broken because > it only reports mingw32 as 8, all others as 4, which i

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Kevin Kempter
On Wednesday 27 May 2009 12:55:51 Eddy Ernesto Baños Fernández wrote: > Try Cybercluster > > -Mensaje original- > De: pgsql-performance-ow...@postgresql.org > [mailto:pgsql-performance-ow...@postgresql.org] En nombre de Alan McKay > Enviado el: miércoles, 27 de mayo de 2009 13:57 > Para

Re: [GENERAL] Postgres Clustering

2009-05-27 Thread Alan McKay
> By the way:  cross-posting on these lists is generally frowned upon. It > causes problems for people who reply to you but are aren't on all of the > lists you sent to.  If you're not sure what list something should go on, > just send it to -general rather than cc'ing multiple ones. Duly noted!

Re: [GENERAL] Postgres Clustering

2009-05-27 Thread Greg Smith
On Wed, 27 May 2009, Alan McKay wrote: Got any good pointers for reading material to help me get up to speed on PostgreSQL clustering? What options are available? What are the issues? Terminology. http://wiki.postgresql.org/wiki/Replication%2C_Clustering%2C_and_Connection_Pooling is where

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Eddy Ernesto Baños Fernández
Try Cybercluster -Mensaje original- De: pgsql-performance-ow...@postgresql.org [mailto:pgsql-performance-ow...@postgresql.org] En nombre de Alan McKay Enviado el: miércoles, 27 de mayo de 2009 13:57 Para: pgsql-performa...@postgresql.org; pgsql-general@postgresql.org Asunto: [PERFORM]

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Daniel van Ham Colchete
Alan, here I'm implementing something similar to the Chord protocol [1] on the application level to partition my data across 6 PostgreSQL servers with N+1 replication. Two up sides on this approch: 1 - When one server is down the load is spread between all the other ones, instead of going only to

Re: [GENERAL] [PERFORM] Postgres Clustering

2009-05-27 Thread Scott Mead
On Wed, May 27, 2009 at 1:57 PM, Alan McKay wrote: > Hey folks, > > I have done some googling and found a few things on the matter. But > am looking for some suggestions from the experts out there. > > Got any good pointers for reading material to help me get up to speed > on PostgreSQL clusteri

Re: [GENERAL] Bloated Table

2009-05-27 Thread Alvaro Herrera
Brad Nicholson wrote: > On Wed, 2009-05-27 at 11:15 -0400, Tom Lane wrote: > > =?iso-8859-1?Q?Alexander_Sch=F6cke?= writes: > > > I'm using a view > > > (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to > > > display the bloat (unused disk space) of the tables in a PostgreSQL > > >

[GENERAL] Postgres Clustering

2009-05-27 Thread Alan McKay
Hey folks, I have done some googling and found a few things on the matter. But am looking for some suggestions from the experts out there. Got any good pointers for reading material to help me get up to speed on PostgreSQL clustering? What options are available? What are the issues? Terminol

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Scott Bailey wrote: Grzegorz Jaśkiewicz wrote: Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b < c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and create

Re: [GENERAL] Bloated Table

2009-05-27 Thread Brad Nicholson
On Wed, 2009-05-27 at 11:15 -0400, Tom Lane wrote: > =?iso-8859-1?Q?Alexander_Sch=F6cke?= writes: > > I'm using a view > > (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to > > display the bloat (unused disk space) of the tables in a PostgreSQL > > database. > > I wouldn't trust th

[GENERAL] \dt+ on 8.4

2009-05-27 Thread Grzegorz Jaśkiewicz
Is there any reason why \dt+ doesn't include toast and index size of a table ? I can understand index, but toast ? -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Bloated Table

2009-05-27 Thread Alexander Schöcke
>What is the output of VACUUM VERBOSE foobar_log? INFO: vacuuming "public.foobar_log" INFO: index "bar_index" now contains 23832007 row versions in 118151 pages DETAIL: 0 index row versions were removed. 0 index pages have been deleted, 0 are currently reusable. CPU 0.02s/0.00u sec elapsed 64.1

Re: [GENERAL] Postgres registry access using java

2009-05-27 Thread Joshua Tolley
On Wed, May 27, 2009 at 01:21:40PM +0530, Anirban Pal wrote: >Can any body tell me how to fetch directory path for lib or data directory >for postgres installation in windows using registry. Solution using Java >language will be highly solicited. Some PL/Java or PL/J function might do

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b < c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and create aditional table for t

Re: [GENERAL] Bloated Table

2009-05-27 Thread Tom Lane
=?iso-8859-1?Q?Alexander_Sch=F6cke?= writes: > I'm using a view > (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to > display the bloat (unused disk space) of the tables in a PostgreSQL > database. I wouldn't trust the calculations that view does in the least. You might look at con

[GENERAL] Bloated Table

2009-05-27 Thread Alexander Schöcke
Hello everybody. I'm using a view (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to display the bloat (unused disk space) of the tables in a PostgreSQL database. Using this data I want to implement a database maintenance script automatically exectuting a VACUUM FULL on these tabl

Re: [GENERAL] Bloated Table

2009-05-27 Thread Bill Moran
In response to Alexander Schöcke : > Hello everybody. > > I'm using a view > (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to display the > bloat (unused disk space) of the tables in a PostgreSQL database. Using this > data I want to implement a database maintenance script auto

Re: [GENERAL] Bloated Table

2009-05-27 Thread Grzegorz Jaśkiewicz
On Wed, May 27, 2009 at 3:54 PM, Alexander Schöcke wrote: > Hello everybody. > > I'm using a view > (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to display the > bloat (unused disk space) of the tables in a PostgreSQL database. Using this > data I want to implement a database m

Re: [GENERAL] How to Install Postgres 8.3 in Solaris 10 as a service

2009-05-27 Thread Emanuel Calvo Franco
2009/5/27 Emanuel Calvo Franco : > 2009/5/27 Anirban Pal : >> Dear all members, >> >> I have been working on postgres (windows), for last 8 months. Recently, a >> client requrement requires me to install postgres in solaris 10. What I did >> is this. Untar the deliverables from postgresql.org websi

[GENERAL] Bloated Table

2009-05-27 Thread Alexander Schöcke
Hello everybody. I'm using a view (http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html) to display the bloat (unused disk space) of the tables in a PostgreSQL database. Using this data I want to implement a database maintenance script automatically exectuting a VACUUM FULL on these tabl

Re: [GENERAL] composite type and domain

2009-05-27 Thread Grzegorz Jaśkiewicz
When I start to complain about domains and types in postgresql, people often ask me - so what's exactly wrong with it - well, here you go. I am trying to provide some feedback ;) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www

Re: [GENERAL] How to Install Postgres 8.3 in Solaris 10 as a service

2009-05-27 Thread Emanuel Calvo Franco
2009/5/27 Anirban Pal : > Dear all members, > > I have been working on postgres (windows), for last 8 months. Recently, a > client requrement requires me to install postgres in solaris 10. What I did > is this. Untar the deliverables from postgresql.org website, for correct > version. Open a comman

Re: [GENERAL] GRANT all to a super user

2009-05-27 Thread Andrew Gould
On Wed, May 27, 2009 at 9:19 AM, Gauthier, Dave wrote: > What is the (is there a) grant command that I can use to create a super > user without having to specify all the DB objects? > > grant all on database foo to thesuper; > > and > > grant all privileges on database foo to thesuper; > > Don’t

Re: [GENERAL] GRANT all to a super user

2009-05-27 Thread Pavel Stehule
Hello there are not similar statement if you would to grant rights to more database objects, you have to use script or stored procedure. regards Pavel Stehule 2009/5/27 Gauthier, Dave : > What is the (is there a) grant command that I can use to create a super user > without having to specify al

[GENERAL] GRANT all to a super user

2009-05-27 Thread Gauthier, Dave
What is the (is there a) grant command that I can use to create a super user without having to specify all the DB objects? grant all on database foo to thesuper; and grant all privileges on database foo to thesuper; Don't work. I know I can achieve what I want by submitting a grant for each and

Re: [GENERAL] How to Install Postgres 8.3 in Solaris 10 as a service

2009-05-27 Thread Merlin Moncure
On Wed, May 27, 2009 at 5:00 AM, Anirban Pal wrote: > Dear all members, > > I have been working on postgres (windows), for last 8 months. Recently, a > client requrement requires me to install postgres in solaris 10. What I did > is this. Untar the deliverables from postgresql.org website, for cor

Re: [GENERAL] a strange error, resolved

2009-05-27 Thread Iv Ray
Both explanations sound very similar and very logical indeed. Never occurred to me to think that way. Actually, now I remembered, that in a few rare occasions we had to restart the whole server after the "refresh" and then there was no problem, at all. Thank you both! Iv. -- Sent via pgsql-

[GENERAL] Postgres registry access using java

2009-05-27 Thread Anirban Pal
Hi all, Can any body tell me how to fetch directory path for lib or data directory for postgres installation in windows using registry. Solution using Java language will be highly solicited. --- Thanks & Reagrds Anirban Pal | Software Engineer Disclaimer :- This e-mail and any attach

[GENERAL] How to Install Postgres 8.3 in Solaris 10 as a service

2009-05-27 Thread Anirban Pal
Dear all members, I have been working on postgres (windows), for last 8 months. Recently, a client requrement requires me to install postgres in solaris 10. What I did is this. Untar the deliverables from postgresql.org website, for correct version. Open a command window and write necessary co

Re: [GENERAL] composite type and domain

2009-05-27 Thread Merlin Moncure
2009/5/25 Grzegorz Jaśkiewicz : > Why is it not possible to create domain on composite type ? > > Consider the example, I got (a bytea, b timestamp, c timestamp). Where > b < c always, and both b and c have some default value, a can stay > null. > Now, I don't want to go berserk, and create adition

Re: [GENERAL] Regular expression and array

2009-05-27 Thread Merlin Moncure
On Tue, May 26, 2009 at 11:04 PM, Nick wrote: > I wont go into details about why im using this field as an array but > how would I select all the rows that have the first name 'Tom' out of > the 'names' field? > > CREATE TABLE test ( >    id integer, >    names character varying[] > ); > INSERT IN

Re: [GENERAL] a strange error

2009-05-27 Thread Csaba Nagy
Hi Ray, On Wed, 2009-05-27 at 14:24 +0200, Iv Ray wrote: > When the db is refreshed, the first click inside the web application > that uses it (php 5.x, Apache 2.x), and some of the next clicks (i. e. > the 3rd, 5th, 8th, 12th) result in the following error - > PGSQL ERROR: server closed the c

Re: [GENERAL] a strange error

2009-05-27 Thread Marc Schablewski
Hi, I guess this has nothing to do with postgres. Your web applicationdoes some kind of connection pooling and doesn't notice when you shut down the database. When you access the application after you reinitialized the database it will use these old and now invald connections and run into the give

[GENERAL] a strange error

2009-05-27 Thread Iv Ray
We are using PostgreSQL for more than 5 years by now and at least the last 2-3 years we experience the following situation. We refresh the live database on the development server using the following shell script - /usr/local/etc/rc.d/postgresql stop rm -r /home/data/postgresql/data /usr/loc