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 i

[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, upda

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

2011-10-12 Thread Ondrej Ivanič
Hi, On 12 October 2011 14:50, Anthony Presley 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 and DB2, MS > SQL Anal

[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 there

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. 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 execute. > > I h

[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 pg_last_xlog_receive_locati

[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 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 "Conceptual Archite

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. 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 execute. > > I h

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 manual?

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 i

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

2011-10-12 Thread Anthony Presley
2011/10/12 Ondrej Ivanič > Hi, > > On 12 October 2011 14:50, Anthony Presley 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, requi

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

2011-10-12 Thread Anthony Presley
2011/10/12 Filip Rembiałkowski > > 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 jPivot, which 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 wrote: > On Tue, Oct 11, 2011 at 4:33 PM, Raymond O'Donnell 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 >> catalog: >> >>  http://www.

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 Wed

[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 functio

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." 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 there?

[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): Pe

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. Gues

[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 h

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 d

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 1

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: http://www.postgresql.org/docs/8.3/inte

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 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 with 2 fields ?

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 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 like you're using warm

[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: Sa

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: http://www.postgresql.org/docs/8.3/inte

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 ove

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 pg_start_ba

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

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

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 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 like you'

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 docu

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 performan

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 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 us

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

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 currentl

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. 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 there? it

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 wa

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 stree

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 stree

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 an

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: http://www.enterprisedb.com/migrationw

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 = and constraint_type = 'PRIMARY KEY'; will return

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 = and constraint_type = 'PRIMARY KEY'; will return

[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 pier

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 http://www.westnet.com/~gsmith/co

[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 wi

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 > 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 names and tables. > But

Re: [GENERAL] Dynamic sql real examples

2011-10-12 Thread Gabriel Filipiak
2011/10/13 Gavin Flower > On 13/10/11 18:35, Gabriel Filipiak wrote: > > Thx Gavin, > > any other suggestions from others? > > Gabe > > 2011/10/13 Gavin Flower > >> On 13/10/11 17:55, Gabriel Filipiak wrote: >> >> Hi all, >> >> I have lately learned what is dynamic sql and one of the most >>

Re: [GENERAL] Dynamic sql real examples

2011-10-12 Thread John R Pierce
Please do not 'top post'. In these mailings lists, you are expected to add your comments either interpersed, or (more normally) at the bottom. This allows people to read the context, before they read your comments. Sorry about that. the other half of not top posting is editt

Re: [GENERAL] Dynamic sql real examples

2011-10-12 Thread Pavel Stehule
Hello It's really depends on client software and architecture. Dynamic SQL is interesting for some use cases when you use a stored procedures, when you dynamically create tables based on metadata and when you access these tables. We had a object oriented database with interface in stored procedur