Restore problem

Started by Bob Pawleyover 15 years ago36 messagesgeneral
Jump to latest
#1Bob Pawley
rjpawley@shaw.ca

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now included in lines the have been commented out – not to mention that the code is hard to read.

Is there some way of correcting this – or re restoring the database, so that I don’t have to go through the whole code line by line?

Bob

#2Gurjeet Singh
singh.gurjeet@gmail.com
In reply to: Bob Pawley (#1)
Re: Restore problem

On Tue, Dec 28, 2010 at 6:06 PM, Bob Pawley <rjpawley@shaw.ca> wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

I don't believe there's any easy way to do that. Can you show us some
examples of the 'before' and 'after' code, maybe that'll help.

Regards,
--
gurjeet.singh
@ EnterpriseDB - The Enterprise Postgres Company
http://www.EnterpriseDB.com

singh.gurjeet@{ gmail | yahoo }.com
Twitter/Skype: singh_gurjeet

Mail sent from my BlackLaptop device

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#1)
Re: Restore problem

On Tuesday 28 December 2010 3:06:40 pm Bob Pawley wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

This is in the plain text dump file right?

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

With out seeing an example that is going to be difficult :)

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

#4Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#3)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 4:21 PM
To: pgsql-general@postgresql.org
Cc: Bob Pawley
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 3:06:40 pm Bob Pawley wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

This is in the plain text dump file right?

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

With out seeing an example that is going to be difficult :)

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain text
dump fie through psql restored in the same way.

I don't have a copy of what it was but here is something quite similar to
the style I had before the dump.-

Begin Drop table if exists size ;
Drop table if exists temp_ ;

Drop table if exists temp1 ;

Drop table if exists target;

Create table size
( pro_id int4 ,
P_1 float,
P_2 float,
factor float
) ;

create table temp_
( pro_id int4 ,
graphic_id int4 ,
the_geom geometry,
ithe_geom geometry,
othe_geom geometry,
mthe_geom geometry,

ethe_geom geometry,
ip_target geometry,
op_target geometry
);

create table temp1
( id serial unique,
pro_id int4 ,
graphic_id int4 ,
the_geom geometry,
ithe_geom geometry,
othe_geom geometry,
mthe_geom geometry,
ethe_geom geometry,
ip_target geometry,
op_target geometry,
One varchar (5),
Two varchar (5),
Three varchar (5),
Four varchar (5)
);

Following is what it is now. Keep in mind email has word wrap.
(Note ---------1 is a comment out that, without word wrap, comments out a
long line of code.

DECLARE process_total integer ; processid integer ;
procgraphic cursor for select p_id.p_id.process_id

from p_id.p_id, processes_count where p_id.p_id.p_id_id =
processes_count.p_id_id

order by p_id.p_id.process_id; begin Select count
(p_id.p_id.process_id) INTO process_total FROM p_id.p_id,
processes_count Where p_id.p_id.p_id_id =
cesses_count.p_id_id; ------------------1 If process_total = 1
Then Open procgraphic; Fetch first from procgraphic
into processid;

Insert into target (process_id) values (processid) ;

Update p_id.p_id set proc_graphic_position = '1'
where p_id.p_id.process_id = processid;

Update p_id.p_id

set process_number = '1'

where p_id.p_id.process_id = processid;

Insert into size (P_1, P_2, pro_id) select
ST_area(st_envelope (graphics.spatial_ref.the_geom)), ST_area(st_envelope(
library.dgm_process.the_geom)),( processid) from graphics.spatial_ref,
library.dgm_process, p_id.p_id, processes_count where
graphics.spatial_ref.position_ = p_id.p_id.proc_graphic_position and
p_id.p_id.process_id = processid and p_id.p_id.p_id_id =
processes_count.p_id_id and library.dgm_process.process_number =
p_id.p_id.process_graphic_id; Update size Set factor =
sqrt(P_1) / sqrt (P_2) / 3.0 where size.pro_id = processid; Insert
into temp_(the_geom, ithe_geom, othe_geom, mthe_geom, ethe_geom, ip_target,
op_target, pro_id, graphic_id) Select st_scale
(library.dgm_process.the_geom, size.factor, size.factor), st_scale
(library.dgm_process.ithe_geom, size.factor, size.factor), st_scale
(library.dgm_process.othe_geom, size.factor, size.factor), st_scale
(library.dgm_process.mthe_geom, size.factor, size.factor),

st_scale (library.dgm_process.ethe_geom, size.factor, size.factor),
st_scale (library.dgm_process.ip_target, size.factor, size.factor),
st_scale (library.dgm_process.op_target, size.factor, size.factor),
(processid), (p_id.p_id.process_graphic_id) from library.dgm_process,
graphics.spatial_ref, size, p_id.p_id Where
graphics.spatial_ref.position_ = p_id.p_id.proc_graphic_position and
p_id.p_id.process_id = size.pro_id and size.pro_id = processid and
library.dgm_process.process_number = p_id.p_id.process_graphic_id; insert
into temp1 (the_geom, ithe_geom, othe_geom, mthe_geom, ethe_geom, ip_target,
op_target, pro_id, graphic_id) select st_translate (temp_.the_geom,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))), st_translate (temp_.ithe_geom,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))), st_translate (temp_.othe_geom,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))), st_translate (temp_.mthe_geom,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))),

st_translate (temp_.ethe_geom,

st_x (st_centroid(graphics.spatial_ref.the_geom)) -

st_x (st_centroid (temp_.the_geom)),

st_y (st_centroid(graphics.spatial_ref.the_geom))-

st_y (st_centroid (temp_.the_geom))), st_translate (temp_.ip_target,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))), st_translate (temp_.op_target,
st_x (st_centroid(graphics.spatial_ref.the_geom)) - st_x (st_centroid
(temp_.the_geom)), st_y (st_centroid(graphics.spatial_ref.the_geom))-
st_y (st_centroid (temp_.the_geom))), (processid),
(p_id.p_id.process_graphic_id) from temp_, graphics.spatial_ref,
p_id.p_id, processes_count --select extent(the_geom) as the_geom from
temp_) as old_ref where temp_.pro_id = processid and
p_id.p_id.process_id = processid and graphics.spatial_ref.position_ =
p_id.p_id.proc_graphic_position and p_id.p_id.p_id_id =
processes_count.p_id_id;

--

Bob

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#4)
Re: Restore problem

On Tuesday 28 December 2010 5:58:51 pm Bob Pawley wrote:

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 4:21 PM
To: pgsql-general@postgresql.org
Cc: Bob Pawley
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 3:06:40 pm Bob Pawley wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

This is in the plain text dump file right?

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

With out seeing an example that is going to be difficult :)

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain text
dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be used to
restore a plain text dump file created by pg_restore. I think you are going to
need show the steps you took.

I don't have a copy of what it was but here is something quite similar to
the style I had before the dump.-

The restore process does not destroy the input file, it should still be
available.

--
Adrian Klaver
adrian.klaver@gmail.com

#6Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#5)
Re: Restore problem

Yes I was just looking at it.

It seems that it was dumped in that form.

Any thoughts on how that could happen?? Not that it will help in this
instance.

Bob

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:09 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 5:58:51 pm Bob Pawley wrote:

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 4:21 PM
To: pgsql-general@postgresql.org
Cc: Bob Pawley
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 3:06:40 pm Bob Pawley wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

This is in the plain text dump file right?

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

With out seeing an example that is going to be difficult :)

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain text
dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be used
to
restore a plain text dump file created by pg_restore. I think you are going
to
need show the steps you took.

I don't have a copy of what it was but here is something quite similar to
the style I had before the dump.-

The restore process does not destroy the input file, it should still be
available.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#5)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:09 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 5:58:51 pm Bob Pawley wrote:

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 4:21 PM
To: pgsql-general@postgresql.org
Cc: Bob Pawley
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 3:06:40 pm Bob Pawley wrote:

Hi

I have restored a database using psql to windows version 8.4.

During the restore the trigger code became jumbled.

I now have a great number of lines that have moved so that they are now
included in lines the have been commented out – not to mention that the
code is hard to read.

This is in the plain text dump file right?

Is there some way of correcting this – or re restoring the database, so
that I don’t have to go through the whole code line by line?

With out seeing an example that is going to be difficult :)

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain text
dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be used
to
restore a plain text dump file created by pg_restore. I think you are going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

I don't have a copy of what it was but here is something quite similar to
the style I had before the dump.-

The restore process does not destroy the input file, it should still be
available.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#8Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#7)
Re: Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be used
to
restore a plain text dump file created by pg_restore. I think you are going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

--
Adrian Klaver
adrian.klaver@gmail.com

#9Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#8)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#10Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#9)
Re: Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.
--
Adrian Klaver
adrian.klaver@gmail.com

#11Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#10)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:06 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.

It looks the same.

Bob
--
Adrian Klaver
adrian.klaver@gmail.com

#12Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#10)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:06 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I would
like to know what happened so I can avoid it in the future.

Is the compressed file a better way to dump??

Bob
--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#13Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#11)
Re: Restore problem

On 12/28/2010 07:16 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:06 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to
dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.

It looks the same.

Bob

Well there goes that theory. Notepad is almost useless as a text editor
and is known for not wrapping lines correctly.

--
Adrian Klaver
adrian.klaver@gmail.com

#14Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#12)
Re: Restore problem

On 12/28/2010 07:27 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:06 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to
dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I
would like to know what happened so I can avoid it in the future.

I am not sure. If the file is not to big and you wish you can send it to
me off list and maybe I can figure out what is going on.

Is the compressed file a better way to dump??

Yes in this case because you can do a restore from within pgAdmin.

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

#15Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#14)
Re: Restore problem

-----Original Message-----
From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:33 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:27 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 7:06 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On 12/28/2010 07:05 PM, Bob Pawley wrote:

-----Original Message----- From: Adrian Klaver
Sent: Tuesday, December 28, 2010 6:51 PM
To: Bob Pawley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On Tuesday 28 December 2010 6:41:51 pm Bob Pawley wrote:

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

This is the plain text dump file through pg_admin dump. But the plain
text dump fie through psql restored in the same way.

I am not following. psql cannot create a dump file. It can however be
used
to
restore a plain text dump file created by pg_restore. I think you are
going
to
need show the steps you took.

I used PGAdmin to dump the June version and pg_dump mydb > db.sql to
dump
the May version.

Both came out with the same problems.

Bob

What program are you using to look at the plain text file?

Notepad

Bob

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I
would like to know what happened so I can avoid it in the future.

I am not sure. If the file is not to big and you wish you can send it to
me off list and maybe I can figure out what is going on.

The file is over 9 meg - way to large for me to e-mail.

It seems that this has affected just the triggers - although that is quite
massive I will just plug away at it until it's done

Thanks

Bob

Is the compressed file a better way to dump??

Yes in this case because you can do a restore from within pgAdmin.

Bob

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#16Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#15)
Re: Restore problem

On 12/28/2010 07:40 PM, Bob Pawley wrote:

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I
would like to know what happened so I can avoid it in the future.

I am not sure. If the file is not to big and you wish you can send it to
me off list and maybe I can figure out what is going on.

The file is over 9 meg - way to large for me to e-mail.

It seems that this has affected just the triggers - although that is
quite massive I will just plug away at it until it's done

Thanks

Bob

The triggers or functions? The sample you showed was from a function. My
suspicion is that this is a line ending problem
(http://en.wikipedia.org/wiki/Newline) and is a matter of finding the
correct conversion utility.

--
Adrian Klaver
adrian.klaver@gmail.com

#17Alan Hodgson
ahodgson@simkin.ca
In reply to: Adrian Klaver (#16)
Re: Restore problem

On December 28, 2010, Adrian Klaver <adrian.klaver@gmail.com> wrote:

On 12/28/2010 07:40 PM, Bob Pawley wrote:

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I
would like to know what happened so I can avoid it in the future.

It's often a good idea to maintain function definitions outside the database,
under version control, and apply them to the database from there.

Also, try a unix2dos utility on the text of the functions before giving up
and hand editing them.

--
A hybrid Escalade is missing the point much in the same way that having a
diet soda with your extra large pepperoni pizza is missing the point.

#18Bob Pawley
rjpawley@shaw.ca
In reply to: Alan Hodgson (#17)
Re: Restore problem

-----Original Message-----
From: Alan Hodgson
Sent: Tuesday, December 28, 2010 8:12 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Restore problem

On December 28, 2010, Adrian Klaver <adrian.klaver@gmail.com> wrote:

On 12/28/2010 07:40 PM, Bob Pawley wrote:

Open the file in Wordpad and see if it looks better.

I downloaded an sql editor and it looks the same in it as well.

At least the editor will make it easier to fix the problem. However I
would like to know what happened so I can avoid it in the future.

It's often a good idea to maintain function definitions outside the
database,
under version control, and apply them to the database from there.

I would appreciate a more detailed explanation of this.

Bob

Also, try a unix2dos utility on the text of the functions before giving up
and hand editing them.

I'll look at that - I'm also looking at something called Vim
http://www.vim.org/download.php

Bob

--
A hybrid Escalade is missing the point much in the same way that having a
diet soda with your extra large pepperoni pizza is missing the point.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#19Scott Marlowe
scott.marlowe@gmail.com
In reply to: Bob Pawley (#9)
Re: Restore problem

On Tue, Dec 28, 2010 at 8:05 PM, Bob Pawley <rjpawley@shaw.ca> wrote:

What program are you using to look at the plain text file?

Notepad

Did you at some point open the backup file with notepad, make a change
and then save it? If so notepad may have permanently mangled the
backup. If so, do you have an original unedited copy of the backup to
go to. If not, then I'm out of ideas.

#20Alan Hodgson
ahodgson@simkin.ca
In reply to: Bob Pawley (#18)
Re: Restore problem

On December 28, 2010, "Bob Pawley" <rjpawley@shaw.ca> wrote:

It's often a good idea to maintain function definitions outside the
database,
under version control, and apply them to the database from there.

I would appreciate a more detailed explanation of this.

Treat them like source code.

Bob

Also, try a unix2dos utility on the text of the functions before giving
up and hand editing them.

I'll look at that - I'm also looking at something called Vim
http://www.vim.org/download.php

vim is an excellent open source text editor. Which may fix your problem if
it's related to line endings.

--
A hybrid Escalade is missing the point much in the same way that having a
diet soda with your extra large pepperoni pizza is missing the point.

#21Jasen Betts
jasen@xnet.co.nz
In reply to: Bob Pawley (#1)
#22Alban Hertroys
dalroi@solfertje.student.utwente.nl
In reply to: Adrian Klaver (#13)
#23Alban Hertroys
dalroi@solfertje.student.utwente.nl
In reply to: Bob Pawley (#15)
#24Alban Hertroys
dalroi@solfertje.student.utwente.nl
In reply to: Alan Hodgson (#20)
#25Leif B. Kristensen
leif@solumslekt.org
In reply to: Alban Hertroys (#24)
#26Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Alban Hertroys (#22)
#27Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#18)
#28Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Leif B. Kristensen (#25)
#29Bob Pawley
rjpawley@shaw.ca
In reply to: Alban Hertroys (#23)
#30Bob Pawley
rjpawley@shaw.ca
In reply to: Adrian Klaver (#28)
#31John R Pierce
pierce@hogranch.com
In reply to: Leif B. Kristensen (#25)
#32Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Bob Pawley (#30)
#33Tim Bruce - Postgres
postgres@tbruce.com
In reply to: John R Pierce (#31)
#34Vincent Veyron
vv.lists@wanadoo.fr
In reply to: Tim Bruce - Postgres (#33)
#35Andrew Sullivan
ajs@crankycanuck.ca
In reply to: Vincent Veyron (#34)
#36Vincent Veyron
vv.lists@wanadoo.fr
In reply to: Andrew Sullivan (#35)