LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   executing pg_dump? (https://www.linuxquestions.org/questions/linux-newbie-8/executing-pg_dump-239289/)

vickr1z 10-06-2004 12:27 AM

executing pg_dump?
 
good day to all.

anyone knows how to dump a data from PostgresQL server to my local computer?

i read the pg_dump --help and executing this command:
pg_dump -h 127.10.0.102 -U postgres mydata

but then i dont know where the mydata database goes. coz i tried this command:

postgres@Trinity:~$ psql mydata

and gives me error:

Code:

psql: FATAL: Database "mydata" does not exist in the system catalog.
can anyone help me out here?

thanks in advance.

Tinkster 10-06-2004 01:25 AM

Well ... I'm not quite sure about what you're trying to
achieve ... pg_dump is a backup utility for postgres
databases. It appears that there's no database by
the name of mydata on your machine.



Cheers,
Tink

vickr1z 10-06-2004 02:22 AM

Quote:

Originally posted by Tinkster
Well ... I'm not quite sure about what you're trying to
achieve ... pg_dump is a backup utility for postgres
databases. It appears that there's no database by
the name of mydata on your machine.



Cheers,
Tink

i want to backup mydata to my machine coming from remote PostgresQL server -127.0.10.102-

michaelk 10-06-2004 06:54 AM

http://www.postgresql.org/docs/7.3/static/backup.html

Do you want to backup the data to a file or copy the database to your local PC postgres server?

vickr1z 10-06-2004 08:45 AM

Quote:

Originally posted by michaelk
http://www.postgresql.org/docs/7.3/static/backup.html

Do you want to backup the data to a file or copy the database to your local PC postgres server?

thanks for reply mickaelk.
i want to copy the database to my local PC postgres server..

i have see how to do it now, by issuing the command:
Code:

psql -U vvbuen -f polmap_akbayan.sql polmap_akbayan
but then i have this erorrs while the script was running and building for my polmap_akbayan database..

Code:

NOTICE: CREATE TABLE will create implicit sequence 'cc_encodersee_cocv_id_seq'  for SERIAL column 'cc_encodersee_2003_cocv_id_seq.cc_encodersee_id'
ERROR:  language 'plpgsql' does not exist
ERROR:  Namespace 'gac_old' does not exist
ERROR:  REVOKE: function get_rate(character varying) does not exist
ERROR:  GRANT: function get_rate(character varying) does not exist

do u also have idea about the error on REVOKE: function get_rate?

this are some line content of my sql script:
Code:

-- TOC entry 303 OID (4720023)
-- Name get_rate (character varying); Type: function; Schema: public; Owner: vvbuen

CREATE FUNCTION get_rate (character varying) RETURNS numeric;
  AS '
  DECLARE
      table_name_ ALIAS FOR $1;
      rate_value_ NUMBERIC ;
  BEGIN
      SELECT encoding_rate into rate_value_ FROM encoding_rates WHERE table_name = table_name_ ;
      RETURN rate_value_;
  END
'
    LANGUAGE plpgsql STRICT;

-- TOC entry 304 OID (4720023)
-- Name: get_rate (character varying); Type: ACL; Schema: public; Owner: vvbuen

REVOKE ALL ON FUNCTION rate_value (character varying) FROM PUBLIC;
GRANT AL ON FUNCTION rate_value (character varying) TO PUBLIC;

is the error caused by the plpgsql itself? i dont know about anything on plpgsql. how can i setup this?

Hoping again someone could give me a helping hand... thanks in advance.

michaelk 10-06-2004 09:04 AM

I haven't used plpgsql yet.

http://www.phpfreaks.com/postgresqlm...e/plpgsql.html

Tinkster 10-06-2004 11:39 AM

Quote:

Originally posted by vickr1z
i want to backup mydata to my machine coming from remote PostgresQL server -127.0.10.102-
You can't run pg_dump against a remote database,
it doesn't have any options for remote connections.

Log into the other box, run pg_dump and then scp
the result back to your box.



Cheers,
Tink


All times are GMT -5. The time now is 12:23 PM.