Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Another testimonial to the stability of Postgres :) We may be arguing semantics here but I would consider dump/restore an admin function. How do you handle a client restoring a database currently? Database is 8.0 compliant. In this case 8.4 pg_dump/pg_restore is used to dump and restore with a

[GENERAL] plperl - caching prepared queries and cleanup

2010-12-16 Thread Anupama Ramaswamy
Hi, I am trying to use plperl for one of my triggers. The trigger executes a query. So I am preparing the query and caching it as below: if (!defined $_SHARED{'base_table_query'}) { my $base_columns_query = "select column_name from inf

Re: [GENERAL] [HACKERS] getting composite types info from libpq

2010-12-16 Thread Florian Pflug
On Dec16, 2010, at 02:51 , Daniele Varrazzo wrote: > 1. do I get enough info in the PGresult to inspect anonymous composite types? You just get the composite value, as you discovered. In text mode, that means only the composite string value, which contains no information about the individual field'

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 09.16, Andrus Moor wrote: Another requirement is to clone existing database in server with data. I posted question about it and it seems that PostgreSql does not have any capability to do this in server side in plpgsql fast. I'm probably misunderstanding but "CREATE DATABASE f

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if database bar is accessed by other users ? Proba

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Raymond O'Donnell
On 16/12/2010 10:12, Andrus Moor wrote: Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if databas

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Jayadevan M
Hello, > I don't know for sure, but I don't see why it should fail - it's only > reading it, not writing data to it or making any changes. Probably it will fail... http://www.postgresql.org/docs/9.0/static/sql-createdatabase.html Although it is possible to copy a database other than template1 by

Re: [GENERAL] Postgres Installation

2010-12-16 Thread Filip Rembiałkowski
2010/12/16 Adarsh Sharma > Dear all, > > Is there are any useful links for Installing Postgres_9.1 (recent version ) > in CentOS from its binaries. > > most recent stable version is 9.0.2. here you will find Yum instructions and links to RPM packages http://yum.pgrpms.org/howtoyum.php see also

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 11.12, Andrus Moor wrote: Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if datab

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 11.21, Jayadevan M wrote: Hello, I don't know for sure, but I don't see why it should fail - it's only reading it, not writing data to it or making any changes. Probably it will fail... http://www.postgresql.org/docs/9.0/static/sql-createdatabase.html Although it is possible to

Re: [GENERAL] What is the name pseudo column

2010-12-16 Thread Jack Christensen
On 12/15/2010 5:43 PM, Adrian Klaver wrote: On Wednesday 15 December 2010 1:27:19 pm David Fetter wrote: On Wed, Dec 15, 2010 at 01:50:54PM -0600, Jack Christensen wrote: I was just surprised when accidentally selecting a non-existent name column there was no error -- instead something came bac

Re: [GENERAL] [HACKERS] getting composite types info from libpq

2010-12-16 Thread Merlin Moncure
On Thu, Dec 16, 2010 at 5:03 AM, Florian Pflug wrote: > On Dec16, 2010, at 02:51 , Daniele Varrazzo wrote: >> 1. do I get enough info in the PGresult to inspect anonymous composite types? > You just get the composite value, as you discovered. In text mode, that means > only the composite string va

Fwd: Re: [GENERAL] Postgresql 9.1 pg_last_xact_replay_timestamp limitations

2010-12-16 Thread Gabi Julien
> > > >> We should return the timestamp of last valid checkpoint rather than NULL > >> in that > >> case? > > > > Well, I think this behavior would be more appreciated by postgresql users > > in general. The case where the slave can be restarted after a clean > > shutdown is rare but we need to

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Adrian Klaver
On Thursday 16 December 2010 12:16:47 am Andrus Moor wrote: > > Another testimonial to the stability of Postgres :) > > We may be arguing semantics > > here but I would consider dump/restore an admin function. How do you > > handle a > > client restoring a database currently? > > Database is 8.0 co

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. " pg_restore ignores erros during restore (it only returns exit code 1). So "manual editing of the dump file to remove syntax not understood" is never requi

[GENERAL] When the trigger is called my application is awaiting the finish

2010-12-16 Thread fel...@informidia.com.br
Hello, I'm having a problem running an update command that invokes a trigger, the problem is that the function performed takes about 45 minutes to finish and my application is locked waiting for the finish. You know how I can't wait for the end? Thanks in advance --

[GENERAL] Postgresql: Remove last char in text-field if the column ends with minus sign

2010-12-16 Thread Sarang Dave
Hello sir, I want to remove the last char in a column if it ends with the minus sign. How could I do this in postgresql? For example: sdfs-dfg4t-etze45z5z- => sdfs-dfg4t-etze45z5z gsdhfhsfh-rgertggh => stay untouched Is there an easy syntax I can use? Thanking You. With Regards, Sarang Dave

[GENERAL] Plperl caching prepared queries and cleanup

2010-12-16 Thread Anupama
Hi, I am trying to use plperl for one of my triggers. The trigger executes a query. So I am preparing the query and caching it as below: if (!defined $_SHARED{'base_table_query'}) { my $base_columns_query = "select column_name from informat

Re: [GENERAL] Searing array fields - or should I redesign?

2010-12-16 Thread Vincent Veyron
Le mercredi 15 décembre 2010 à 19:12 +0100, Jan Kesten a écrit : > > eg, insert into logtable values ( 'vehicle123', now(), > > {{'voltage','13'},{'rpm','600'}}; > > > > However, I am not sure how I can write a query - for example to read all > > records where the voltage field is less than 13.

Re: [GENERAL] Postgresql: Remove last char in text-field if the column ends with minus sign

2010-12-16 Thread Steve Crawford
On 12/16/2010 06:52 AM, Sarang Dave wrote: Hello sir, I want to remove the last char in a column if it ends with the minus sign. How could I do this in postgresql? regexp_replace(your_field, '-+$', ''); Cheers, Steve

[GENERAL] PgEast 2011: NYC CFP

2010-12-16 Thread Joshua D. Drake
December 16th, 2010: Celebrating 15 years of PostgreSQL, early. Following on the smashing success of PostgreSQL Conference West, PostgreSQL Conference West, The PostgreSQL Conference for Developers, End Users and Decision Makers, is being held at the Hotel Pennsylvania, in New York City from March

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Alban Hertroys
On 16 Dec 2010, at 9:16, Andrus Moor wrote: > How to fix this without distributing two copies of pg_dump/pg_restore ? > Is it reasonable to create database and plpgsql language manually before > running pg_restore ? In Are you sure that restoring dumps to your customers' sites is the best appro

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Adrian Klaver
On 12/16/2010 08:47 AM, Andrus Moor wrote: Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. " pg_restore ignores erros during restore (it only returns exit code 1). So "manual editing of the dump file to re

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Tom Lane
Adrian Klaver writes: > On 12/16/2010 08:47 AM, Andrus Moor wrote: >>> Loading a dump file into an older server may require manual editing of >>> the dump file to remove syntax not understood by the older server. " >> pg_restore ignores erros during restore (it only returns exit code 1). >> So "m

Re: [GENERAL] Searching array fields - or should I redesign?

2010-12-16 Thread Bryan Montgomery
Thanks for the comments. Just to clarify, I gave these two values as examples. The readings could be between a handful for one vehicle type up to 40 or more for another type of vehicle. On Thu, Dec 16, 2010 at 12:26 PM, Vincent Veyron wrote: > Le mercredi 15 décembre 2010 à 19:12 +0100, Jan Keste

Re: [GENERAL] Plperl caching prepared queries and cleanup

2010-12-16 Thread Alex Hunsaker
On Thu, Dec 16, 2010 at 01:57, Anupama wrote: > Will the plan be freed when the db session / connection closes OR Yes. However results may vary with a connection pooler. FYI %_SHARED is global to session, not database global. (technically its global per perl interpreter, so plperl and plperlu h

Re: [GENERAL] Searching array fields - or should I redesign?

2010-12-16 Thread Vincent Veyron
Le jeudi 16 décembre 2010 à 15:18 -0500, Bryan Montgomery a écrit : > Thanks for the comments. Just to clarify, I gave these two values as > examples. The readings could be between a handful for one vehicle type > up to 40 or more for another type of vehicle. > Not sure what you call a reading? d

[GENERAL] PANIC: ERRORDATA_STACK_SIZE exceeded

2010-12-16 Thread Edmundo Robles L.
hi! i have postgresql 8.3.12 and i got the eror: PANIC: ERRORDATA_STACK_SIZE exceeded This happens after insert 1000 registers on a table every 1 minute during 3 hours. any idea, why this happened??? # - # PostgreSQL configuration file #

Re: [GENERAL] PANIC: ERRORDATA_STACK_SIZE exceeded

2010-12-16 Thread Ray Stell
On Thu, Dec 16, 2010 at 06:33:25PM -0600, Edmundo Robles L. wrote: > hi! i have postgresql 8.3.12 and i got the eror: > PANIC: ERRORDATA_STACK_SIZE exceeded > if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE) { /* * Wups, stack not big enou

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-16 Thread Jasen Betts
On 2010-12-08, Andre Lopes wrote: > --20cf3043476e053b5f0496e5ebc4 > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, > > I need to obtain the maximum value of a date, but that comparison will be > made between 3 tables... I will explain better with a query... you probably want greatest(d1,

Re: [GENERAL] if-clause to an exiting statement

2010-12-16 Thread Jasen Betts
On 2010-12-07, Kobi Biton wrote: > hi i am a newbie to sql statments , I am running postgres 8.1 with > application called opennms version 1.8.5 due to an application bug > queries that I execute aginst the DB which returns raw-count=0 are being > ignored and will not process a certain trigger I

Re: [GENERAL] Simple, free PG GUI/query tool wanted

2010-12-16 Thread Sandeep Srinivasa
you could try SQLWorkbench (http://www.sql-workbench.net/)