[GENERAL] Question about switchover with PG9 replication

2011-02-07 Thread Jean-Armel Luce
Hello, I have a few questions about streaming replication. We have a database of nearly 300 GB. We are using Postgres 8.3.1 and Slony for replication on Ubuntu 10.04. We have 4 Postgres servers PGMaster1, PGSlave1, PGMaster2 and PGSlave2 on 2 distant sites (distance between the 2 sites is

[GENERAL] Very slow moving between partition

2011-02-07 Thread Mario Medina
Hi! I have a big table with about 26 millon registers, and I have 3 partitions, one that handles daily information, only one register per day for about 24,000 elements, that's it about 24,000 register daily, other one that handles one register per minute per day, only 8 hours a day, for about 9000

Re: [GENERAL] Question about switchover with PG9 replication

2011-02-07 Thread Wouter D'Haeseleer
Question 1 : is it possible to have such a replication configuration with the streaming replication of PG9 (cascaded replication) ? Nope, as far as I have tested pg only has 1 master and can have a number of slaves, so having 2 masters is not possible. Question 2 : All the

Re: [HACKERS] [GENERAL] Issues with generate_series using integer boundaries

2011-02-07 Thread Itagaki Takahiro
On Fri, Feb 4, 2011 at 21:32, Thom Brown t...@linux.com wrote: The issue is that generate_series will not return if the series hits either the upper or lower boundary during increment, or goes beyond it.  The attached patch fixes this behaviour, but should probably be done a better way.  The

Re: [HACKERS] [GENERAL] Issues with generate_series using integer boundaries

2011-02-07 Thread Thom Brown
On 7 February 2011 09:04, Itagaki Takahiro itagaki.takah...@gmail.com wrote: On Fri, Feb 4, 2011 at 21:32, Thom Brown t...@linux.com wrote: The issue is that generate_series will not return if the series hits either the upper or lower boundary during increment, or goes beyond it.  The attached

[GENERAL] XML Encoding problem

2011-02-07 Thread rsmogura
Hi, I have test database with UTF-8 encoding. I putted there XML aЁĄ¡/a, (U+0401, U+0104, U+00A1). I changed client encoding to iso8859-2, as the result of select I got ERROR: character 0xd081 of encoding UTF8 has no equivalent in LATIN2 Stan SQL:22P05. I should got result with characters

Re: [GENERAL] Subquery for column names of tablefunc crosstab queries

2011-02-07 Thread markw
Thanks Joe I'm very much learning as I go. I've followed your example from top to bottom - your sample code works - however its not clear to me how to execute the generate_crosstab_sql function to produce the results in one single step. I've tried this: CREATE OR REPLACE VIEW

[GENERAL] How to create index on only some of the rows

2011-02-07 Thread A B
Hello. How do you create an index for only some of the rows in a table? I read in the docs: The expression used in the WHERE clause can refer only to columns of the underlying table, but it can use all columns, not just the ones being indexed. Presently, subqueries and aggregate expressions are

[GENERAL] Slow Inserts, two different scenarios.

2011-02-07 Thread Andre Lopes
Hi, I have a problem when doing INSERT's in a table. The table structure is: uri (varchar 1) PK id_language (varchar 10) PK id_category (int4) PK id_data (varchar 50) PK id_ordinal (int4) PK (this field have a trigger to auto increment) n_text (text) When I run this function to do 90

Re: [GENERAL] tuning postgresql writes to disk

2011-02-07 Thread Vick Khera
On Thu, Feb 3, 2011 at 7:08 PM, Vinubalaji Gopal vinubal...@gmail.com wrote: already does this.  I looked at the WAL parameters and the new async commit  but not sure if I am looking at the right place. Say i have 10 clients connecting and each client is inserting a record. I want to You want

Re: [GENERAL] Directing Partitioned Table Searches

2011-02-07 Thread Vick Khera
On Fri, Feb 4, 2011 at 7:35 PM, Bill Thoen bth...@gisnet.com wrote: And this selection will result in ALL partitions being searched. But why? SELECT cluid, farmid FROM clu JOIN farms ON ogc_fid=link WHERE state=zone The constraint exclusion code does not execute your constraints to decide

Re: [GENERAL] Why copy ... from stdio does not return immediately when reading invalid data?

2011-02-07 Thread Nicolas Grilly
I have analyzed the PostgreSQL protocol using Wireshark (an open source packet analyzer), and I observed that the PostgreSQL backend, while doing a COPY ... FROM STDIN, reports errors as soon as possible (especially errors related to invalid data). Therefore, the late reporting of errors while

Re: [GENERAL] Question about switchover with PG9 replication

2011-02-07 Thread Andrew Sullivan
On Mon, Feb 07, 2011 at 09:20:36AM +0100, Jean-Armel Luce wrote: Is it possible to do switchover between sites (between PGMaster1 and PGMaster2) whithout copying all the database from the new PG master to the new PG slave ? You can't do database replication without copying the whole database,

Re: [GENERAL] How to create index on only some of the rows

2011-02-07 Thread Vibhor Kumar
On Feb 7, 2011, at 11:00 PM, A B wrote: So until this changes, can you just add a boolean field to tell if the column should be used in the index, and then run create index where use_in_index = true or are there other (better?) ways of doing this? If you want you can do that Or You

Re: [GENERAL] How to create index on only some of the rows

2011-02-07 Thread Andrew Sullivan
On Mon, Feb 07, 2011 at 03:00:54PM +0100, A B wrote: So until this changes, can you just add a boolean field to tell if the column should be used in the index, and then run create index where use_in_index = true or are there other (better?) ways of doing this? What are the criteria for

[GENERAL] fulltext search and hunspell

2011-02-07 Thread Jens Sauer
Hey, I want to use hunspell as a dictionary for the full text search by * using PostgresSQL 8.4.7 * installing hunspell-de-de, hunspell-de-med * creating a dictionary: CREATE TEXT SEARCH DICTIONARY german_hunspell ( TEMPLATE = ispell, DictFile = de_de, AffFile = de_de, StopWords

[GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread akp geek
Hi All - I am trying to install postgis 1.5.2 on solaris10. When I run the configure I get the following. *configure: WARNING: could not locate CUnit required for liblwgeom unit tests* is there some setting I need to do to make it work? $./configure

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread Paul Ramsey
It's just a warning, continue happily onwards. Just means a few unit tests won't be run. P. On 2011-02-07, at 9:27 AM, akp geek wrote: Hi All - I am trying to install postgis 1.5.2 on solaris10. When I run the configure I get the following. configure: WARNING:

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread akp geek
installation was successful. But it did not install the liblwgeom.so Regards On Mon, Feb 7, 2011 at 12:29 PM, Paul Ramsey pram...@cleverelephant.cawrote: It's just a warning, continue happily onwards. Just means a few unit tests won't be run. P. On 2011-02-07, at 9:27 AM, akp geek wrote:

Re: [GENERAL] Additional Grants To SuperUser?

2011-02-07 Thread Carlos Mennens
On Fri, Feb 4, 2011 at 5:08 PM, Dmitriy Igrishin dmit...@gmail.com wrote: These all (SUPERUSER, CREATEDB, SUPERUSER) are role attributes. By performing ALTER ROLE postgres NOSUPERUSER it is possible to turn role with a superuser status into a role that just can create databases and manage

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread akp geek
Please pardon my ignorance. The reason I am worried about it is, when I tried to use pg_upgrade to migrate from 8.3 to 9.0.2. I am getting an error Failed to load library: $libdir/liblwgeom ERROR: could not access file $libdir/liblwgeom: No such file or directory I am using pg_upgrade for

Re: [GENERAL] Directing Partitioned Table Searches

2011-02-07 Thread Bill Thoen
Vick Khera wrote: Your best bet is to know which partition you need and write your query that way dynamically, rather than trying to use a generic query and have the DB do the constraint exclusion. In your above case, if you know that 'zone' will limit you to just the MI table, then specify the

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread Paul Ramsey
Well, maybe you could in-place upgrade if you left your PostGIS version at the original and only upgraded the PostgreSQL part, but you aren't doing that, you're also upgrading your PostGIS version. pg_dump the database create a new database on the new server, install postgis in it pg_restore

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread Paul Ramsey
I'm not sure you can in-place upgrade a postgis database... On 2011-02-07, at 9:49 AM, akp geek wrote: Please pardon my ignorance. The reason I am worried about it is, when I tried to use pg_upgrade to migrate from 8.3 to 9.0.2. I am getting an error Failed to load library:

[GENERAL] Maintenance commands on standby servers

2011-02-07 Thread Sylvain Rabot
Hi, Is it possible to run maintenance commands like ANALYZE, VACUUM, CLUSTER on a standby server ? The documentations says that those operations can not be done in recovery mode, but that some of these commands are actually allowed during read only mode transactions on the primary [1]. [1]

Re: [GENERAL] Directing Partitioned Table Searches

2011-02-07 Thread Vick Khera
On Mon, Feb 7, 2011 at 1:17 PM, Bill Thoen bth...@gisnet.com wrote: Thanks. That sounds simple enough. Since I want to automate this, I guess the next step is to learn how to create and  execute a dynamic query.  I think I know how to do that. In perl, it looks something like this: $part =

Re: [GENERAL] postgis 1.5.2 installation configure: WARNING: could not locate CUnit required for liblwgeom unit tests

2011-02-07 Thread Edoardo Panfili
On 07/02/11 18.55, Paul Ramsey wrote: Well, maybe you could in-place upgrade if you left your PostGIS version at the original and only upgraded the PostgreSQL part, but you aren't doing that, you're also upgrading your PostGIS version. pg_dump the database create a new database on the new

Re: [GENERAL] Very slow moving between partition

2011-02-07 Thread Vincent Veyron
Le lundi 07 février 2011 à 02:42 -0600, Mario Medina a écrit : That works good with small number of records, but if I have 300,000 records it can take a lot of time to move that records. well, that's a lot of records to move. I would guess you are I/O bound with your present disks, and

[GENERAL] PgEast: 2011, CFP closes in three days

2011-02-07 Thread Joshua D. Drake
Hello hackers, Just FYI, the CFP for PgEast in NYC closes in three days. https://www.postgresqlconference.org/talk_types Sincerely, JD -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development,

Re: [GENERAL] fulltext search and hunspell

2011-02-07 Thread Oleg Bartunov
Jens, could you check affix file for compoundwords controlled z also, can you provide link to dictionary files, so we can check if they supported, since we have only rudiment support of hunspell. btw,it'd be nice to have output from ts_debug() to make sure dictionaries actually used. Oleg On

[GENERAL] SELECT INTO array[i] with PL/pgSQL

2011-02-07 Thread Julia Jacobson
Dear PostgreSQL community, Please consider the following minimal example: CREATE TABLE example (row_id SERIAL, value TEXT); INSERT INTO example(value) VALUES ('val1'); INSERT INTO example(value) VALUES ('val2'); INSERT INTO example(value) VALUES ('val3'); CREATE OR REPLACE FUNCTION foo()

Re: [GENERAL] SELECT INTO array[i] with PL/pgSQL

2011-02-07 Thread Edoardo Panfili
On 07/02/11 22.15, Julia Jacobson wrote: Dear PostgreSQL community, Please consider the following minimal example: CREATE TABLE example (row_id SERIAL, value TEXT); INSERT INTO example(value) VALUES ('val1'); INSERT INTO example(value) VALUES ('val2'); INSERT INTO example(value) VALUES

[GENERAL] How to improve this query?

2011-02-07 Thread Jorge Arévalo
Hello, update TABLE_A set INT_FIELD = TABLE_B.INT_FIELD from TABLE_C, TABLE_B where TABLE_B.STR_FIELD = TABLE_C.STR_FIELD and TABLE_A.INT_FIELD2 = TABLE_B.min and TABLE_A.INT_FIELD2 = TABLE_B.max and st_intersects(TABLE_A.wkb_geometry, TABLE_C.the_geom); Tables description: TABLE A

Re: [GENERAL] fulltext search and hunspell

2011-02-07 Thread Jens Sauer
Hey, thanks for your answer. First I checked the links in the tsearch_data directory de_de.affix, and de_de.dict are symlinks to the corresponding files in /var/cache/postgresql/dicts/ Then I recreated them by using pg_updatedicts. This is an extract of the de_de.affix file: # this is the

[GENERAL] reindexing

2011-02-07 Thread akp geek
Hi all - I ran query this morning, I got a wrong results. I have run the same query in an other environment with same data and I got the result set I was expecting. After that I did a re index and on the table I was getting incorrect results, the data then came out fine,

Re: [GENERAL] reindexing

2011-02-07 Thread Alex Hunsaker
On Mon, Feb 7, 2011 at 17:12, akp geek akpg...@gmail.com wrote: Hi all -         I ran query this morning, I got a wrong results. I have run the same query in an other environment with same data and I got the result set I was expecting.        After that I did a re index and on the table I

Re: [GENERAL] reindexing

2011-02-07 Thread akp geek
thanks.. the index I was having is gist on a to_tsvector column . version we have is 8.3 On Mon, Feb 7, 2011 at 7:23 PM, Alex Hunsaker bada...@gmail.com wrote: On Mon, Feb 7, 2011 at 17:12, akp geek akpg...@gmail.com wrote: Hi all - I ran query this morning, I got a wrong results. I

Re: [GENERAL] reindexing

2011-02-07 Thread Alex Hunsaker
On Mon, Feb 7, 2011 at 17:28, akp geek akpg...@gmail.com wrote: thanks.. the index I was having is gist on a to_tsvector column . version we have is 8.3 What minor version? I sounds like you _could_ be hitting any of the below: - (8.3.14) Fix detection of page splits in temporary GiST indexes

Re: [GENERAL] tuning postgresql writes to disk

2011-02-07 Thread Vinubalaji Gopal
Thank you. I will try to run some performance tests using the async commit option. Is there an easy way to find the lost transactions or does it have to be handled by the application? On Mon, Feb 7, 2011 at 6:23 AM, Vick Khera vi...@khera.org wrote: On Thu, Feb 3, 2011 at 7:08 PM, Vinubalaji

[GENERAL] index for ilike operation

2011-02-07 Thread AI Rumman
I found that in Postresql 9.0.3 documentation: *It is also possible to use B-tree indexes for ILIKE and ~*, but only if the pattern starts with non-alphabetic characters, i.e., characters that are not affected by upper/lower case conversion. *Can anyone please tell me how to configure that?* *

Re: [GENERAL] index for ilike operation

2011-02-07 Thread John R Pierce
On 02/07/11 9:07 PM, AI Rumman wrote: I found that in Postresql 9.0.3 documentation: /It is also possible to use B-tree indexes for ILIKE and ~*, but only if the pattern starts with non-alphabetic characters, i.e., characters that are not affected by upper/lower case conversion. /Can anyone