pg_dump

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

This is the example found in the documentation to dump a database.

"Examples
To dump a database:

$ pg_dump mydb > db.out"The following - $ pg_dump aurel > aurel.out - gives me "ERROR: syntax error at or near "$" at character 1"What am I missing???Bob

#2Bricklen Anderson
banderson@presinet.com
In reply to: Bob Pawley (#1)
Re: pg_dump

Bob Pawley wrote:

This is the example found in the documentation to dump a database.

"Examples

To dump a database:

$ pg_dump mydb > db.out"

The following - $ pg_dump aurel > aurel.out - gives me

"ERROR: syntax error at or near "$" at character 1"

What am I missing???

Bob

The "$" is part of the OS prompt. Windows would look something like
"c:\pg_dump mydb > db.out". Omit the "$" and it should be fine.

#3Konrad Neuwirth
k.neuwirth@gmail.com
In reply to: Bob Pawley (#1)
Re: pg_dump

To dump a database: $ pg_dump mydb > db.out"
The following - $ pg_dump aurel > aurel.out - gives me
"ERROR: syntax error at or near "$" at character 1"
What am I missing???

The $ character is there to indicate the prompt your shell gives you.
If you leave it off at the beginning of your command, things should
just run fine.

Konrad

#4Richard Broersma Jr
rabroersma@yahoo.com
In reply to: Bob Pawley (#1)
Re: pg_dump

"Examples
To dump a database:

$ pg_dump mydb > db.out"The following - $ pg_dump aurel > aurel.out - gives me "ERROR: syntax
error at or near "$" at character 1"What am I missing???Bob

The $ isn't part of the command, it just just part of the shell's command-line prompt.

My shell command line prompt looks like this:

richard@db_server01 ~ $

if i want to jump a database then I would type the following command after the prompt:

richard@db_server01 ~ $ pg_dump mydb > db.out

Regards,

Richard Broersma Jr.

#5Bob Pawley
rjpawley@shaw.ca
In reply to: Bob Pawley (#1)
Re: pg_dump

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

I've had a bit of trouble with the PostgreSQL system if that helps. (access
violation with a reinstall)

Bob

----- Original Message -----
From: "Konrad Neuwirth" <k.neuwirth@gmail.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Thursday, November 23, 2006 1:45 PM
Subject: Re: [GENERAL] pg_dump

Show quoted text

To dump a database: $ pg_dump mydb > db.out"
The following - $ pg_dump aurel > aurel.out - gives me
"ERROR: syntax error at or near "$" at character 1"
What am I missing???

The $ character is there to indicate the prompt your shell gives you.
If you leave it off at the beginning of your command, things should
just run fine.

Konrad

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#6James Cradock
jcradock@me3.com
In reply to: Bob Pawley (#5)
Re: pg_dump

Bob,

This command:

pg_dump aurel

...should output the structure and contents of your "aurel" database to
your screen SQL with comments.

What version of PostgreSQL are you running and on what operating system?

Jim

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

I've had a bit of trouble with the PostgreSQL system if that helps.
(access
violation with a reinstall)

Bob

----- Original Message -----
From: "Konrad Neuwirth" <k.neuwirth@gmail.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Thursday, November 23, 2006 1:45 PM
Subject: Re: [GENERAL] pg_dump

To dump a database: $ pg_dump mydb > db.out"
The following - $ pg_dump aurel > aurel.out - gives me
"ERROR: syntax error at or near "$" at character 1"
What am I missing???

The $ character is there to indicate the prompt your shell gives you.
If you leave it off at the beginning of your command, things should
just run fine.

Konrad

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

-----
James Cradock, jcradock@me3.com

#7Richard Broersma Jr
rabroersma@yahoo.com
In reply to: Bob Pawley (#5)
Re: pg_dump

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

I've had a bit of trouble with the PostgreSQL system if that helps. (access
violation with a reinstall)

that is a psql error message isn't it. pg_dump is a shell command that you would from from your
DOS or shell prompt.

that is what the "$" was trying to imply.

Regards,

Richard Broersma Jr.

#8Peter Wilson
petew@yellowhawk.co.uk
In reply to: Bob Pawley (#5)
Re: pg_dump

Bob Pawley wrote:

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

Looks like you're trying to run it from psql. pg_dump is a command line
utility. Run it directly from the shell command prompt (or cmd window on
windows).

Pete

I've had a bit of trouble with the PostgreSQL system if that helps.
(access violation with a reinstall)

Bob

----- Original Message ----- From: "Konrad Neuwirth"
<k.neuwirth@gmail.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Thursday, November 23, 2006 1:45 PM
Subject: Re: [GENERAL] pg_dump

To dump a database: $ pg_dump mydb > db.out"
The following - $ pg_dump aurel > aurel.out - gives me
"ERROR: syntax error at or near "$" at character 1"
What am I missing???

The $ character is there to indicate the prompt your shell gives you.
If you leave it off at the beginning of your command, things should
just run fine.

Konrad

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

--
------------------------------------------------------------------------
Peter Wilson
T: 01414 160505
M: 07796 656566
http://www.yellowhawk.co.uk The information in this email is
confidential and is intended for the addressee/s only. Access to this
email by anyone else is unauthorised. If you are not the intended
recipient, you must not read, use or disseminate the information
contained in or attached to this email.

#9James Cradock
jcradock@me3.com
In reply to: James Cradock (#6)
Re: pg_dump

Sorry.

The command will output ... *AS* SQL with comments.

Bob,

This command:

pg_dump aurel

...should output the structure and contents of your "aurel" database to
your screen SQL with comments.

What version of PostgreSQL are you running and on what operating system?

Jim

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

I've had a bit of trouble with the PostgreSQL system if that helps.
(access
violation with a reinstall)

Bob

----- Original Message -----
From: "Konrad Neuwirth" <k.neuwirth@gmail.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Thursday, November 23, 2006 1:45 PM
Subject: Re: [GENERAL] pg_dump

To dump a database: $ pg_dump mydb > db.out"
The following - $ pg_dump aurel > aurel.out - gives me
"ERROR: syntax error at or near "$" at character 1"
What am I missing???

The $ character is there to indicate the prompt your shell gives you.
If you leave it off at the beginning of your command, things should
just run fine.

Konrad

---------------------------(end of
broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

-----
James Cradock, jcradock@me3.com

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

-----
James Cradock, jcradock@me3.com

#10Richard P. Welty
rwelty@mycelery.com
In reply to: Bob Pawley (#5)
Re: pg_dump

Bob Pawley wrote:

No joy

pg_dump aurel > aurel.out

Returns -
ERROR: syntax error at or near "pg_dump" at character 8

I've had a bit of trouble with the PostgreSQL system if that helps.
(access violation with a reinstall)

how about giving the pg_dump command to a shell instead of inside
psql?

richard