Re: [GENERAL] I need to load mysql dump to postgres...

2011-10-12 Thread Devrim GÜNDÜZ
On Tue, 2011-10-11 at 22:37 -0400, unclebob wrote: Is there a program which would just parse mysql dump file and load data to postgresql using plain sql inserts? EDB has an open source and free tool for this: http://www.enterprisedb.com/migrationwizard-11 If you are using RPM based distros,

Re: [GENERAL] [postgis-users] Query slow down, never completes

2011-10-12 Thread Andreas Forø Tollefsen
Yes, I did a version of the query where i terminated the connection in the loop after one year, and then reconnected to the server for each year in the query. This did not change anything, and the query still halted on the same year. Like this: # For each year calculate the distance to border and

[GENERAL] How to make replica and use it when master is down ?

2011-10-12 Thread Condor
Hello everyone, from a few days I want to ask how to make replica server of my database and when spontaneously my master server going down due to loosing power or has been offline more then 5 min, replica server to become master server and accept all querys to database like select, insert,

Re: [GENERAL] Drill-downs and OLAP type data

2011-10-12 Thread Ondrej Ivanič
Hi, On 12 October 2011 14:50, Anthony Presley anth...@resolution.com wrote: After a few weeks of searching around, we're running into dead-ends on the front-end, and the back-end.  PG doesn't support OLAP / MDX and the GUI tools that do this, for the most part, require MDX / OLAP (SPSS

[GENERAL] Using constraint exclusion with 2 floats

2011-10-12 Thread Julien Rouhaud
Hi everyone, Is there an easy way (that I maybe missed) to use constraint exclusion with 2 floats ? Must I find an extension the temporal extension which create a new type with 2 timestamp or can I usethe operator with 2 fields ? Thank you

[GENERAL] Conceptual Architecture

2011-10-12 Thread Sarma Chavali
Hi Guys, We are new to PostgresSQL and in the process of learning. Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? Thanks Sarma

[GENERAL] how to key/value iterate in stored function

2011-10-12 Thread J.V.
I want to create a variable that is an array or list of key/value pairs. The key would be a table name and the value would be a sql statement or a value or list of values for which I could extract to create a sql statement and execute. I have tried experimenting with various arrays, but

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread Chris Travers
On Wed, Oct 12, 2011 at 6:46 AM, J.V. jvsr...@gmail.com wrote: I want to create a variable that is an array or list of key/value pairs. The key would be a table name and the value would be a sql statement or a value or list of values for which I could extract to create a sql statement and

[GENERAL] Monitoring Replication

2011-10-12 Thread Brandon Phelps
Hello all, I use Nagios to monitor various things on a few servers and have recently set up a hot-standby server and would obviously like to include the state of streaming replication in my monitoring. I know about the pg_stat_replication view on the master and the

[GENERAL] Conceptual Architecture

2011-10-12 Thread Sarma Chavali
Hi Guys, We are new to PostgresSQL and in the process of learning. Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? Thanks Sarma

Re: [GENERAL] Conceptual Architecture

2011-10-12 Thread Chris Travers
On Wed, Oct 12, 2011 at 1:50 AM, Sarma Chavali cbssa...@googlemail.com wrote: Hi Guys, We are new to PostgresSQL and in the process of learning. Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? I don't know what you mean by

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread Merlin Moncure
On Wed, Oct 12, 2011 at 8:46 AM, J.V. jvsr...@gmail.com wrote: I want to create a variable that is an array or list of key/value pairs. The key would be a table name and the value would be a sql statement or a value or list of values for which I could extract to create a sql statement and

Re: [GENERAL] Conceptual Architecture

2011-10-12 Thread Andy Colson
On 10/12/2011 3:50 AM, Sarma Chavali wrote: Hi Guys, We are new to PostgresSQL and in the process of learning. Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? Thanks Sarma Ahh, odd question. Have you read the fine online

Re: [GENERAL] Conceptual Architecture

2011-10-12 Thread John R Pierce
On 10/12/11 4:08 AM, Sarma Chavali wrote: Hi Guys, We are new to PostgresSQL and in the process of learning. Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? http://www.postgresql.org/docs/current/static/tutorial-arch.html

Re: [GENERAL] Drill-downs and OLAP type data

2011-10-12 Thread Anthony Presley
2011/10/12 Ondrej Ivanič ondrej.iva...@gmail.com Hi, On 12 October 2011 14:50, Anthony Presley anth...@resolution.com wrote: After a few weeks of searching around, we're running into dead-ends on the front-end, and the back-end. PG doesn't support OLAP / MDX and the GUI tools

Re: [GENERAL] Drill-downs and OLAP type data

2011-10-12 Thread Anthony Presley
2011/10/12 Filip Rembiałkowski plk.zu...@gmail.com Mondrian (which is a part of Pentaho BI stack) is an open source OLAP engine with MDX. See http://community.pentaho.com/projects/bi_platform/ Thanks ... we're familiar with Mondrian. Unfortunately, the only stable GUI for it under $30k is

Re: [GENERAL] how to save primary key constraints

2011-10-12 Thread Merlin Moncure
On Tue, Oct 11, 2011 at 6:37 PM, Chris Travers chris.trav...@gmail.com wrote: On Tue, Oct 11, 2011 at 4:33 PM, Raymond O'Donnell r...@iol.ie wrote: On 12/10/2011 00:24, J.V. wrote: pg_catalog table does not exist. It's not a table, it's PostgreSQL's version of the information_schema

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread J.V.
I tried hstore with no luck. How do I initialize the array? How do I loop through each key/value pair in a stored function to retrieve the key and value for each item in the list? I need a list of key value pairs. Any options there? J.V. On 10/12/2011 8:51 AM, Merlin Moncure wrote: On

[GENERAL] how to list or array of key value pairs

2011-10-12 Thread J.V.
I need to rephrase this because of some confusion as to what I was looking for. I want to create and initialize a list or array of key/value pairs. Then I want to iterate through this list (or array) retrieving each key/value for use in a sql statement. I want to do this in a stored

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread David Johnston
On Oct 12, 2011, at 14:43, J.V. jvsr...@gmail.com wrote: I tried hstore with no luck. How do I initialize the array? How do I loop through each key/value pair in a stored function to retrieve the key and value for each item in the list? I need a list of key value pairs. Any options

[GENERAL] psql died in midst of session

2011-10-12 Thread Rich Shepard
This has not happened before to me. I'm running postgres-9.0.4 on Slackware-13.1. I've been working on the command line using the psql shell updating and fixing a table when the application failed on me: PANIC: could not open file pg_xlog/00010046 (log file 0, segment 70):

Re: [GENERAL] psql died in midst of session [FIXED]

2011-10-12 Thread Rich Shepard
On Wed, 12 Oct 2011, Rich Shepard wrote: Please advise me how to recover from whatever happened so I can get postgres up and running again. Fixed. I noticed that the referenced pg_log/ file was owned by root.root rather than by postgres.users so I chown and that did the trick. Strange.

[GENERAL] PostGIS: Approximating a house number from street address range

2011-10-12 Thread René Fournier
Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction and address ranges for both sides of the street. I'm now trying to figure out the best way to programmatically approximate the nearest

Re: [GENERAL] Monitoring Replication

2011-10-12 Thread Mahlon E. Smith
On Wed, Oct 12, 2011, Brandon Phelps wrote: I use Nagios to monitor various things on a few servers and have recently set up a hot-standby server and would obviously like to include the state of streaming replication in my monitoring. [...] The confusion I have is how exactly can I

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread J.V.
I tried that, but it did not work. what i am looking for is a means to iterate over an array or list fetching both the key and the value. if you have such an example, it would be appreciated. Create a custom type with two text components and use that in an array. David J. On 10/12/2011

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Bob Hatfield
Should replication cause corruption on the secondary when stopping/starting the primary? I wasn't aware 8.3 had any built in replication?  what sort of replication add-ons are you using? Continuous archiving / WAL shipping as described in:

Re: [GENERAL] Using constraint exclusion with 2 floats

2011-10-12 Thread Simon Riggs
On Wed, Oct 12, 2011 at 10:16 AM, Julien Rouhaud rjuju...@gmail.com wrote: Hi everyone, Is there an easy way (that I maybe missed) to use constraint exclusion with 2 floats ? Must I find an extension the temporal extension which create a new type with 2 timestamp or can I usethe operator

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Simon Riggs
On Tue, Oct 11, 2011 at 12:12 AM, Bob Hatfield bobhatfi...@gmail.com wrote: Should replication cause corruption on the secondary when stopping/starting the primary?  (pg 8.3.12, windows 2008 R2 on both servers) No, it shouldn't. Any duplicate keys would represent a serious error. It sounds

[GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Bob Hatfield
Is it possible to do a full file system level backup of the data directory, say once a week, and differentials or incrementals daily? I'm wondering if there are files that would normally be removed that a restore: Full then diff/inc would not remove and perhaps corrupt/confuse things. Process:

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Bob Hatfield
Should replication cause corruption on the secondary when stopping/starting the primary? I wasn't aware 8.3 had any built in replication?  what sort of replication add-ons are you using? Continuous archiving / WAL shipping as described in:

Re: [GENERAL] Using constraint exclusion with 2 floats

2011-10-12 Thread Julien Rouhaud
Thank you for your answer. I'm sorry I really didn't explained well my problem :/ For example if I have a table test like this : CREATE TABLE test (min real not null, max real not null, desc character varying not null); and I want a constraint exclusion to make sure the range min/max doens't

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Julien Rouhaud
As there's one file for each object, a single update on each would make you to copy the all the file again. I heard there was tool to make differentiel copy of a part of a file but I don't know if it's really efficient. Anyway, a better way for you would be to do a regular backup (with

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Bob Hatfield
Should replication cause corruption on the secondary when stopping/starting the primary?  (pg 8.3.12, windows 2008 R2 on both servers) No, it shouldn't. Any duplicate keys would represent a serious error. It sounds like you're using warm standby, but when you say run pg_start_backup() AFTER

Re: [GENERAL] Drill-downs and OLAP type data

2011-10-12 Thread Ondrej Ivanič
Hi, The *problem* with Greenplum is that it's ultra-expensive once you leave the CE version - and you're not supposed to be using the CE version for commercial usage last I read the license.  Has that changed? Not sure. I haven't seen something like that in the license. After POC we bought HW

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Simon Riggs
On Wed, Oct 12, 2011 at 10:51 PM, Bob Hatfield bobhatfi...@gmail.com wrote: Should replication cause corruption on the secondary when stopping/starting the primary?  (pg 8.3.12, windows 2008 R2 on both servers) No, it shouldn't. Any duplicate keys would represent a serious error. It sounds

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Bob Hatfield
Anyway, a better way for you would be to do a regular backup (with pg_start_backup, copy and pg_stop_backup) and then use wal archive_command to keep the xlogs between 2 full backups. Thanks Julien. Can pg_start/stop_backup() be used for regular full file system backups? All of the

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-12 Thread Bob Hatfield
Something about your setup is suspect. Disks perhaps. Disk: Fusion IOdrive (1.2TB NAND drive) I've read that one should set wal_sync_method=fsync_writethrough for Windows servers. It's currently set to open_datasync, I have no idea what effect that will have other than I've read less

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Julien Rouhaud
On Thu, Oct 13, 2011 at 12:04 AM, Bob Hatfield bobhatfi...@gmail.comwrote: Anyway, a better way for you would be to do a regular backup (with pg_start_backup, copy and pg_stop_backup) and then use wal archive_command to keep the xlogs between 2 full backups. Thanks Julien. Can

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Alan Hodgson
On October 12, 2011 03:04:30 PM Bob Hatfield wrote: Anyway, a better way for you would be to do a regular backup (with pg_start_backup, copy and pg_stop_backup) and then use wal archive_command to keep the xlogs between 2 full backups. Thanks Julien. Can pg_start/stop_backup() be used

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-12 Thread Bob Hatfield
The base backup necessary to initialize a warm standby server is a full file system backup of the database, which can also be used for restores to any point in time after the base backup is completed, assuming you also have all the archived WAL files. Thanks to both of you. I currently

Re: [GENERAL] how to key/value iterate in stored function

2011-10-12 Thread Merlin Moncure
On Wed, Oct 12, 2011 at 1:43 PM, J.V. jvsr...@gmail.com wrote: I tried hstore with no luck. How do I initialize the array? How do I loop through each key/value pair in a stored function to retrieve the key and value for each item in the list? I need a list of key value pairs.  Any options

Re: [GENERAL] PostGIS: Approximating a house number from street address range

2011-10-12 Thread Andy Colson
On 10/12/2011 01:01 PM, René Fournier wrote: Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction and address ranges for both sides of the street. I'm now trying to figure out the best

Re: [GENERAL] PostGIS: Approximating a house number from street address range

2011-10-12 Thread Andy Colson
On 10/12/2011 06:29 PM, Andy Colson wrote: On 10/12/2011 01:01 PM, René Fournier wrote: Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction and address ranges for both sides of the

Re: [GENERAL] PostGIS: Approximating a house number from street address range

2011-10-12 Thread Andy Colson
On 10/12/2011 06:29 PM, Andy Colson wrote: On 10/12/2011 01:01 PM, René Fournier wrote: Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction and address ranges for both sides of the

Re: [GENERAL] PostGIS: Approximating a house number from street address range

2011-10-12 Thread Andy Colson
On 10/12/2011 06:38 PM, Andy Colson wrote: On 10/12/2011 06:29 PM, Andy Colson wrote: On 10/12/2011 01:01 PM, René Fournier wrote: Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction

Re: [GENERAL] I need to load mysql dump to postgres...

2011-10-12 Thread unclebob
On 10/12/2011 03:45 AM, Devrim GÜNDÜZ wrote: On Tue, 2011-10-11 at 22:37 -0400, unclebob wrote: Is there a program which would just parse mysql dump file and load data to postgresql using plain sql inserts? EDB has an open source and free tool for this:

Re: [GENERAL] how to find primary key field name?

2011-10-12 Thread Gavin Flower
On 12/10/11 11:54, J.V. wrote: If I have a table name, I know how to find the primary key constraint name, but see no way to find the primary key field name. select constraint_name from information_schema.tabale_constraints where table_name = table_name and constraint_type = 'PRIMARY KEY';

Re: [GENERAL] how to find primary key field name?

2011-10-12 Thread Gavin Flower
On 12/10/11 11:54, J.V. wrote: If I have a table name, I know how to find the primary key constraint name, but see no way to find the primary key field name. select constraint_name from information_schema.tabale_constraints where table_name = table_name and constraint_type = 'PRIMARY KEY';

[GENERAL] Installing uuid-ossp library in Postgres 9.1. (new Extension feature)

2011-10-12 Thread Basil Bourque
The uuid-ossp library enables you to generate UUID values server-side in Postgres. http://www.postgresql.org/docs/current/static/uuid-ossp.html The technique to install this library changed as of Postgres 9.1, because of the new Extension feature. Installing and uninstalling are now easier. I

Re: [GENERAL] Installing uuid-ossp library in Postgres 9.1. (new Extension feature)

2011-10-12 Thread John R Pierce
On 10/12/11 7:10 PM, Basil Bourque wrote: To install/load the extension, run this SQL: CREATE EXTENSION uuid-ossp; I found the quote marks to be required despite the doc being contrary. probably because of the minus sign... otherwise, thats parsed as uuid minus ossp :-/ -- john r

Re: [GENERAL] Help on PostgreSQL

2011-10-12 Thread Jayadevan M
Hello, 2.Is there any enterprise version available with all features? We just completed migrating one of our products to PostgreSQL and load testing it. My suggestion- if your product uses stored procedures/packages heavily, have a look at EnterpriseDB. Otherwise, try plain simple PostgreSQL.

Re: [GENERAL] Conceptual Architecture

2011-10-12 Thread Jayadevan M
Hello, Could you please point us to a simple white paper/doc which describes the Conceptual Architecture of PostgresSQL? I found these very useful. http://www.postgresql.org/files/developer/tour.pdf http://www.postgresql.org/files/developer/internalpics.pdf

[GENERAL] Dynamic sql real examples

2011-10-12 Thread Gabriel Filipiak
Hi all, I have lately learned what is dynamic sql and one of the most interesting features of it to me is that we can use dynamic columns names and tables. But I cannot think about useful real life examples. The only one that came into my mind is statistical table. Let`s say that we have table

Re: [GENERAL] Dynamic sql real examples

2011-10-12 Thread Gabriel Filipiak
Thx Gavin, any other suggestions from others? Gabe 2011/10/13 Gavin Flower gavinflo...@archidevsys.co.nz On 13/10/11 17:55, Gabriel Filipiak wrote: Hi all, I have lately learned what is dynamic sql and one of the most interesting features of it to me is that we can use dynamic columns

Re: [GENERAL] Dynamic sql real examples

2011-10-12 Thread Gabriel Filipiak
2011/10/13 Gavin Flower gavinflo...@archidevsys.co.nz On 13/10/11 18:35, Gabriel Filipiak wrote: Thx Gavin, any other suggestions from others? Gabe 2011/10/13 Gavin Flower gavinflo...@archidevsys.co.nz On 13/10/11 17:55, Gabriel Filipiak wrote: Hi all, I have lately learned