serial column detection

From: Linos <info(at)linos(dot)es>
To: pgadmin-support(at)postgresql(dot)org
Subject: serial column detection
Date: 2012-10-25 18:35:08
Message-ID: 5089865C.5000808@linos.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi!,
how detects PgAdmin when it should show a column as "type" serial? i am trying
to replicate in a existing table the conditions to get shown as serial but i
don't get it.

I had a table like this:

CREATE TABLE test
(
test_id integer NOT NULL,
CONSTRAINT test_pkey PRIMARY KEY (test_id),
);

that i would like to see as:

CREATE TABLE test
(
test_id serial NOT NULL,
CONSTRAINT test_pkey PRIMARY KEY (test_id),
);

i have tried with:

CREATE SEQUENCE test_test_id_seq;
ALTER TABLE test ALTER COLUMN test_id SET DEFAULT
nextval('test_test_id_seq'::regclass);
ALTER SEQUENCE test_test_id_seq OWNED BY test.test_id;

and now i have this table:

CREATE TABLE test
(
test_id integer NOT NULL DEFAULT nextval('test_test_id_seq'::regclass),
CONSTRAINT test_pkey PRIMARY KEY (test_id),
);

What should i do? Thanks!

Regards,
Miguel Angel.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Chris St Denis 2012-10-25 22:08:43 bug report: All queries incorrectly shown as blocking in server status
Previous Message Andrzej Zawadzki 2012-10-24 15:39:36 Problem with pgadmin3 1.16.0