[postgis-users] RV: How export a postgreSQL/GIS

Chris Hodgson chodgson at refractions.net
Thu Oct 24 10:05:30 PDT 2002


At first, it doesn't seem possible to use pg_dump to dump sequences - it says on the man page:

"pg_dump will save the information necessary to re-generate all user-defined types, functions, tables, indexes, aggregates, and operators."

That seems to be a rather complete list that doesn't contain "sequences" - in fact they aren't mentioned anywhere in the doc.

However, after more careful reading, sequences aren't treated as special entities by postgres, they are just tables on which the nextval, setval, etc. functions work. I guess because of their status as "sequences", -t "*" doesn't include them. However, if you either specify the name of the sequence specifically using -t seq_name or simply leave out the -t parameter altogether, sequences do get dumped (as tables, with setval() function calls afterward).

So try:
pg_dump -f tablas.sql ejercicio

And I think you will get everything dumped.

Chris
  ----- Original Message ----- 
  From: Juanse 
  To: postgis-users at postgis.refractions.net 
  Sent: Wednesday, October 23, 2002 9:45 PM
  Subject: [postgis-users] RV: How export a postgreSQL/GIS



  I am trying to export a postgreSQL/postGIS database to on other computer.

  we are doing a :
  pg_dump -t "*" -f tablas.sql ejercicio

  to prepare the table to ftp it.

  how ever we get everything out except the sequences on the new "tablas" database.

  what are we doing wrong? or better how we should do it?

  Juanse
  temuko-chile



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.401 / Virus Database: 226 - Release Date: 10/10/02
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20021024/44bebce6/attachment.html>


More information about the postgis-users mailing list