[GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread dan.m.harris
Hi everyone, I'm trying to take a base backup of my primary DB ready for copying to my standby. I've followed the instructions to configure my postgresql.conf at hxxp://www.postgresql.org/docs/9.0/static/continuous-archiving.html, but I get one of two errors depending on how I try to run the

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread Thom Brown
On 28 October 2010 12:42, dan.m.harris daniel.har...@metaswitch.com wrote: Hi everyone, I'm trying to take a base backup of my primary DB ready for copying to my standby. I've followed the instructions to configure my postgresql.conf at

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread dan.m.harris
Hi Thom, thanks for your reply. Here's my psql output: bash-3.00$ bin/psql psql (9.0.1, server 8.1.4) WARNING: psql version 9.0, server version 8.1. Some psql features might not work. Type help for help. postgres=# SHOW wal_level; ERROR: unrecognized configuration parameter wal_level

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread Thom Brown
On 28 October 2010 13:07, dan.m.harris daniel.har...@metaswitch.com wrote: Hi Thom, thanks for your reply. Here's my psql output: bash-3.00$ bin/psql psql (9.0.1, server 8.1.4) WARNING: psql version 9.0, server version 8.1.         Some psql features might not work. Type help for help.

Re: [GENERAL] exceptionally large UPDATE

2010-10-28 Thread Vick Khera
On Wed, Oct 27, 2010 at 10:26 PM, Ivan Sergio Borgonovo m...@webthatworks.it wrote: I'm increasing maintenance_work_mem to 180MB just before recreating the gin index. Should it be more? You can do this on a per-connection basis; no need to alter the config file. At the psql prompt (or via

[GENERAL] PostGIS return multiple points

2010-10-28 Thread trevor1940
Hi I have a PostGIS table and I wish to get the location/name of multiple points at once the command for selecting one point is select PolyName from MyPolygones where st_Contains(the_geom, GeomFromText('point($LAT $LONG)4326'); where $LAT $LONG are perl varables So how can i do this if iI have

Re: [GENERAL] DB become enormous with continuos insert and update

2010-10-28 Thread Hfe80
Thank to all I couldn't respond yesterday but we had tried all you suggestion in the past weeks. But nothing change really Now finally have resolve the problem!!! It was a bug of version 8.1. We solve all our problem simply update to 8.4 !!! It's incredible, DB don't change dimension even

Re: [GENERAL] DB become enormous with continuos insert and update

2010-10-28 Thread Gabriele Bartolini
Hello, It was a bug of version 8.1. We solve all our problem simply update to 8.4 !!! Well ... it was not a bug, actually a feature that was not yet implemented. My first question about which version of PostgreSQL you were using in this thread was exactly for that purpose, but ... you never

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread Adrian Klaver
On Thursday 28 October 2010 5:07:06 am dan.m.harris wrote: Hi Thom, thanks for your reply. Here's my psql output: bash-3.00$ bin/psql psql (9.0.1, server 8.1.4) WARNING: psql version 9.0, server version 8.1. Some psql features might not work. Type help for help. postgres=# SHOW

Re: [GENERAL] PostGIS return multiple points

2010-10-28 Thread maarten
hey, I haven't used postgis yet, however, assuming the normal rules still apply and st_Contains returns true/false: SELECT ... WHERE st_Contains(point1) OR st_Contains(point2) OR ... or using the IN statement: SELECT ... WHERE true IN (st_Contains(point1),st_Contains(point2),...) That should

[GENERAL] Printing command string passed to EXECUTE command in plpgsql (after argument resolution)

2010-10-28 Thread Allan Kamau
I am debugging a plpgsql function which contains a long sql query consisting of several parameters which is executed using EXECUTE command. I would like to output this command string including the actual values of the parameters contained within it so I can obtain the actual query and run it

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread dan.m.harris
I was just being a bit dull, I'm afraid - I've had a read of the psql help, and by default it connects to port 5432, which is the port that's listening for the PG 8.1.4 install on my server. I ran 'bin/psql -p ' instead, to point at my PG 9.0 instance, and the pg_start_backup worked fine.

Re: [GENERAL] Can't take base back up with Postgres 9.0 on Solaris 10

2010-10-28 Thread Adrian Klaver
On Thursday 28 October 2010 5:07:06 am dan.m.harris wrote: Hi Thom, thanks for your reply. Here's my psql output: bash-3.00$ bin/psql psql (9.0.1, server 8.1.4) WARNING: psql version 9.0, server version 8.1. Some psql features might not work. Type help for help. postgres=# SHOW

Re: [GENERAL] Printing command string passed to EXECUTE command in plpgsql (after argument resolution)

2010-10-28 Thread Pavel Stehule
Hello 2010/10/28 Allan Kamau kamaual...@gmail.com: I am debugging a plpgsql function which contains a long sql query consisting of several parameters which is executed using EXECUTE command. I would like to output this command string including the actual values of the parameters contained

Re: [GENERAL] Printing command string passed to EXECUTE command in plpgsql (after argument resolution)

2010-10-28 Thread Leif Biberg Kristensen
On Thursday 28. October 2010 16.25.47 Allan Kamau wrote: I am debugging a plpgsql function which contains a long sql query consisting of several parameters which is executed using EXECUTE command. I would like to output this command string including the actual values of the parameters

Re: [GENERAL] How to merge data from two separate databases into one (maybe using xlogs)?

2010-10-28 Thread Daniel . Crespo
On Wed, Oct 27, 2010 at 5:19 PM, daniel.cre...@l-3com.com wrote: thinking about the possibility of shipping all xlogs of both databases and putting them into the final master (one of them), and replay them to have all data. Later, I would take care of the conflicts. Again, I

Re: [GENERAL] Printing command string passed to EXECUTE command in plpgsql (after argument resolution)

2010-10-28 Thread Allan Kamau
On Thu, Oct 28, 2010 at 5:47 PM, Leif Biberg Kristensen l...@solumslekt.org wrote: On Thursday 28. October 2010 16.25.47 Allan Kamau wrote: I am debugging a plpgsql function which contains a long sql query consisting of several parameters which is executed using EXECUTE command. I would like

Re: [GENERAL] Printing command string passed to EXECUTE command in plpgsql (after argument resolution)

2010-10-28 Thread Pavel Stehule
I could use the RAISE NOTICE could work but I will have to write another command string and use % in place of the $somenumber for the parameters, one string for RAISE NOTICE and the other for EXECUTE. This may potentially introduce some differences (due to human error) between the output of

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread Michael Clark
Hello all. Thanks a lot for the responses, they are appreciated. I think I now understand the folly of my loop, and how that was negatively impacting my test. I tried the suggestion Alex and Tom made to change my loop with a select() and my results are now very close to the non-async version.

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread A.M.
On Oct 28, 2010, at 11:08 AM, Michael Clark wrote: Hello all. Thanks a lot for the responses, they are appreciated. I think I now understand the folly of my loop, and how that was negatively impacting my test. I tried the suggestion Alex and Tom made to change my loop with a select()

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread Michael Clark
On Thu, Oct 28, 2010 at 11:15 AM, A.M. age...@themactionfaction.com wrote: On Oct 28, 2010, at 11:08 AM, Michael Clark wrote: Hello all. Thanks a lot for the responses, they are appreciated. I think I now understand the folly of my loop, and how that was negatively impacting my

[GENERAL] earthdistance or PostGIS for find * within point and radius

2010-10-28 Thread John Cheng
I have a database with the earthdistance contrib module installed and I need to find records whose long latitude are within a given distance of a zip code. From the documentation on earthdistance, I believe it is certainly possible to do a find points within a distance of another point using the 

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-28 Thread Ozz Nixon
How/where do I query this? My script does not need a 100% accurate count - just a recently valid count - so I can verify the web crawlers are still crawling :-) On Oct 27, 2010, at 7:15 AM, Merlin Moncure wrote: pg_class.reltuples -- Sent via pgsql-general mailing list

Re: [GENERAL] PostGIS return multiple points

2010-10-28 Thread ludwig
Just some thoughts: - create a multipoint with 100 vertices instead of a single point and query once with st_Intersect - prepare the single-point-query and execute the prepared query 100 times with the changing coordinates Ludwig - Ursprüngliche Nachricht - Von: trevor1940 Gesendet:

Re: [GENERAL] Why Select Count(*) from table - took over 20 minutes?

2010-10-28 Thread Merlin Moncure
On Thu, Oct 28, 2010 at 11:36 AM, Ozz Nixon ozzni...@gmail.com wrote: How/where do I query this? My script does not need a 100% accurate count - just a recently valid count - so I can verify the web crawlers are still crawling :-) you can do this: select reltuples from pg_class where relname

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread Daniel Verite
A.M. wrote: In PostgreSQL, query canceling is implemented by opening a second connection and passing specific data which is received from the first connection With libpq's PQCancel(), a second connection is not necessary. Best regards, -- Daniel PostgreSQL-powered mail user agent

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread Daniel Verite
Michael Clark wrote: I guess I can have one thread performing the query using the non async PG calls, then from another thread issue the cancellation. Both threads accessing the same PGconn ? Yes. See http://www.postgresql.org/docs/9.0/static/libpq-cancel.html Best regards, --

[GENERAL] moving database objects from one schema to other

2010-10-28 Thread akp geek
Hi all - I would like to know if there is any other way of moving objects from one schema to other schema? right now the way I am doing it is , take the backup and importing whatever the database objects I wanted to move, I am doing that using pg_restore. But I am finding it

Re: [GENERAL] moving database objects from one schema to other

2010-10-28 Thread Thom Brown
On 28 October 2010 17:11, akp geek akpg...@gmail.com wrote: Hi all -               I would like to know if there is any other way of moving objects from one schema to other schema? right now the way I am doing it is , take the backup and importing whatever the database objects I wanted to

Re: [GENERAL] moving database objects from one schema to other

2010-10-28 Thread Pavel Stehule
2010/10/28 akp geek akpg...@gmail.com: Hi all -               I would like to know if there is any other way of moving objects from one schema to other schema? right now the way I am doing it is , take the backup and importing whatever the database objects I wanted to move, I am doing that

Re: [GENERAL] PostGIS return multiple points

2010-10-28 Thread Szymon Guz
On 28 October 2010 10:00, trevor1940 anto...@nsom.org.uk wrote: Hi I have a PostGIS table and I wish to get the location/name of multiple points at once the command for selecting one point is select PolyName from MyPolygones where st_Contains(the_geom, GeomFromText('point($LAT

Re: [GENERAL] moving database objects from one schema to other

2010-10-28 Thread akp geek
Thanks a lot. Regards On Thu, Oct 28, 2010 at 12:23 PM, Pavel Stehule pavel.steh...@gmail.comwrote: 2010/10/28 akp geek akpg...@gmail.com: Hi all - I would like to know if there is any other way of moving objects from one schema to other schema? right now the way I am doing

Re: [GENERAL] exceptionally large UPDATE

2010-10-28 Thread Ivan Sergio Borgonovo
On Thu, 28 Oct 2010 08:58:34 -0400 Vick Khera vi...@khera.org wrote: On Wed, Oct 27, 2010 at 10:26 PM, Ivan Sergio Borgonovo m...@webthatworks.it wrote: I'm increasing maintenance_work_mem to 180MB just before recreating the gin index. Should it be more? You can do this on a

[GENERAL] share lock when only one user connected?

2010-10-28 Thread Ivan Sergio Borgonovo
I'm running this query when I'm the only user and this should be the only thing running. update catalog_items set Code=s.codice, CodeAlt=s.codicealt, BrandID=s.marca, Name=initcap(s.nome), Description=s.desc_l1, qty=coalesce(s.quantita, 0), ListPrice=coalesce(s.prezzoListino, 0) ,

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-28 Thread A.M.
On Oct 28, 2010, at 12:04 PM, Daniel Verite wrote: A.M. wrote: In PostgreSQL, query canceling is implemented by opening a second connection and passing specific data which is received from the first connection With libpq's PQCancel(), a second connection is not necessary. To

Re: [GENERAL] share lock when only one user connected?

2010-10-28 Thread Tom Lane
Ivan Sergio Borgonovo m...@webthatworks.it writes: I'm running this query when I'm the only user and this should be the only thing running. And I get DETAIL: Process 7188 waits for ShareLock on transaction 110562621; blocked by process 7244. Process 7244 waits for ShareLock on transaction

Re: [GENERAL] How to merge data from two separate databases into one (maybe using xlogs)?

2010-10-28 Thread John R Pierce
On 10/28/10 7:49 AM, daniel.cre...@l-3com.com wrote: Unfortunately, I need to replicate DDLs, therefore Bucardo is not an option. I was thinking about having a way to replay xlogs from different servers into one, to have all data. I just don't know if it's possible. Anybody knows? you want

Re: [GENERAL] share lock when only one user connected?

2010-10-28 Thread Ivan Sergio Borgonovo
On Thu, 28 Oct 2010 13:57:18 -0400 Tom Lane t...@sss.pgh.pa.us wrote: Ivan Sergio Borgonovo m...@webthatworks.it writes: I'm running this query when I'm the only user and this should be the only thing running. And I get DETAIL: Process 7188 waits for ShareLock on transaction

[GENERAL] Full Text Search - Slow on common words

2010-10-28 Thread sub3
Hi, I have a small web page set up to search within my domain based on keywords. One of the queries is: SELECT page.id ts_rank_cd('{1.0, 1.0, 1.0, 1.0}',contFTI,q) FROM page, to_tsquery('steve') as q WHERE contFTI @@ q My problem is: when someone puts in a commonly seen word, the

Re: [GENERAL] Full Text Search - Slow on common words

2010-10-28 Thread Reid Thompson
On Thu, 2010-10-28 at 12:08 -0700, sub3 wrote: Hi, I have a small web page set up to search within my domain based on keywords. One of the queries is: SELECT page.id ts_rank_cd('{1.0, 1.0, 1.0, 1.0}',contFTI,q) FROM page, to_tsquery('steve') as q WHERE contFTI @@ q My problem

Re: [GENERAL] How to merge data from two separate databases into one (maybe using xlogs)?

2010-10-28 Thread Daniel . Crespo
you want multimaster replication WITH multimaster DDL changes? wow. how do you resolve conflicts? I don't know how to get to that point yet. The question is: Can I use xlogs from two different servers and replay them all in one? Depending on how it is done, I can tell you how would I

Re: [GENERAL] Full Text Search - Slow on common words

2010-10-28 Thread Dann Corbit
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Reid Thompson Sent: Thursday, October 28, 2010 12:57 PM To: st...@subwest.com Cc: Reid Thompson; pgsql-general@postgresql.org Subject: Re: [GENERAL] Full Text Search - Slow on common words On Thu,

Re: [GENERAL] How to merge data from two separate databases into one (maybe using xlogs)?

2010-10-28 Thread John R Pierce
On 10/28/10 12:55 PM, daniel.cre...@l-3com.com wrote: you want multimaster replication WITH multimaster DDL changes? wow. how do you resolve conflicts? I don't know how to get to that point yet. The question is: Can I use xlogs from two different servers and replay them all in one?

[GENERAL] Replication Poll

2010-10-28 Thread Joshua D. Drake
Hey, Based on the discussion here: http://www.commandprompt.com/blogs/joshua_drake/2010/10/users_versus_customers_-_you_dont_need_no_stinking_replication/ http://thebuild.com/blog/2010/10/28/small-postgresql-installations-and-9-0-replication/

[GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Scott Newton
Hi I have the following rather complicated SQL which works under MySQL but fails under PostgreSQL 8.3. The SQL is generated by A2Billing (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the following part of the SQL: as tf on tf.dnid=substr(cdr.dnid,1,length(tf.dnid)) where

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Scott Marlowe
On Thu, Oct 28, 2010 at 6:44 PM, Scott Newton scott.new...@vadacom.co.nz wrote: Hi I have the following rather complicated SQL which works under MySQL but fails under PostgreSQL 8.3. The SQL is generated by A2Billing (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Dann Corbit
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Scott Marlowe Sent: Thursday, October 28, 2010 6:31 PM To: Scott Newton Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] MySQL - PostgreSQL conversion issue

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Tom Lane
Scott Newton scott.new...@vadacom.co.nz writes: I have the following rather complicated SQL which works under MySQL but fails under PostgreSQL 8.3. The SQL is generated by A2Billing (http://www.asterisk2billing.org/cgi-bin/trac.cgi). The issue is the following part of the SQL: as tf on

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Scott Newton
On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote: [ blanch... ] That's not the worst SQL code I've ever seen, but it might be in the top ten. They're apparently trying to see whether tf.dnid, taken as a string, matches a prefix of cdr.dnid --- but what if you have say 123 versus 1234foo? This

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Alex Hunsaker
On Thu, Oct 28, 2010 at 20:02, Scott Newton scott.new...@vadacom.co.nz wrote: On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote: Anyway, you've got two different typing violations there, so you need two casts to fix it: Unfortunately not: from cc_call cdr left join cc_card cc on cdr.card_id=cc.id

[GENERAL] Can Postgres Not Do This Safely ?!?

2010-10-28 Thread Karl Pickett
Hello Postgres Hackers, We have a simple 'event log' table that is insert only (by multiple concurrent clients). It has an integer primary key. We want to do incremental queries of this table every 5 minutes or so, i.e. select * from events where id LAST_ID_I_GOT to insert into a separate

[GENERAL] Adivice on master - master replication.

2010-10-28 Thread Gregory Machin
Hi I'm new to Posgresql. I have been requested to setup application level HA. The picture is, I will have 2 web servers behind 2 new work load balancers, so should one fail the NLB's will redirect traffic to the remaining server. I need a similar scenario for the Pgsql servers. From my reading I

Re: [GENERAL] Adivice on master - master replication.

2010-10-28 Thread Shoaib Mir
On Fri, Oct 29, 2010 at 9:42 AM, Gregory Machin g...@linuxpro.co.za wrote: From my reading I need a synchronise master - master. so both servers need to be hot. Such that the web servers are unaware of which server the are communicating with, so should one pgsql server go down there would

[GENERAL] How to Convert Integer to Serial

2010-10-28 Thread venkat
Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let me know. Thanks and Regards, Ven

Re: [GENERAL] How to Convert Integer to Serial

2010-10-28 Thread venkat
Dear All, I got the solution... Here is my query ALTER TABLE DemoTable ALTER gid TYPE INT2; Thanks again On Fri, Oct 29, 2010 at 10:18 AM, venkat ven.tammin...@gmail.com wrote: Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let me know.

Re: [GENERAL] Adivice on master - master replication.

2010-10-28 Thread John R Pierce
On 10/28/10 3:42 PM, Gregory Machin wrote: Hi I'm new to Posgresql. I have been requested to setup application level HA. The picture is, I will have 2 web servers behind 2 new work load balancers, so should one fail the NLB's will redirect traffic to the remaining server. I need a similar

Re: [GENERAL] [SQL] How to Convert Integer to Serial

2010-10-28 Thread Shoaib Mir
On Fri, Oct 29, 2010 at 3:48 PM, venkat ven.tammin...@gmail.com wrote: Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let me know. I don't think ALTER TABLE will let you do that... so the best way to achieve the same is: - Create a sequence for

Re: [GENERAL] [SQL] How to Convert Integer to Serial

2010-10-28 Thread Shoaib Mir
On Fri, Oct 29, 2010 at 3:58 PM, venkat ven.tammin...@gmail.com wrote: Dear All, I got the solution... Here is my query ALTER TABLE DemoTable ALTER gid TYPE INT2; Are you sure that you have converted here to a SERIAL type? -- Shoaib Mir http://shoaibmir.wordpress.com/

Re: [GENERAL] [SQL] How to Convert Integer to Serial

2010-10-28 Thread venkat
ohhh,, sorry... It was wrong post..sorry again... On Fri, Oct 29, 2010 at 10:30 AM, Shoaib Mir shoaib...@gmail.com wrote: On Fri, Oct 29, 2010 at 3:48 PM, venkat ven.tammin...@gmail.com wrote: Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let

Re: [GENERAL] How to Convert Integer to Serial

2010-10-28 Thread John R Pierce
On 10/28/10 9:48 PM, venkat wrote: Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let me know. SERIAL is not actually a data type, its simply an integer with an associated sequence.what Shoab Mir gave will add this sequence to the existing

Re: [GENERAL] [SQL] How to Convert Integer to Serial

2010-10-28 Thread Shoaib Mir
On Fri, Oct 29, 2010 at 4:05 PM, venkat ven.tammin...@gmail.com wrote: ALTER TABLE Demotable ALTER COLUMN gid SET DEFAULT nextval('serial'::regclass); It is saying that ..serial does not exist...is that true ? Please avoid sending emails to the personal email addresses but use the

Re: [GENERAL] [SQL] How to Convert Integer to Serial

2010-10-28 Thread venkat
Yes Done... Thanks alot... On Fri, Oct 29, 2010 at 10:40 AM, Shoaib Mir shoaib...@gmail.com wrote: On Fri, Oct 29, 2010 at 4:05 PM, venkat ven.tammin...@gmail.com wrote: ALTER TABLE Demotable ALTER COLUMN gid SET DEFAULT nextval('serial'::regclass); It is saying that ..serial does