Re: How can I see IDENTITY columns?

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: Rob Richardson <interrobang(at)yahoo(dot)com>
Cc: "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: How can I see IDENTITY columns?
Date: 2018-08-08 18:38:26
Message-ID: CADK3HH+JAxSNf2x5MWSwmwiPBT=Vk6V73AxeSN-ZaM6L=AQVtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

The attribute table now has an attidentity column.
https://www.postgresql.org/docs/10/static/catalog-pg-attribute.html

Curious why are you using with oid's

Dave Cramer

On 8 August 2018 at 14:16, Rob Richardson <interrobang(at)yahoo(dot)com> wrote:

> I just learned about IDENTITY columns in PostgreSQL 10. I am working on
> upgrading a database for an upcoming major revision of my company's
> software package, and I want to make all of the columns defined as "serial"
> or "bigserial" IDENTITY columns. I found a nice web page with a function
> that will do that. The problem I am running into is that I can't see
> IDENTITY columns in pgAdmin. I've tried both in pgAdmin 4 and in BigSQL's
> version as shipped with its implementation of PostgreSQL 10.3. After
> running the function, pgAdmin shows me the following CREATE script for my
> table:
>
> CREATE TABLE public.alarm_comments
> (
> key bigint NOT NULL,
> alarm_key smallint,
> alarm_comment character varying(256) COLLATE pg_catalog."default",
> updated_by character varying(16) COLLATE pg_catalog."default",
> updated_date timestamp with time zone DEFAULT ('now'::text)::timestamp(6) with time zone,
> CONSTRAINT alarm_comments_pkey PRIMARY KEY (key)
> )
> WITH (
> OIDS = TRUE
> )
> TABLESPACE pg_default;
>
> ALTER TABLE public.alarm_comments
> OWNER to postgres;
>
> psql, on the other hand, shows me this:
>
> Stripco for Conversion=# \d alarm_comments
> Table "public.alarm_comments"
> Column | Type | Collation | Nullable |
> Default
> ---------------+--------------------------+-----------+----------+--------------
> ------------------------------
> key | bigint | | not null | generated by
> default as identity
> alarm_key | smallint | | |
> alarm_comment | character varying(256) | | |
> updated_by | character varying(16) | | |
> updated_date | timestamp with time zone | | | ('now'::text)
> ::timestamp(6) with time zone
> Indexes:
> "alarm_comments_pkey" PRIMARY KEY, btree (key)
>
> I need to be able to see the IDENTITY in pgAdmin, since that's what we use
> for all of our database administration. If I can't see that a column is an
> IDENTITY column, then I may not be able to use IDENTITY columns at all.
>
>

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Rob Richardson 2018-08-08 19:52:27 Re: How can I see IDENTITY columns?
Previous Message Rob Richardson 2018-08-08 18:16:41 How can I see IDENTITY columns?