Thread:

From
"Christopher Kings-Lynne"
Date:
Hi,

In postgresql 7.3.1, if I do pg_dumpall -c, at the top of the dump file is
this:

DROP DATABASE au_shipping
;CREATE DATABASE au_shipping WITH OWNER = auadmin TEMPLATE = template0
ENCODING = 'SQL_ASCII';
DROP DATABASE au_test
;CREATE DATABASE au_test WITH OWNER = chriskl TEMPLATE = template0 ENCODING
= 'SQL_ASCII';
DROP DATABASE australia
;CREATE DATABASE australia WITH OWNER = auadmin TEMPLATE = template0
ENCODING = 'SQL_ASCII';
DROP DATABASE geeklog
;CREATE DATABASE geeklog WITH OWNER = chriskl TEMPLATE = template0 ENCODING
= 'SQL_ASCII';
DROP DATABASE keystone
;CREATE DATABASE keystone WITH OWNER = chriskl TEMPLATE = template0 ENCODING
= 'SQL_ASCII';

Why are all the CREATE DATABASE statements commented out?  Surely that will
make the restore fail?

Chris



Re:

From
Devrim GUNDUZ
Date:
Hi,


On Thu, 2003-01-16 at 10:13, Christopher Kings-Lynne wrote:

> In postgresql 7.3.1, if I do pg_dumpall -c, at the top of the dump file is
> this:
> 
> DROP DATABASE au_shipping
> ;CREATE DATABASE au_shipping WITH OWNER = auadmin TEMPLATE = template0
> ENCODING = 'SQL_ASCII';
> DROP DATABASE au_test
> ;CREATE DATABASE au_test WITH OWNER = chriskl TEMPLATE = template0 ENCODING
> = 'SQL_ASCII';
> DROP DATABASE australia
> ;CREATE DATABASE australia WITH OWNER = auadmin TEMPLATE = template0
> ENCODING = 'SQL_ASCII';
> DROP DATABASE geeklog
> ;CREATE DATABASE geeklog WITH OWNER = chriskl TEMPLATE = template0 ENCODING
> = 'SQL_ASCII';
> DROP DATABASE keystone
> ;CREATE DATABASE keystone WITH OWNER = chriskl TEMPLATE = template0 ENCODING
> = 'SQL_ASCII';
> 
> Why are all the CREATE DATABASE statements commented out?  Surely that will
> make the restore fail?

Just guessing:

The first line does not have a ; at the end; so the first semicolon (at
the beginning of second line) will end the first line; will not comment
the CREATE DATABASE line...

I mean, it might work as below:
DROP DATABASE au_shipping;

CREATE DATABASE au_shipping WITH OWNER = auadmin TEMPLATE = template0
ENCODING = 'SQL_ASCII';

?

Best regards,
-- 
Devrim GUNDUZ 
TR.NET Sistem Destek Uzmani

Tel : (312) 295 93 18  Fax : (312) 295 94 94 Tel : (216) 542 90 00



Re:

From
"Christopher Kings-Lynne"
Date:
You're right.  It's a type in pg_dumpall.c

I have attached a fix for it.

Chris

> > ;CREATE DATABASE keystone WITH OWNER = chriskl TEMPLATE =
> template0 ENCODING
> > = 'SQL_ASCII';
> >
> > Why are all the CREATE DATABASE statements commented out?
> Surely that will
> > make the restore fail?
>
> Just guessing:
>
> The first line does not have a ; at the end; so the first semicolon (at
> the beginning of second line) will end the first line; will not comment
> the CREATE DATABASE line...
>
> I mean, it might work as below:
> DROP DATABASE au_shipping;
>
> CREATE DATABASE au_shipping WITH OWNER = auadmin TEMPLATE = template0
> ENCODING = 'SQL_ASCII';


Attachment

Re:

From
Tom Lane
Date:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> You're right.  It's a type in pg_dumpall.c

A harmless typo --- the lines aren't "commented out" (I think your
assembly-language background is showing ;-)).  But it is pretty ugly
output all the same.  Have applied the patch.

            regards, tom lane

Re:

From
mlw
Date:
I don't think a semicolon is a comment. It causes the execution of the 
previous statement.

Christopher Kings-Lynne wrote:

>Hi,
>
>In postgresql 7.3.1, if I do pg_dumpall -c, at the top of the dump file is
>this:
>
>DROP DATABASE au_shipping
>;CREATE DATABASE au_shipping WITH OWNER = auadmin TEMPLATE = template0
>ENCODING = 'SQL_ASCII';
>DROP DATABASE au_test
>;CREATE DATABASE au_test WITH OWNER = chriskl TEMPLATE = template0 ENCODING
>= 'SQL_ASCII';
>DROP DATABASE australia
>;CREATE DATABASE australia WITH OWNER = auadmin TEMPLATE = template0
>ENCODING = 'SQL_ASCII';
>DROP DATABASE geeklog
>;CREATE DATABASE geeklog WITH OWNER = chriskl TEMPLATE = template0 ENCODING
>= 'SQL_ASCII';
>DROP DATABASE keystone
>;CREATE DATABASE keystone WITH OWNER = chriskl TEMPLATE = template0 ENCODING
>= 'SQL_ASCII';
>
>Why are all the CREATE DATABASE statements commented out?  Surely that will
>make the restore fail?
>
>Chris
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo@postgresql.org so that your
>message can get through to the mailing list cleanly
>
>  
>