SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem Backing Up and Restoring Databases with pgAdmin 3 (1.10.0)

    I'm having an issue with backing up and restoring databases with pgAdmin 3 (1.10.0). The problem is with how pgAdmin is converting every "serial" type column to it's "int" equivalent.

    For example the following table:

    Code:
    CREATE TABLE users_ranks
    (
      id serial NOT NULL,
      rank character varying(10) NOT NULL,
      CONSTRAINT users_ranks_pkey PRIMARY KEY (id)
    )
    Is converted to this after the dumb/restore:

    Code:
    CREATE TABLE users_ranks
    (
      id integer NOT NULL DEFAULT nextval(('public.users_ranks_id_seq'::text)::regclass),
      rank character varying(10) NOT NULL,
      CONSTRAINT users_ranks_pkey PRIMARY KEY (id)
    )
    In the past I've been backing up the databases as SQL files, editing the backup SQL to blow away the the DEFAULT crap and change the columns back to their orignal "serial" type. This is, of course, a giant pain in my ***.

    Is there something I'm doing wrong or is this a bug?

  2. #2
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    not a lot of pgAdmin users here...
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •