Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Francisco Olarte
Thomas: On Thu, Feb 23, 2017 at 4:25 PM, Thomas Güttler wrote: > This sound good. Is there a name for this trick, to find more details? Not that I know of. It's really old, basic stuff, with many variations possible. I've being doing variation of it since the half-inch tape and punched cards tim

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Francisco Olarte
Thomas: On Thu, Feb 23, 2017 at 4:26 PM, Thomas Güttler wrote: > Am 23.02.2017 um 13:44 schrieb Leknín Řepánek: >> Maybe you can do something like >> WITH cte AS ( >> DELETE FROM t1 WHERE cond >> RETURNINIG * >> ) >> INSERT into t2 >> SELECT * FROM cte; >> >> To move rows between tables with comb

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Francisco Olarte
Thomas: On Thu, Feb 23, 2017 at 4:16 PM, Thomas Güttler wrote: > Am 22.02.2017 um 16:00 schrieb Adrian Klaver: >> only written on a successful transfer. To improve the chances of >> successful transfer more smaller transfer batches >> rather then larger transfers. > I really need a solid solutio

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Thomas Güttler
Am 23.02.2017 um 13:44 schrieb Leknín Řepánek: Maybe you can do something like WITH cte AS ( DELETE FROM t1 WHERE cond RETURNINIG * ) INSERT into t2 SELECT * FROM cte; To move rows between tables with combination with fdw_postgres and foreign table. ... this way you don't need the second t

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Thomas Güttler
Am 23.02.2017 um 10:33 schrieb Francisco Olarte: Thomas: On Wed, Feb 22, 2017 at 1:51 PM, Thomas Güttler wrote: I want to **move** the data. The data should get deleted on the satellite after transfer. I don't know how to delete the data which was copied, since inserts can happen during the

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Thomas Güttler
Am 22.02.2017 um 16:00 schrieb Adrian Klaver: On 02/22/2017 04:51 AM, Thomas Güttler wrote: I have other concerns: atomar transaction. Movement should happen completely or not all. I don't think you can do this reliable (atomic transaction) with "copy table_name". You can if you wrap it in a

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Leknín Řepánek
Maybe you can do something like WITH cte AS ( DELETE FROM t1 WHERE cond RETURNINIG * ) INSERT into t2 SELECT * FROM cte; To move rows between tables with combination with fdw_postgres and foreign table. Je; On Thu, Feb 23, 2017 at 10:33:27AM +0100, Francisco Olarte wrote: > Thomas: > > On Wed

Re: [GENERAL] Move rows from one database to other

2017-02-23 Thread Francisco Olarte
Thomas: On Wed, Feb 22, 2017 at 1:51 PM, Thomas Güttler wrote: > I want to **move** the data. The data should get deleted on the satellite > after transfer. > I don't know how to delete the data which was copied, since inserts can > happen during the copy statement. Depending on the structure /

Re: [GENERAL] Move rows from one database to other

2017-02-22 Thread Adrian Klaver
On 02/22/2017 04:51 AM, Thomas Güttler wrote: I have other concerns: atomar transaction. Movement should happen completely or not all. I don't think you can do this reliable (atomic transaction) with "copy table_name". You can if you wrap it in a transaction: I want to **move** the data. The

Re: [GENERAL] Move rows from one database to other

2017-02-22 Thread Thomas Güttler
I have other concerns: atomar transaction. Movement should happen completely or not all. I don't think you can do this reliable (atomic transaction) with "copy table_name". You can if you wrap it in a transaction: I want to **move** the data. The data should get deleted on the satellite afte

Re: [GENERAL] Move rows from one database to other

2017-02-22 Thread Thomas Güttler
I misunderstood your original intent, I thought this was a one time process to move data to the central database. Given that it is to be a continuous process a FDW may not be the answer, one of the reasons being the above question. You will be denied the data in the remote table during the outag

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Adrian Klaver
On 02/21/2017 08:06 AM, Thomas Güttler wrote: Am 21.02.2017 um 15:27 schrieb William Ivanski: You can try OmniDB: http://www.omnidb.com.br/en_index.aspx OmniDB has a Convert feature, where you can set a data transfer, even if the target table exists. I am unsure if omnidb is the right tool

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Adrian Klaver
On 02/21/2017 07:53 AM, Thomas Güttler wrote: Am 21.02.2017 um 15:12 schrieb Adrian Klaver: On 02/21/2017 12:53 AM, Thomas Güttler wrote: I want to move table rows from one database to an central database. You actually talking about moving from ~100 databases to the central database, correct

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Melvin Davidson
On Tue, Feb 21, 2017 at 11:10 AM, Thomas Güttler < guettl...@thomas-guettler.de> wrote: > >> Depending on how much data you want to move, and if the tables have the >> same structure, you might also want to consider >> using >> pg_dump -a >> >> OR >> multiple instances of >> >> on satellite >> COP

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Thomas Güttler
Depending on how much data you want to move, and if the tables have the same structure, you might also want to consider using pg_dump -a OR multiple instances of on satellite COPY { table_name [ ( column_name [, ...] ) ] | ( query ) } TO { 'filename' | PROGRAM 'command' | STDOUT } [ [

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Thomas Güttler
Am 21.02.2017 um 15:27 schrieb William Ivanski: You can try OmniDB: http://www.omnidb.com.br/en_index.aspx OmniDB has a Convert feature, where you can set a data transfer, even if the target table exists. I am unsure if omnidb is the right tool here. I don't need a GUI. The movement of the

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Adrian Klaver
On 02/21/2017 12:53 AM, Thomas Güttler wrote: I want to move table rows from one database to an central database. Both run PostgreSQL. How to solve this with PostgreSQL? Should have added earlier. This is a specific case of the more general case of ETL(Extract/Transform/Load). There are

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Thomas Güttler
Am 21.02.2017 um 15:12 schrieb Adrian Klaver: On 02/21/2017 12:53 AM, Thomas Güttler wrote: I want to move table rows from one database to an central database. You actually talking about moving from ~100 databases to the central database, correct? Both run PostgreSQL. Are all the Postgr

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Moreno Andreo
Il 21/02/2017 15:38, Melvin Davidson ha scritto: Depending on how much data you want to move, and if the tables

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Melvin Davidson
On Tue, Feb 21, 2017 at 9:27 AM, William Ivanski wrote: > You can try OmniDB: http://www.omnidb.com.br/en_index.aspx > > OmniDB has a Convert feature, where you can set a data transfer, even if > the target table exists. > > Em ter, 21 de fev de 2017 às 11:18, Adrian Klaver < > adrian.kla...@akla

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread William Ivanski
You can try OmniDB: http://www.omnidb.com.br/en_index.aspx OmniDB has a Convert feature, where you can set a data transfer, even if the target table exists. Em ter, 21 de fev de 2017 às 11:18, Adrian Klaver escreveu: > On 02/21/2017 12:53 AM, Thomas Güttler wrote: > > I want to move table rows

Re: [GENERAL] Move rows from one database to other

2017-02-21 Thread Adrian Klaver
On 02/21/2017 12:53 AM, Thomas Güttler wrote: I want to move table rows from one database to an central database. You actually talking about moving from ~100 databases to the central database, correct? Both run PostgreSQL. Are all the Postgres instances the same version and what is the v

Re: [GENERAL] Move table - New schema

2012-09-18 Thread António Rodrigues
You were both right. It was a problem with permissions. Thank you, António On Tue, Sep 18, 2012 at 2:37 PM, Adrian Klaver wrote: > On 09/18/2012 03:48 AM, António Rodrigues wrote: > >> Hi list, >> >> (newbie question) >> >> I'm trying to move a set of tables between schemas. >> >> Tried: >> >> AL

Re: [GENERAL] Move table - New schema

2012-09-18 Thread Adrian Klaver
On 09/18/2012 03:48 AM, António Rodrigues wrote: Hi list, (newbie question) I'm trying to move a set of tables between schemas. Tried: ALTER TABLE tablename SET SCHEMA schemaname It gives me error: "schema schemaname does not exist" (it does) http://www.postgresql.org/docs/9.0/interac

Re: [GENERAL] Move the postgreSQL database from Drive C to Map Network Drive (Called Z)

2012-05-03 Thread Chris Angelico
On Fri, May 4, 2012 at 4:55 AM, EllyR wrote: > I have a huge Postgres database on my C drive, I am continuously collecting > the data, so unfortunately, the drive is getting full and I wanted to move > it to a map network drive I got. Are you able to install Postgres on a remote system and then u

Re: [GENERAL] Move the postgreSQL database from Drive C to Map Network Drive (Called Z)

2012-05-03 Thread Magnus Hagander
On Thu, May 3, 2012 at 8:55 PM, EllyR wrote: > Hi, > > I have a huge Postgres database on my C drive, I am continuously collecting > the data, so unfortunately, the drive is getting full and I wanted to move > it to a map network drive I got. I followed the instruction in the link It's not suppor

Re: [GENERAL] Move the postgreSQL database from Drive C to Map Network Drive (Called Z)

2012-05-03 Thread John R Pierce
On 05/03/12 11:55 AM, EllyR wrote: But after doing all the things mentioned in the link, when I want to start the postgres again as a service, it can not be started, it seems it does not recognize the map network drive , would you please let me know if I am in the right track or I need to do some

Re: [GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Bret Stern
On Thu, 2012-03-29 at 14:49 -0500, Andy Colson wrote: > On 3/29/2012 2:10 PM, Rich Shepard wrote: > > I'm storing vector map attribute data in postgres tables and somehow > > managed to create two databases (of similar names) rather than one. I want > > to combine the two. > > > > For tables that e

Re: [GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Rich Shepard
On Thu, 29 Mar 2012, Andy Colson wrote: How many tables are we talking about. If its a few tables, I'd rename them: alter table lake rename to lake_old; ... etc then dump it out and restore into the proper db. Andy, This will work just fine. Thanks for the insight. Rich -- Sent via pgsq

Re: [GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Rich Shepard
On Thu, 29 Mar 2012, Gabriele Bartolini wrote: I suggest that you look at the -l and -L options in pg_restore, which allow you to select which dump entries to restore (selective restore). Gabriele, After sending the message I realized the proper syntax is 'psql -d database -f table.sql'. Th

Re: [GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Andy Colson
On 3/29/2012 2:10 PM, Rich Shepard wrote: I'm storing vector map attribute data in postgres tables and somehow managed to create two databases (of similar names) rather than one. I want to combine the two. For tables that exist in the one database I want to eliminate, I thought to use pg_dump to

Re: [GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Gabriele Bartolini
Hi Rich, Il 29/03/12 21:10, Rich Shepard ha scritto: For tables that exist in the one database I want to eliminate, I thought to use pg_dump to create .sql files, then use pg_restore to add the table to the other database. Did this for one table (with 4201 rows), but 'pg_restore -d databas

Re: [GENERAL] Move From Oracle DB to PostgreSQL DB

2011-03-14 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= writes: > On Mon, 2011-03-14 at 14:43 -0400, gene.po...@macys.com wrote: >> [ wants to port Red Hat Satellite to Postgres ] > Please see > http://spacewalk.redhat.com/ Yeah. I'm on the fringes of that port effort, and it is *not* trivial; Satellite is umpteen

Re: [GENERAL] Move From Oracle DB to PostgreSQL DB

2011-03-14 Thread John R Pierce
On 03/14/11 11:43 AM, gene.po...@macys.com wrote: Is there a recent tutorial, white paper, how to on move/migrate from Oracle to PostgreSQL? I can get the Oracle schema DDL by pointing our Data Modeling software at the Red Hat Satellite server and extracting the DDL. It will take that Oracle

Re: [GENERAL] Move From Oracle DB to PostgreSQL DB

2011-03-14 Thread Stephen Frost
Gene, * gene.po...@macys.com (gene.po...@macys.com) wrote: > Is there a recent tutorial, white paper, how to on move/migrate from > Oracle to PostgreSQL? It's typically "not hard", but it depends on what you're doing w/ Oracle. Specifically, things like stored procedures (PL/SQL) may require

Re: [GENERAL] Move From Oracle DB to PostgreSQL DB

2011-03-14 Thread Andrew Sullivan
On Mon, Mar 14, 2011 at 02:43:17PM -0400, gene.po...@macys.com wrote: > Is there a recent tutorial, white paper, how to on move/migrate from > Oracle to PostgreSQL? I can get the Oracle schema DDL by pointing our > Data Modeling software at the Red Hat Satellite server and extracting the > DDL

Re: [GENERAL] Move From Oracle DB to PostgreSQL DB

2011-03-14 Thread Devrim GÜNDÜZ
On Mon, 2011-03-14 at 14:43 -0400, gene.po...@macys.com wrote: > We're running Red Hat Satellite Server and it's used to provision our > servers (both physical and virtual). It works great and we have no > issues with it *except* It will only provision Red Hat. > > Why this question: > > We

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-07 Thread Chris Browne
dm.a...@gmail.com (DM) writes: > It is not real time, updates every 5 mins should be fine.  > > But the DB2 database is real busy and its real performance based.  The book "Scalable Internet Architectures" (by Theo Schlossnagle) has an example of how to build a trigger-based replication system cop

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thank you so much for all your inputs. On Fri, Jun 4, 2010 at 3:27 PM, John R Pierce wrote: > DM wrote: > >> Thank you so much for every ones inputs. >> >> It is not real time, updates every 5 mins should be fine. But the DB2 >> database is real busy and its real performance based. >> > > well,

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce
DM wrote: Thank you so much for every ones inputs. It is not real time, updates every 5 mins should be fine. But the DB2 database is real busy and its real performance based. well, you might look over http://www.redbooks.ibm.com/abstracts/sg246828.html which discusses DB2 replication. "

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thank you so much for every ones inputs. It is not real time, updates every 5 mins should be fine. But the DB2 database is real busy and its real performance based. Thanks Deepak On Fri, Jun 4, 2010 at 2:49 PM, John R Pierce wrote: > DM wrote: > >> Sorry i didnt frame my question properly earl

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce
DM wrote: Sorry i didnt frame my question properly earlier, we are looking for solution to do real time replication from db2 to postgres, its different from migration. Eventually we want to move away from DB2. Intention is to create a subset of a db2 database on postgres and allow users to acc

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread David Fetter
Deepak, You can use DBI-Link to make writeable views of tables in DB2 (or other data store) from PostgreSQL. You can use the same linkage to materialize those views, if you like. The latest version of the software is on GitHub http://github.com/davidfetter/DBI-Link You can also join the low-tr

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Sorry i didnt frame my question properly earlier, we are looking for solution to do real time replication from db2 to postgres, its different from migration. Eventually we want to move away from DB2. Intention is to create a subset of a db2 database on postgres and allow users to access the postgre

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce
DM wrote: Hi All, We want to replicate /move data form db2 to postgres is there any software / solutions / approach available to do this? in general, I'd likely use a perl or similar program to connect to the 'other' database, fetch your data, and insert it into your postgres database. thi

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thanks Robert, Is there any tools available. Thanks Deepak On Fri, Jun 4, 2010 at 2:19 PM, Richard Broersma wrote: > On Fri, Jun 4, 2010 at 2:13 PM, DM wrote: > > We want to replicate /move data form db2 to postgres is there any > software / > > solutions / approach available to do this? > >

Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread Richard Broersma
On Fri, Jun 4, 2010 at 2:13 PM, DM wrote: > We want to replicate /move data form db2 to postgres is there any software / > solutions / approach available to do this? Here is a link on the postgresql wiki. Hopefully it has some useful information. http://wiki.postgresql.org/wiki/Converting_from

Re: [GENERAL] Move to core xml from contrib/xml2

2010-03-16 Thread Tom Lane
Frank jansen writes: > Am 15.03.2010 22:10, schrieb Bruce Momjian: >> We have fixed the serious bugs in /contrib/xml2 with the minor releases >> that came out today, 2010-03-15. >> > As already said: "out of memory on 8.4.3" (the script consumes up > machines memory till it dies) You were alrea

Re: [GENERAL] Move to core xml from contrib/xml2

2010-03-16 Thread Frank jansen
Am 15.03.2010 22:10, schrieb Bruce Momjian: Frank jansen wrote: Hi, we have encountered huge memory problems (segfault on 8.4.2, out of memory on 8.4.3) with our xml functions when moving from 8.3 to 8.4, as mentioned here: http://archives.postgresql.org/pgsql-general/2010-03/msg00563.php

Re: [GENERAL] Move to core xml from contrib/xml2

2010-03-15 Thread Bruce Momjian
Frank jansen wrote: > Hi, > > we have encountered huge memory problems (segfault on 8.4.2, out of > memory on 8.4.3) with our xml functions when moving from 8.3 to 8.4, as > mentioned here: > http://archives.postgresql.org/pgsql-general/2010-03/msg00563.php > > We think about moving from contr

Re: [GENERAL] Move PGdata to a different drive

2009-06-09 Thread Jasen Betts
On 2009-06-05, David Fetter wrote: > On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote: >> Jennifer Trey wrote: >> > Hi, >> > What file should I be working with? >> >> Just shut down the server and move the directory whever you want and >> restart the server. There are no file conten

Re: [GENERAL] Move PGdata to a different drive

2009-06-08 Thread Yaroslav Tykhiy
David Fetter wrote: On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote: Jennifer Trey wrote: Hi, What file should I be working with? Just shut down the server and move the directory whever you want and restart the server. There are no file contents that need changing. Of course sho

Re: [GENERAL] Move PGdata to a different drive

2009-06-05 Thread David Fetter
On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote: > Jennifer Trey wrote: > > Hi, > > What file should I be working with? > > Just shut down the server and move the directory whever you want and > restart the server. There are no file contents that need changing. > Of course should ad

Re: [GENERAL] Move PGdata to a different drive

2009-06-04 Thread Massa, Harald Armin
Probably you do not have any script to start PostgreSQL, but it is started as a service. The data directory is a parameter of the service within services.msc, there is ... pg_ctl.exe ... -D "":\your\directory" Read up on pg_ctl --help how to change this information (pg_ctl --register) Best wish

Re: [GENERAL] Move PGdata to a different drive

2009-06-04 Thread Jennifer Trey
Ook.. thats what I wanted to know. I figured there has to be a place to change the pointer to the new location of the data. Thank you / Jennifer On Thu, Jun 4, 2009 at 6:11 PM, Bruce Momjian wrote: > Jennifer Trey wrote: > > Hi, > > What file should I be working with? > > Just shut down the serv

Re: [GENERAL] Move PGdata to a different drive

2009-06-04 Thread Bruce Momjian
Jennifer Trey wrote: > Hi, > What file should I be working with? Just shut down the server and move the directory whever you want and restart the server. There are no file contents that need changing. Of course should adjust your scripts or PGDATA environment variable. -- Bruce Momjian

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread Roderick A. Anderson
Tom Lane wrote: "Joshua D. Drake" writes: On Tue, 2009-04-14 at 09:58 -0700, Roderick A. Anderson wrote: The plan calls for a pg_dump using my workstation using CREATE the database and INSERTS (-C -D) . Then use psql to run the script created above to build the database on the new system.

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread Roderick A. Anderson
Joshua D. Drake wrote: On Tue, 2009-04-14 at 09:58 -0700, Roderick A. Anderson wrote: I can't avoid it any longer and have to move an old RT2 installation to a new machine. (I'll upgrade to RT3 on that machine.) The plan calls for a pg_dump using my workstation using CREATE the database and

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread Roderick A. Anderson
John R Pierce wrote: Roderick A. Anderson wrote: make sure pg_hba.conf on the old machine allows you to connect from the new machine's IP address as the user postgres (this may require setting a database password for the postgres user on the old machine if the 'host' authentication method

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread John R Pierce
Roderick A. Anderson wrote: I can't avoid it any longer and have to move an old RT2 installation to a new machine. (I'll upgrade to RT3 on that machine.) The plan calls for a pg_dump using my workstation using CREATE the database and INSERTS (-C -D) . Then use psql to run the script created

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread Tom Lane
"Joshua D. Drake" writes: > On Tue, 2009-04-14 at 09:58 -0700, Roderick A. Anderson wrote: >> The plan calls for a pg_dump using my workstation using CREATE the >> database and INSERTS (-C -D) . Then use psql to run the script created >> above to build the database on the new system. > You wan

Re: [GENERAL] Move databases from Pg 7.2.1 to 8.3.x

2009-04-14 Thread Joshua D. Drake
On Tue, 2009-04-14 at 09:58 -0700, Roderick A. Anderson wrote: > I can't avoid it any longer and have to move an old RT2 installation to > a new machine. (I'll upgrade to RT3 on that machine.) > > The plan calls for a pg_dump using my workstation using CREATE the > database and INSERTS (-C -D)

Re: [GENERAL] Move PG installation to a new computer

2009-03-24 Thread Thomas Kellerer
Albe Laurenz, 24.03.2009 10:34: Thomas Kellerer wrote: I'm getting a new notebook and want to confirm that my idea on how to move my Postgres installation will work This is a development/test installation and not a production system, so it doesn't need to be 100% fail safe. Both systems are

Re: [GENERAL] Move PG installation to a new computer

2009-03-24 Thread Albe Laurenz
Thomas Kellerer wrote: > I'm getting a new notebook and want to confirm that my idea > on how to move my Postgres installation will work This is a > development/test installation and not a production system, so > it doesn't need to be 100% fail safe. > > Both systems are Windows XP 32bit. > >

Re: [GENERAL] move database from the default tablespace to a new one?

2008-05-16 Thread Guillaume Lelarge
Anton Melser a écrit : Is this possible? I have a db that has been living in the default tablespace, and I am trying to separate out the transaction logs (and log archiving) and the data. It seems that tablespaces are the way to go... but the database exists and I need to separate them out. Any p

Re: [GENERAL] move databases files location

2007-10-18 Thread jehan.procaccia
Richard Huxton wrote: jehan.procaccia wrote: my postgresql installation from redhat package: $ rpm -q postgresql postgresql-7.4.17-1.RHEL4.1 is located in /var partition, unfortunalty it is nearly full $ df -H . Filesystem Size Used Avail Use% Mounted on /dev/sda12 11

Re: [GENERAL] move databases files location

2007-10-16 Thread Richard Huxton
jehan.procaccia wrote: my postgresql installation from redhat package: $ rpm -q postgresql postgresql-7.4.17-1.RHEL4.1 is located in /var partition, unfortunalty it is nearly full $ df -H . Filesystem Size Used Avail Use% Mounted on /dev/sda12 11G 8.2G 1.7G 84% /v

Re: [GENERAL] move whole schema to a new tablespace

2007-10-09 Thread Scott Marlowe
On 10/9/07, Rhys Stewart <[EMAIL PROTECTED]> wrote: > Hi all, > short of issuing single commands for each table is there a way to move > the an entire schema to a new tablespace, indices and all? I'm pretty sure you're gonna have to write a short pl/pgsql script to do that. --

Re: [GENERAL] Move database from Solaris to Windows

2007-08-06 Thread Barry C Dowell
ipate more. Bcd -Original Message- From: Barry C Dowell [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 4:40 PM To: 'pgsql-general@postgresql.org' Subject: RE: [GENERAL] Move database from Solaris to Windows Ok, if you can forgive the possible stupid answer and help p

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Merlin Moncure
On 8/2/07, Barry C Dowell <[EMAIL PROTECTED]> wrote: > Ok, if you can forgive the possible stupid answer and help pull me a long a > bit more, in answer to this: > > >> Yes, dump/restore is pretty much the standard to move dbs across > architectures so we'll need more to work with. One thing to ch

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Barry C Dowell
ral@postgresql.org Subject: Re: [GENERAL] Move database from Solaris to Windows On Aug 1, 2007, at 2:34 PM, Steve Atkins wrote: > > On Aug 1, 2007, at 11:44 AM, Barry C Dowell wrote: > >> Please forgive me if this question is being asked in the wrong area >> (and please sugge

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Erik Jones
On Aug 1, 2007, at 2:34 PM, Steve Atkins wrote: On Aug 1, 2007, at 11:44 AM, Barry C Dowell wrote: Please forgive me if this question is being asked in the wrong area (and please suggest the proper one so I can ask there :-) ), but I'm in search of assistance in moving a database from a So

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Barry C Dowell
esday, August 01, 2007 3:35 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Move database from Solaris to Windows On Aug 1, 2007, at 11:44 AM, Barry C Dowell wrote: > Please forgive me if this question is being asked in the wrong area > (and please suggest the proper one so I can a

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Steve Atkins
On Aug 1, 2007, at 11:44 AM, Barry C Dowell wrote: Please forgive me if this question is being asked in the wrong area (and please suggest the proper one so I can ask there :-) ), but I'm in search of assistance in moving a database from a Solaris system over to a Windows system. Solaris

Re: [GENERAL] Move a database from one server to other

2007-06-29 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Nicholas Barr <[EMAIL PROTECTED]> wrote: % Only copy the data directory if both servers are offline and not running % and if both servers use the same version of postgres. This method is not % recommended AFAIK. It _is_ recommended for setting up a warm-standby ser

Re: [GENERAL] Move a database from one server to other

2007-06-25 Thread Michael Glaesemann
On Jun 25, 2007, at 10:44 , Nicholas Barr wrote: Only copy the data directory if both servers are offline and not running and if both servers use the same version of postgres. ... and have the same architecture. As you note, copying the data directory is *not* the recommended way to do th

Re: [GENERAL] Move a database from one server to other

2007-06-25 Thread Francisco Reyes
Nicholas Barr writes: It is much much safer to use pg_dump/pg_restore and know that your data is consistent. http://www.postgresql.org/docs/8.2/static/backup-dump.html In particular look at the section 23.1.2. Using pg_dumpall That will copy your entire data set including users. -

Re: [GENERAL] Move a database from one server to other

2007-06-25 Thread Nicholas Barr
> Hello, I have to move all the data in my actual server to the new one. > I have several databases in postgresql, and I'd like to know the best way > to > move them. > I thoung that maybe copying all the data directory... but I'm not sure, > and I > don't know where it's stored. > I'd apreciate yo

Re: [GENERAL] MOVE cursor in plpgsql?

2007-02-11 Thread Webb Sprague
> Is there a way to move a cursor in plpgsql in the same way as in > regular sql? ... Wouldn't it be easier to list the parts in a random order (simply ORDER BY RANDOM()) and then use modulo by number of actors (but there's no ROWNUM so a loop is needed anyway). Something like... I think you a

Re: [GENERAL] MOVE cursor in plpgsql?

2007-02-11 Thread Tomas Vondra
> Hi all, > > Is there a way to move a cursor in plpgsql in the same way as in > regular sql? The function below would like to move the cursor back to > the start each time the cursor runs out of rows, creating pairs of > integers that are randomly put together. > > The "motivation" for this is

Re: [GENERAL] Move data between two databases SQL-ASCII to UTF8

2007-02-08 Thread Michael Fuhr
On Thu, Feb 08, 2007 at 08:22:40PM -0500, Chad Wagner wrote: > On 2/8/07, Clodoaldo <[EMAIL PROTECTED]> wrote: > >Use pg_dump to dump the db and use iconv on the generated file: > > > >iconv -f ASCII -t UTF-8 mydb.dump -o mydb_utf8.dump Converting the data from ASCII to UTF-8 doesn't make much sen

Re: [GENERAL] Move data between two databases SQL-ASCII to UTF8

2007-02-08 Thread Chad Wagner
On 2/8/07, Clodoaldo <[EMAIL PROTECTED]> wrote: Use pg_dump to dump the db and use iconv on the generated file: iconv -f ASCII -t UTF-8 mydb.dump -o mydb_utf8.dump Wouldn't it be adequate to set the client encoding to SQL_ASCII in the dump file (if that was infact the encoding on the origina

Re: [GENERAL] Move data between two databases SQL-ASCII to UTF8

2007-02-08 Thread Clodoaldo
2007/2/8, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: I need to convert my database to UTF8. Is there a way to do a SELECT ... INSERT from the old database table to the new one? Would the INSERT correct data errors between the two data types? I only have 10 tables and the biggest has < 8000 rows. U

Re: [GENERAL] Move db files from one pgsql instance to another

2006-08-16 Thread Jeff Davis
On Wed, 2006-08-16 at 20:37 +0200, Javier de la Torre wrote: > Yes! > > Thanks. It pointed me out to File system level backup. And there I > found a very important hint... you have to restore the whole database > cluster. I suppose this means that I have to transfer all databases in > my postgresq

Re: [GENERAL] Move db files from one pgsql instance to another

2006-08-16 Thread Javier de la Torre
Yes! Thanks. It pointed me out to File system level backup. And there I found a very important hint... you have to restore the whole database cluster. I suppose this means that I have to transfer all databases in my postgresql... What is actually a pity because there is a db on the production si

Re: [GENERAL] Move db files from one pgsql instance to another

2006-08-16 Thread Jeff Davis
On Wed, 2006-08-16 at 20:04 +0200, Javier de la Torre wrote: > I am working right now in an strategy to improve the performance on my > server. The situation is this: > > I have a very large database that it is only update once a month, but > when is updated I have to process a lot of things on th

Re: [GENERAL] move from 1 database to another

2006-05-26 Thread P.M
Thanks.it works well.Ragnar <[EMAIL PROTECTED]> wrote: On fim, 2006-05-25 at 11:52 -0700, P.M wrote:> I would like to know how can i move from 1 database to another one ?> > basically i want to run a *.sql script in which i connect under a> particular database (for example : template1 or postgres)

Re: [GENERAL] move from 1 database to another

2006-05-25 Thread Ragnar
On fim, 2006-05-25 at 11:52 -0700, P.M wrote: > I would like to know how can i move from 1 database to another one ? > > basically i want to run a *.sql script in which i connect under a > particular database (for example : template1 or postgres) and my *.sql > script should create a new database

Re: [GENERAL] move from 1 database to another

2006-05-25 Thread Michael Fuhr
On Thu, May 25, 2006 at 05:41:34PM -0500, Jim Nasby wrote: > On May 25, 2006, at 1:52 PM, P.M wrote: > >I would like to know how can i move from 1 database to another one ? > > > >basically i want to run a *.sql script in which i connect under a > >particular database (for example : template1 or

Re: [GENERAL] move from 1 database to another

2006-05-25 Thread Jim Nasby
On May 25, 2006, at 1:52 PM, P.M wrote: I would like to know how can i move from 1 database to another one ? basically i want to run a *.sql script in which i connect under a particular database (for example : template1 or postgres) and my *.sql script should create a new database (for examp

Re: [GENERAL] Move cursor

2005-03-22 Thread Bruce Momjian
-Message d'origine- > De : Michael Fuhr [mailto:[EMAIL PROTECTED] > Envoy? : mardi 8 mars 2005 18:29 > ? : Tom Lane > Cc : FERREIRA William (COFRAMI); pgsql-general@postgresql.org > Objet : Re: [GENERAL] Move cursor > > > On Tue, Mar 08, 2005 at 12:16:28PM -0500,

Re: [GENERAL] Move cursor

2005-03-09 Thread FERREIRA William (COFRAMI)
Title: RE: [GENERAL] Move cursor does i hope that CURSOR will be fully implemented soon ? (or maybe you know an alternative for my problem ? :) ) -Message d'origine- De : Michael Fuhr [mailto:[EMAIL PROTECTED]] Envoyé : mardi 8 mars 2005 18:29 À : Tom Lane Cc : FERREIRA Wi

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 12:16:28PM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > I don't think PL/pgSQL implements cursors fully. > > Its cursor facility is certainly far weaker than what's presently in the > main SQL language. I think this is at least partly historical ac

Re: [GENERAL] Move cursor

2005-03-08 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > I don't think PL/pgSQL implements cursors fully. Its cursor facility is certainly far weaker than what's presently in the main SQL language. I think this is at least partly historical accident (ie we upgraded the main language and forgot about plpgsql).

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 04:23:37PM +0100, FERREIRA William (COFRAMI) wrote: > i need to use the MOVE function on a cursor, for extracting special rows. > the function is written in pl/pgSQL I don't think PL/pgSQL implements cursors fully. In particular, I don't see MOVE in the PL/pgSQL parser; I

Re: [GENERAL] MOVE

2005-01-14 Thread PFC
Use an after inset trigger. Well I did the reverse, an after delete trigger on the live table which inserts the deleted row in the history table, and it works very well. Thanks. ---(end of broadcast)--- TIP 9: the planner will ignore your desire

Re: [GENERAL] MOVE

2005-01-14 Thread PFC
BEGIN; INSERT INTO archive (...) SELECT ... FROM active WHERE user_id = ...; DELETE FROM active WHERE user_id = ...; COMMIT; The DELETE can only delete the rows returned by the select, that's the whole point of transactions... Well, in the case of having a unique index on user_id, and if no-one

Re: [GENERAL] MOVE

2005-01-14 Thread Tom Lane
Martijn van Oosterhout writes: > Why not just do it in a single transaction? I don't think you need to > use SERIALIZABLE at all, I think normal read-committed mode will do > what you want, no? > BEGIN; > INSERT INTO archive (...) SELECT ... FROM active WHERE user_id = ...; > DELETE FROM active W

Re: [GENERAL] MOVE

2005-01-14 Thread Martijn van Oosterhout
On Fri, Jan 14, 2005 at 08:49:24PM +0100, PFC wrote: > the auto-expiration cron > job, I must also expire ALL his open chatroom connections. > INSERT INTO archive (...) SELECT ... FROM active WHERE user_id = ...; > DELETE FROM active WHERE user_id = ...; > > Now, if the user inserts a connection b

Re: [GENERAL] MOVE

2005-01-14 Thread Dave Smith
Use an after inset trigger. On Fri, 2005-01-14 at 15:38, [EMAIL PROTECTED] wrote: > PFC wrote: I'd really like to have a sql command, say MOVE, or SELECT AND > DELETE, whatever, which acts like a SELECT, returning the rows, but > deleting them as well. > > Oracle implements this with the syntax D

  1   2   >