Re: [GENERAL] Moving between major versions easily (Was: Vacuums taking forever :()

2009-02-05 Thread Alban Hertroys
On Feb 3, 2009, at 7:31 PM, Phoenix Kiula wrote: Thanks, Gregory and Simon, for the very useful posts. I have increased the vacuum_cost_limit to 2000 for now, just to see if that has an impact. Hopefully positive. Next on my list is to be able to easily upgrade to 8.3, but Slony seemed like a

Re: [GENERAL] running postgres

2009-02-05 Thread Sebastian Tennant
Quoth Kusuma Pabba kusu...@ncoretech.com: /usr/local/pgsql/bin/psql test test=# sudo su postgres -c psql template1 template=# why is the path different in both cases? Type: $ which psql and $ sudo which psql The answer is the same, yes? $ /usr/local/pgsql/bin/psql test

[GENERAL] Automatic database upgrade

2009-02-05 Thread Thom Brown
Hi, I've got a question which I hope you'll forgive if I'm missing something obvious... We (you, me, everyone) are currently presented with a problem when upgrading our installed version of PostgreSQL when upgrading to a major release version (i.e. 8.2 to 8.3, or 8.3 to 8.4) Is it not possible

Re: [GENERAL] Elapsed time between timestamp variables in Function

2009-02-05 Thread Nico Callewaert
Thanks a lot to everybody for the help ! - Original Message - From: Osvaldo Kussama osvaldo.kuss...@gmail.com To: Nico Callewaert callewaert.n...@telenet.be Cc: pgsql-general@postgresql.org Sent: Thursday, February 05, 2009 2:59 AM Subject: Re: [GENERAL] Elapsed time between timestamp

Re: [GENERAL] Automatic database upgrade

2009-02-05 Thread Karsten Hilbert
We (you, me, everyone) are currently presented with a problem when upgrading our installed version of PostgreSQL when upgrading to a major release version (i.e. 8.2 to 8.3, or 8.3 to 8.4) Is it not possible to have PostgreSQL upgrade the actual database cluster upon installing a new major

Re: [GENERAL] Automatic database upgrade

2009-02-05 Thread Thom Brown
2009/2/5 Karsten Hilbert karsten.hilb...@gmx.net Debian has an add-on named pg_upgradecluster which transforms an existing cluster into a new one transferring databases via dump/restore. This works nicely as long as the databases are not too large with respect to the hardware

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Grzegorz Jaśkiewicz
On Wed, Feb 4, 2009 at 9:09 PM, Peter Eisentraut pete...@gmx.net wrote: On Wednesday 04 February 2009 20:36:24 Grzegorz Jaśkiewicz wrote: I dream about db wide checks on tables, without need to write expensive triggers. Basically, something that would run a select query after

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Simon Riggs
On Thu, 2009-02-05 at 11:08 +, Greg Stark wrote: The problem with trying to push everything into the database is that it ends up sucking your entire application into the database. That limits your choice of languages and tools, and also creates a huge bottleneck. No, it allows you to

Re: [GENERAL] running postgres

2009-02-05 Thread Sam Mason
On Thu, Feb 05, 2009 at 08:12:48AM +, Sebastian Tennant wrote: This is why you need to type 'sudo su postgres -c psql template1'. A little shortcut, you can do the above from sudo as: sudo -u postgres psql template1 This was pointed out to me by another kind soul on this list, but I

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Grzegorz Jaśkiewicz
also, how hard would it be to implement CREATE ASSERTION, and where do you see it (and maybe Tom could anwer that one too). Would you say, it would be possible for someone with my knowledge of postgresql internals (vague), but with very good C to do it -- Sent via pgsql-general mailing list

Re: [GENERAL] Array, bytea and large objects

2009-02-05 Thread Harald Fuchs
In article 4989e659.3000...@computer.org, David Wall d.w...@computer.org writes: If I have an unlimited number of name-value pairs that I'd like to get easy access to for flexible reports, could I store these in two arrays (one for name, the other for value) in a table so that if I had 10

Re: [GENERAL] running postgres

2009-02-05 Thread Sam Mason
On Thu, Feb 05, 2009 at 12:05:31PM +0530, Kusuma Pabba wrote: how can i create a user in test or template when i give create user it is asking for create role , how should i create role? Users are associated with the cluster and not with any specific database. I tend to add users by directly

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Greg Stark
On Wed, Feb 4, 2009 at 6:42 PM, Simon Riggs si...@2ndquadrant.com wrote: As A.M. says elsewhere, it would be good to have a trigger that fired a NOTIFY that was picked up by a scheduled job that LISTENs every 10 minutes for certain events. We need a place for code that is *not* directly

Re: [GENERAL] Automatic database upgrade

2009-02-05 Thread Karsten Hilbert
Debian has an add-on named pg_upgradecluster which transforms an existing cluster into a new one transferring databases via dump/restore. This works nicely as long as the databases are not too large with respect to the hardware specs they are running on. Ah really? Is that a

Re: [GENERAL] Automatic database upgrade

2009-02-05 Thread Thom Brown
Debian has an add-on named pg_upgradecluster which transforms an existing cluster into a new one transferring databases via dump/restore. This works nicely as long as the databases are not too large with respect to the hardware specs they are running on. Karsten Right, I'm getting the

Re: [GENERAL] Array, bytea and large objects

2009-02-05 Thread Filip Rembiałkowski
2009/2/4 David Wall d.w...@computer.org First, LOs seem to allow an OID column to be added to any number of tables, but is it true that the actual large object data is stored in a single table (pg_largeobject?). yes. http://www.postgresql.org/docs/8.3/static/lo-intro.html If so,

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread A.M.
On Feb 5, 2009, at 6:08 AM, Greg Stark wrote: On Wed, Feb 4, 2009 at 6:42 PM, Simon Riggs si...@2ndquadrant.com wrote: As A.M. says elsewhere, it would be good to have a trigger that fired a NOTIFY that was picked up by a scheduled job that LISTENs every 10 minutes for certain events.

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Dimitri Fontaine
Hi, I think too that having the possibility of scheduling database maintenance function right into the database would be a great feature. The first use case that comes to my mind is this */5 cron job which runs psql just to clean out old sessions and force a vacuum analyze. On Wednesday 04

Re: [GENERAL] Array, bytea and large objects

2009-02-05 Thread David Wall
Thanks, Filip. If I have an unlimited number of name-value pairs that I'd like to get easy access to for flexible reports, could I store these in two arrays (one for name, the other for value) in a table so that if I had 10 name-value pairs or 200 name-value pairs, I could

Re: [GENERAL] Array, bytea and large objects

2009-02-05 Thread Filip Rembiałkowski
2009/2/5 David Wall d.w...@computer.org Are the BYTEA fields stored in the same table as the rest of the data? yes - and the TOAST tables if it's larger than 1/3 of a page or so. search for TOAST details if you're interested. Hmm... So a page is 8192 bytes, and it leaves your regular

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Alvaro Herrera
Grzegorz Jaśkiewicz escribió: On Wed, Feb 4, 2009 at 9:09 PM, Peter Eisentraut pete...@gmx.net wrote: On Wednesday 04 February 2009 20:36:24 Grzegorz Jaśkiewicz wrote: I dream about db wide checks on tables, without need to write expensive triggers. Basically, something that would run a

[GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Rob Richardson
Greetings! I've run into this problem a few times. There must be a solution, but I don't know what it is. I have a table that has three interesting columns: coil_id, charge, and coldspot_time. A charge can have several coils, so there are several records with differing coil_ids but the same

Re: [GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Sam Mason
[ Rob, it would help if you didn't reply to unrelated messages. Decent mail programs automatically thread emails based on what you reply to and hence unrelated messages like yours tend to get lost. ] On Thu, Feb 05, 2009 at 02:43:07PM -0500, Rob Richardson wrote: I want a list of the coils

Re: [GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Tom Lane
Rob Richardson rob.richard...@rad-con.com writes: I have a table that has three interesting columns: coil_id, charge, and coldspot_time. A charge can have several coils, so there are several records with differing coil_ids but the same charge. I want a list of the coils whose coldspot_times

Re: [GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Rob Richardson
Sam, Great! I had no idea DISTINCT ON existed. That made it much simpler. Here's what I used: select distinct on (inventory.charge) coil_id, inventory.charge, heating_coldspot_time_reached from inventory inner join charge on charge.charge = inventory.charge where base_type = '3' and

Re: [GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Rob Richardson
Thanks very much, Tom. While the DISTINCT ON suggestion answered the question I asked very neatly and I am glad to add that concept to my arsenal, your standard-compliant query was what I actually needed. The DISTINCT ON query only gave me one coil if there were two coils in a charge that had

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Peter Eisentraut
Grzegorz Jaśkiewicz wrote: also, how hard would it be to implement CREATE ASSERTION, and where do you see it (and maybe Tom could anwer that one too). Would you say, it would be possible for someone with my knowledge of postgresql internals (vague), but with very good C to do it I think you

Re: [GENERAL] Pet Peeves?

2009-02-05 Thread Erik Jones
On Feb 2, 2009, at 12:46 PM, wstrzalka wrote: On Feb 2, 8:23 pm, br...@momjian.us (Bruce Momjian) wrote: wstrzalka wrote: * stat collector is really greedy by definition even when system is idle, when you have really really many relations I think this will be fixed in 8.4. That would by

Re: [GENERAL] Bringing other columns along with a GROUP BY clause

2009-02-05 Thread Gregory Stark
Tom Lane t...@sss.pgh.pa.us writes: I have a feeling that it could also be done via the window functions feature due to be introduced in 8.4, but I'm not entirely sure how. Anybody feeling handy with those? There may be a better way but something like select * from (select *, rank() over

[GENERAL] small doubt

2009-02-05 Thread Kusuma Pabba
when i use /usr/local/pgsql/bin/psql test this i am getting following error psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket /tmp/.s.PGSQL.5432? should i restart the server or what should be

Re: [GENERAL] small doubt

2009-02-05 Thread A. Kretschmer
In response to Kusuma Pabba : when i use /usr/local/pgsql/bin/psql test this i am getting following error psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket /tmp/.s.PGSQL.5432? should i