Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Greg Smith
On Tue, 22 Apr 2008, David Wilson wrote: Is there a way to get the size of a specific index, on that note? select pg_size_pretty(pg_relation_size('index_name')) works for me. There's a neat article on other things you can look at like this at

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Tom Lane
Greg Smith [EMAIL PROTECTED] writes: ...This is a bit out of my area, but after reading the rest of this thread I wonder whether raising the default_statistics_target parameter a bit might reduce the instances of bad plans showing up. On the evidence so far, it doesn't seem that David's

Re: [GENERAL] Postgres Encoding conversion problem

2008-04-23 Thread Michael Fuhr
On Tue, Apr 22, 2008 at 10:37:59AM +0200, Albe Laurenz wrote: Clemens Schwaighofer wrote: I sometimes have a problem with conversion of encodings eg from UTF-8 tio ShiftJIS: ERROR: character 0xf0a0aeb7 of encoding UTF8 has no equivalent in SJIS I have no idea what character this

Re: [GENERAL] Postgres Encoding conversion problem

2008-04-23 Thread Albe Laurenz
Michael Fuhr wrote: I sometimes have a problem with conversion of encodings eg from UTF-8 tio ShiftJIS: ERROR: character 0xf0a0aeb7 of encoding UTF8 has no equivalent in SJIS I have no idea what character this is, I cannot view it in my browser, etc. It translates to Unicode 10BB7,

Re: [GENERAL] Postgres Encoding conversion problem

2008-04-23 Thread Clemens Schwaighofer
On 04/23/2008 04:33 PM, Albe Laurenz wrote: Michael Fuhr wrote: I sometimes have a problem with conversion of encodings eg from UTF-8 tio ShiftJIS: ERROR: character 0xf0a0aeb7 of encoding UTF8 has no equivalent in SJIS I have no idea what character this is, I cannot view it in my

[GENERAL] Best approach for large table maintenance

2008-04-23 Thread Vanole, Mike
Hi, I have an application where I drop, recreate, reload, and recreate indexes on a 1 million row table each day. I do this to avoid having to run vacuum on the table in the case where I might use DELETE or UPDATEs on deltas. It seems that running vacuum still has value in the above approach

[GENERAL] Updating with a subselect

2008-04-23 Thread Leandro Casadei
Hi, I need to update a field from a table based in a count. This is the query: updateshops setitemsqty = ( select count(*) from items i1 join shops s1 on i1.shopid = s1.shopid where s1.shopid = s0.shopid ) from shops s0 The problem I'm having

[GENERAL] Bitmap Heap Scan takes a lot of time

2008-04-23 Thread mateo21
Hello, I have a big table (around 3 600 000 entries) which stores which user has seen which subjects in a forum. This query is executed every time a user connects to the forum: SELECT flg_rid FROM prj_frm_flg WHERE flg_mid=3 AND NOT flg_fav AND NOT flg_notif AND NOT flg_post ORDER BY flg_rid

[GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread wstrzalka
One of the annoying things in plpgsql is logical expression evaluation. In most (all??) languages I know, logical expression like: if ( [A_true_expression] or [B_false_expression] ) then will stop evaluating when the A expression will be evaluated as a TRUE. So the B will be not checked.

[GENERAL] tsearch2 problem

2008-04-23 Thread Corin Schedler
Hi all, I'm having some trouble installing tsearch2 in to my database. I'm running 8.1.11 on CentOS 5. I'm getting the following output after trying 'psql db tsearch2.sql'. SET BEGIN NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index pg_ts_dict_pkey for table pg_ts_dict CREATE

[GENERAL] Postgresql Help

2008-04-23 Thread Monalee Bhandge
Dear Sir, I am thinking to shift my software Axbo7.1 (see http://axbo.co.in/ ) to postgresql from mysql. I have Suse 10.2 operating system in my organization.I install version 8.1.5-13 successfuly. but when I start server as pg_ctl start -D /var/lib/pgsql/data then error

[GENERAL] help with plpgsql

2008-04-23 Thread Pau Marc Munoz Torres
Hi everybody I trying to upload some plpsql functions to postgresql database using a perl script and i get the following error psql:/usr/local/Make2D-DB_II/pgsql/make2db_functions.pgsql:85: ERROR: language plpgsql does not exist HINT: Use CREATE LANGUAGE to load the language into the

[GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread christian_behrens
Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes need to do a simple update to ALL rows that resets a status-flag

Re: [GENERAL] Changed Hosts, Lots of Errors in PostgreSQL - Help Please!

2008-04-23 Thread BLazeD
Hey there Yup it went from 8.1.9 to 8.3 Adrian Klaver wrote: On Friday 18 April 2008 8:27 pm, BLazeD wrote: Hi All I recently changed hosts for my PHP/PostgreSQL site and have been seeing alot of errors in the errors logs and also some on the site. [quote]PHP Warning: pg_query():

Re: [GENERAL] help with plpgsql

2008-04-23 Thread A. Kretschmer
am Mon, dem 21.04.2008, um 17:46:49 +0200 mailte Pau Marc Munoz Torres folgendes: Hi everybody I trying to upload some plpsql functions to postgresql database using a perl script and i get the following error psql:/usr/local/Make2D-DB_II/pgsql/make2db_functions.pgsql:85: ERROR:

Re: [GENERAL] Postgresql Help

2008-04-23 Thread Craig Ringer
Monalee Bhandge wrote: Dear Sir, I am thinking to shift my software Axbo7.1 (see http://axbo.co.in/ ) to postgresql from mysql. I have Suse 10.2 operating system in my organization.I install version 8.1.5-13 successfuly. but when I start server as pg_ctl start -D

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Craig Ringer
Corin Schedler wrote: Hi all, I'm having some trouble installing tsearch2 in to my database. I'm running 8.1.11 on CentOS 5. Where did the packages come from? Where they part of CentOS / RHEL, or are they obtained from somewhere else? Is there any chance your contrib package does not match

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread A. Kretschmer
am Mon, dem 21.04.2008, um 0:19:34 +0200 mailte [EMAIL PROTECTED] folgendes: Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread A. Kretschmer
am Tue, dem 22.04.2008, um 13:17:42 -0300 mailte Leandro Casadei folgendes: Hi, I need to update a field from a table based in a count. This is the query: updateshops setitemsqty = ( select count(*) from items i1 join shops s1 on i1.shopid =

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Martijn van Oosterhout
On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: One of the annoying things in plpgsql is logical expression evaluation. In most (all??) languages I know, logical expression like: if ( [A_true_expression] or [B_false_expression] ) then will stop evaluating when the A

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Martijn van Oosterhout
On Tue, Apr 22, 2008 at 01:17:42PM -0300, Leandro Casadei wrote: Hi, I need to update a field from a table based in a count. This is the query: I don't know why your given query doesn't work, but you could simplify it which may help. updateshops setitemsqty = ( select

Re: [GENERAL] Postgresql Help

2008-04-23 Thread Aarni Ruuhimäki
On Monday 21 April 2008 12:08, Monalee Bhandge wrote: pg_ctl start -D /var/lib/pgsql/data then error is- postmaster started. Could not open directory base No such file or directory. Hi, Did you initdb in that location ? Best regards, -- Aarni Ruuhimäki --- Burglars

[GENERAL] PG Yum Repo - can't Find Slony1

2008-04-23 Thread Ow Mun Heng
This question, I think is directed at Devrim, but if anyone else can answer it would be great as well. I saw from the site that states that slony1 packages are available. However, I can't find it from the yum archives. This is for Centos 5. Does anyone know? muchos gracias. -- Sent via

[GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Ivan Sergio Borgonovo
Hi, I'd like to know if anyone has experience in using postgresql 8.3 for amd64. How did you set up your apt config/source.list to just install the minimum required to install 8.3 and php drivers? Considering I'm not concerned of a short downtime and the DB is pretty small what were your steps

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Simon Riggs
On Tue, 2008-04-22 at 18:46 -0400, David Wilson wrote: I certainly expect some slowdown, given that I have indices that I can't drop (as you indicate above). Having been watching it now for a bit, I believe that the checkpoint settings were the major cause of the problem, however. Changing

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Ivan Sergio Borgonovo: I'd like to know if anyone has experience in using postgresql 8.3 for amd64. There are probably thousands of people with that experience. How did you set up your apt config/source.list to just install the minimum required to install

[GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Hi I just recently compiled and installed 8.3.1 on a System that has UTF-8 as the default characterset in the environment. Copied the binaries, run initdb without parameters, the usual stuff. As you probably are all aware of, this results now in a cluster that will only allow you to create

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Andreas 'ads' Scherbaum
On Tue, 22 Apr 2008 15:45:39 -0500 D. Dante Lorenso wrote: Andreas 'ads' Scherbaum wrote: So, the advice here is don't use ENUM? Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever (yeah, i skipped some special cases). But

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Richard Huxton
Tim Tassonis wrote: Hi I just recently compiled and installed 8.3.1 on a System that has UTF-8 as the default characterset in the environment. Copied the binaries, run initdb without parameters, the usual stuff. As you probably are all aware of, this results now in a cluster that will only

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Pavan Deolasee
On Wed, Apr 23, 2008 at 1:52 PM, A. Kretschmer [EMAIL PROTECTED] wrote: am Mon, dem 21.04.2008, um 0:19:34 +0200 mailte [EMAIL PROTECTED] folgendes: If I do a batched loop like this: UPDATE table SET flag=0 where id=0 and id 200; UPDATE table SET flag=0 where id=200 and id 400;

[GENERAL] Deny creation of tables for a user

2008-04-23 Thread Pascal Cohen
Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created. I mean she could insert, update delete rows but not create tables. I did not

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Tomasz Ostrowski
On 2008-04-22 23:46, David Wilson wrote: Upping the segments to 50, timeout to 30m and completion target to 0.9 has improved average copy time to between 2 and 10 seconds, which is definitely an improvement. I'd up them to 128 (or even 256) and set completion target back to 0.5. But make sure

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Terry Lee Tucker
On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created. I mean she could insert,

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: My question is: Why then is --locale=C not the default for initdb, as I do regard it as a rather big annoyance that a default installation on probably almost any modern linux distribution results in a UTF-8 only cluster, fixable only by

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Pascal Cohen
Terry Lee Tucker wrote: On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created.

[GENERAL] Re: Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Tomasz Ostrowski
On 2008-04-21 00:19, [EMAIL PROTECTED] wrote: I have a very large table with about 60 million rows. I sometimes need to do a simple update to ALL rows that resets a status-flag to zero. UPDATE table SET flag=0; First optimization: UPDATE table SET flag=0 where flag!=0; Second

Re: [GENERAL] Bitmap Heap Scan takes a lot of time

2008-04-23 Thread Gregory Stark
[EMAIL PROTECTED] writes: This is the result of an EXPLAIN: ... I suppose that the problem comes from the Bitmap Heap Scan which costs a lot, but I can't be totally sure. Any idea on where I should be investigating ? Try posting an EXPLAIN ANALYZE which will actually run the query and

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Ivan Sergio Borgonovo
On Wed, 23 Apr 2008 12:04:08 +0200 Peter Eisentraut [EMAIL PROTECTED] wrote: Am Mittwoch, 23. April 2008 schrieb Ivan Sergio Borgonovo: I'd like to know if anyone has experience in using postgresql 8.3 for amd64. There are probably thousands of people with that experience. I'd like to be

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Roberts, Jon
Terry Lee Tucker wrote: On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Alvaro Herrera
Martijn van Oosterhout escribió: On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: One of the annoying things in plpgsql is logical expression evaluation. In most (all??) languages I know, logical expression like: if ( [A_true_expression] or [B_false_expression] ) then

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Alvaro Herrera
[EMAIL PROTECTED] wrote: How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes need to do a simple update to ALL rows

[GENERAL] Qty of WAL files

2008-04-23 Thread Glyn Astill
Hi chaps, I've set the checkpoint_segments on our system to 20 in anticipation of our system being quite write heavy, and I was wondering if someone could give me the lowdown on the amount of WAL files created and how they're re-used. I've just read in a large amount of data into the database

[GENERAL] Qty of WAL files

2008-04-23 Thread Glyn Astill
Hi chaps, I've set the checkpoint_segments on our system to 20 in anticipation of our system being quite write heavy, and I was wondering if someone could give me the lowdown on the amount of WAL files created and how they're re-used. I've just read in a large amount of data into the database

Re: FW: Re: [GENERAL] create temp in function

2008-04-23 Thread Kerri Reno
Thanks for all who helped me with this. I just upgraded our one remaining database to 8.2 and EXECUTE INTO worked great. THANKS! Kerri On 4/22/08, Klint Gore [EMAIL PROTECTED] wrote: Kerri Reno wrote: So the reason I'm getting the error is that I'm running it in 8.0. Thanks so much for

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Tue, 22 Apr 2008, Leandro Casadei wrote: Hi, I need to update a field from a table based in a count. This is the query: updateshops setitemsqty = ( select count(*) from items i1 join shops s1 on i1.shopid = s1.shopid where s1.shopid =

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Albe Laurenz
Pascal Cohen wrote: I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created. I mean she could insert, update delete rows but not create

Re: [GENERAL] Qty of WAL files

2008-04-23 Thread Tom Lane
Glyn Astill [EMAIL PROTECTED] writes: I've set the checkpoint_segments on our system to 20 in anticipation of our system being quite write heavy, and I was wondering if someone could give me the lowdown on the amount of WAL files created and how they're re-used.

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I think this business of non-shortcircuiting boolean operators is just an artifact of the fact that PL/pgSQL hands off expression to the SQL engine for evaluation. The complainant is not actually complaining about non-shortcircuiting boolean operators

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Peter Eisentraut wrote: Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: My question is: Why then is --locale=C not the default for initdb, as I do regard it as a rather big annoyance that a default installation on probably almost any modern linux distribution results in a UTF-8 only cluster,

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Tom Lane
Craig Ringer [EMAIL PROTECTED] writes: Is there any chance your contrib package does not match the core PostgreSQL version or is from a different source? qsort_arg was added in 8.2, so it seems certain he's trying to load an 8.2 tsearch2 into his 8.1 engine. regards,

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Tom Lane
Roberts, Jon [EMAIL PROTECTED] writes: You probably want to also REVOKE ALL ON SCHEMA public FROM public; so users can't create objects in that schema. More like REVOKE CREATE ..., unless your intent is also to deny access to existing stuff in the public schema. You'd also want to make sure

[GENERAL] Backup setup

2008-04-23 Thread Gabor Siklos
I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? Or should I instead just dump the data, using pg_dump, and back up the dump? The advantage of the first method would

Re: [GENERAL] Backup setup

2008-04-23 Thread Terry Lee Tucker
On Wednesday 23 April 2008 11:14, Gabor Siklos wrote: I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? Or should I instead just dump the data, using pg_dump, and

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Greg Smith
I collected up links to the best of the information I found out there on this topic and dumped them into http://wiki.postgresql.org/wiki/Detailed_installation_guides One of those is a walkthrough of an upgrade, it looked straightforward. -- * Greg Smith [EMAIL PROTECTED]

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Merlin Moncure
On Wed, Apr 23, 2008 at 9:04 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large

Re: [GENERAL] Backup setup

2008-04-23 Thread Tom Lane
Gabor Siklos [EMAIL PROTECTED] writes: I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? This will not work. Please read

Re: [GENERAL] Backup setup

2008-04-23 Thread Christophe
For a database that big, you might consider using the WAL archiving strategy and shipping the WAL files offsite: http://www.postgresql.org/docs/8.3/interactive/continuous- archiving.html On Apr 23, 2008, at 8:14 AM, Gabor Siklos wrote: I need to back up our database off-site for disaster

Re: [GENERAL] Backup setup

2008-04-23 Thread Alan Hodgson
On Wednesday 23 April 2008, Gabor Siklos [EMAIL PROTECTED] wrote: I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? Technically you can do this, if you do it per

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Pavan Deolasee
On Mon, Apr 21, 2008 at 3:49 AM, [EMAIL PROTECTED] wrote: Could I use that to hack my way around transactions? Since you are asking for trouble, may there is something you can do with Before UPDATE Triggers and heap_inplace_update(). Before you try this out: I must say, *I have no idea if

[GENERAL] Vacuuming Questions

2008-04-23 Thread John Gardner
We have two PostgreSQL servers (8.2) running in a cluster. We have autovacuum switched on on both servers and also we are running the following as a cron job; Server 1: 30 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/vacuumdb --all --analyze Server 2: 30 1,3,5,7,9,11,13,15,17,19,21,23 * * *

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Martijn van Oosterhout
On Wed, Apr 23, 2008 at 02:34:38PM +0200, Ivan Sergio Borgonovo wrote: plain etch. pg 8.1 client, server and contrib + php5-pgsql My dream upgrade would be: I don't know about dream upgrade, but this should work (assuming you're currently running a debian postgresql installation): 1. install

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread Joshua D. Drake
On Wed, 23 Apr 2008 16:27:33 +0100 John Gardner [EMAIL PROTECTED] wrote: We have two PostgreSQL servers (8.2) running in a cluster. Could you be a bit more specific about what you mean by: in a cluster? Now, we're not seeing any problems with performance and we're not seeing any bloat but I

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Martijn van Oosterhout
On Wed, Apr 23, 2008 at 04:35:04PM +0200, Tim Tassonis wrote: Ok, let me put it in another way. If UTF-8 is chosen at initdb, only UTF-8 databases can be created, if C is chosen, you can specify different encodings (UTF-8, LATIN1 etc) for each database. As I understood now, sorting will

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: If specifying a characterset different from the default locale for a database is such a bad idea, why is it possible at all? Because Japanese users need this functionality. Aside from spectacularly bizarre niche applications, that is really

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Wed, 23 Apr 2008, Leandro Casadei wrote: On Wed, Apr 23, 2008 at 10:59 AM, Stephan Szabo [EMAIL PROTECTED] wrote: On Tue, 22 Apr 2008, Leandro Casadei wrote: Hi, I need to update a field from a table based in a count. This is the query: updateshops set

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread Scott Marlowe
On Wed, Apr 23, 2008 at 9:27 AM, John Gardner [EMAIL PROTECTED] wrote: We have two PostgreSQL servers (8.2) running in a cluster. We have autovacuum switched on on both servers and also we are running the following as a cron job; Server 1: 30 0,2,4,6,8,10,12,14,16,18,20,22 * * *

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Martijn van Oosterhout wrote: On Wed, Apr 23, 2008 at 04:35:04PM +0200, Tim Tassonis wrote: If specifying a characterset different from the default locale for a database is such a bad idea, why is it possible at all? It isn't possible, that's the point. What is possible is that client can

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Steve Crawford
[EMAIL PROTECTED] wrote: Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes need to do a simple update to ALL

Re: [GENERAL] PG Yum Repo - can't Find Slony1

2008-04-23 Thread Devrim GÜNDÜZ
Hi, On Wed, 2008-04-23 at 17:10 +0800, Ow Mun Heng wrote: This question, I think is directed at Devrim, but if anyone else can answer it would be great as well. I saw from the site that states that slony1 packages are available. However, I can't find it from the yum archives. This is for

[GENERAL] ROLAP visualization tool recommendations

2008-04-23 Thread Roberts, Jon
I'm looking for a good BI tool to query data in PostgreSQL. I'm not looking for a pixel perfect reporting tool but a tool that supports things like: * Star Schema * Drill up/down with hierarchies defined in metadata * Self service * Graphing * Scheduling In other words, I want a ROLAP

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Karsten Hilbert
On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever (yeah, i skipped some special cases). I was gonna say ! :-) Add hermaphrodite transgender with

[GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Rhys Stewart
Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3 8|10 9|4 10 |8 both aid bid represent the same data in another table, but the table has duplicate data and i did a self-join to get the id's out. The question is how do

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Karsten Hilbert
On Wed, Apr 23, 2008 at 11:46:35AM +0200, Tim Tassonis wrote: As you probably are all aware of, this results now in a cluster that will only allow you to create UTF-8 databases. I have read some posts regarding this topic where it is explained that allowing LATIN1 on a cluster

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Christopher Condit
I have a question related to this issue: Now that the locale has changed, it seems that the planner no longer wants to use the indexes for running LIKE queries on varchar columns unless I specify varchar_pattern_ops when creating the index. And if I create the index with varchar_pattern_ops, then

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Simon Riggs
On Mon, 2008-04-21 at 00:19 +0200, [EMAIL PROTECTED] wrote: How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes need

[GENERAL] Create temporary function

2008-04-23 Thread Steve Crawford
I have recently run across situations that might benefit from the ability to create a temporary function. One situation is where periodic processing would benefit from server-side functions but the processing is run rarely (say monthly or annually) and the requirements for the function may

Re: [GENERAL] Create temporary function

2008-04-23 Thread Tom Lane
Steve Crawford [EMAIL PROTECTED] writes: I have recently run across situations that might benefit from the ability to create a temporary function. You can do that today, as long as you don't mind schema-qualifying uses of the function: regression=# create function pg_temp.tfunc(int) returns

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Scott Marlowe
I'd say you need to rethink your schema. On Wed, Apr 23, 2008 at 12:11 PM, Rhys Stewart [EMAIL PROTECTED] wrote: Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3 8|10 9|4 10 |8 both aid bid represent

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread James Strater
This works in oracle: SELECT aid, bid FROM aidbid WHERE aid bid UNION SELECT bid, aid FROM aidbid WHERE bid aid Rhys Stewart [EMAIL PROTECTED] wrote: Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3 8

[GENERAL] Stored procedures in C

2008-04-23 Thread Emiliano Moscato
Hi all, I have to do some stuff writing stored procedures for Postgres in C. I saw the oficial documentation but it was hard for me to find out how to do a simple function, let's call it query() , that receives a string and uses this string to do a query and return the results. Has anyone some

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Roberts, Jon
You really don't have duplicate data and you should redesign your table structure. However, here is a way to do it. create table ugly (aid integer, bid integer); insert into ugly (aid, bid) values (1,5); insert into ugly (aid, bid) values (2,6); insert into ugly (aid, bid) values (3,7); insert

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Raymond O'Donnell
On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point! LOL :-) Ray.

[GENERAL] query performance

2008-04-23 Thread Brian Cox
I have a largish (pg_dump output is 4G) database. The query: select count(*) from some-table was taking 120 secs to report that there were 151,000+ rows. This seemed very slow. This db gets vacuum'd regularly (at least once per day). I also did a manual 'vacuum analyze', but after it completed,

Re: [GENERAL] query performance

2008-04-23 Thread Tom Lane
Brian Cox [EMAIL PROTECTED] writes: I have a largish (pg_dump output is 4G) database. The query: select count(*) from some-table was taking 120 secs to report that there were 151,000+ rows. This seemed very slow. This db gets vacuum'd regularly (at least once per day). I also did a manual

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Roberts, Jon
On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point!

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Colin Wetherbee
Roberts, Jon wrote: On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point!

Re: [GENERAL] Create temporary function

2008-04-23 Thread Steve Crawford
Tom Lane wrote: Steve Crawford [EMAIL PROTECTED] writes: I have recently run across situations that might benefit from the ability to create a temporary function. You can do that today, as long as you don't mind schema-qualifying uses of the function: regression=# create function

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Robert Treat
On Wednesday 23 April 2008 14:10, Karsten Hilbert wrote: On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever (yeah, i skipped some special cases).

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Rob Wultsch
On Wed, Apr 23, 2008 at 2:51 PM, Robert Treat [EMAIL PROTECTED] wrote: On Wednesday 23 April 2008 14:10, Karsten Hilbert wrote: On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Tom Allison
Far from being an expert on postgres, but there are two ideas-- assuming that you cannot afford the time it would take to simply UPDATE and wait... Write a script to update all the rows, one at a time. Lowest impact to operations but would take a very long time. Assuming you have a

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Alban Hertroys
On Apr 21, 2008, at 12:19 AM, [EMAIL PROTECTED] wrote: Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes

Re: [GENERAL] Stored procedures in C

2008-04-23 Thread Martin Gainty
Emiliano and Mike The real challenge is trying to determine what a datatype is in cobol..for that matter what is stack variable or heap in Cobol? In the end you're better off rewriting this mess (preferably in Java).. unless of course you need the billable hours for the first rewrite to C then

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Karsten Hilbert wrote: On Wed, Apr 23, 2008 at 11:46:35AM +0200, Tim Tassonis wrote: As you probably are all aware of, this results now in a cluster that will only allow you to create UTF-8 databases. I have read some posts regarding this topic where it is explained that allowing LATIN1 on

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread John Gardner
Joshua D. Drake wrote: On Wed, 23 Apr 2008 16:27:33 +0100 John Gardner [EMAIL PROTECTED] wrote: We have two PostgreSQL servers (8.2) running in a cluster. Could you be a bit more specific about what you mean by: in a cluster? Well, we're using middleware technology to load balance and

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Scott Marlowe
On Wed, Apr 23, 2008 at 12:10 PM, Karsten Hilbert [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever (yeah, i skipped

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Chris Browne
[EMAIL PROTECTED] writes: How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? You may need to redefine the problem. I have a very large table with about 60 million rows. I sometimes

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread brian
Scott Marlowe wrote: On Wed, Apr 23, 2008 at 12:10 PM, Karsten Hilbert [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Dann Corbit
-Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of Chris Browne Sent: Wednesday, April 23, 2008 3:20 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

[GENERAL] Column order

2008-04-23 Thread Vyacheslav Kalinin
Hello, It is often convenient to have columns of a table in certain order (as shown by psql or most GUI database explorers, it also affects INSERT's without columns specified behavior) so as to most significant columns to come first, semantically close columns to be grouped etc, while the columns

Re: [GENERAL] Column order

2008-04-23 Thread Robert Treat
On Wednesday 23 April 2008 21:33, Vyacheslav Kalinin wrote: Hello, It is often convenient to have columns of a table in certain order (as shown by psql or most GUI database explorers, it also affects INSERT's without columns specified behavior) so as to most significant columns to come

  1   2   >