Re: Lookup tables

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Lookup tables
Date: 2025-02-04 19:08:42
Message-ID: 4c55f93-bff-a452-69da-6db5a5a33b33@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

On Tue, 4 Feb 2025, Rob Sargent wrote:

> Unless your lookup tables are huge I would create a new table matching
> your current table but with an identity column and load from you original
> table.

I created a new table:

create table ind_types_lu (
ind_nbr serial primary key,
ind_name varchar(32) not null
);

Now the database has the new table and a new sequence:

public | ind_types_lu | table | rshepard
public | ind_types_lu_ind_nbr_seq | sequence | rshepard

I want to replace the old lookup table (with no FK) with this one. Can I
use:

alter table rename ind_types_lu to industrytypes;

and have the sequence name changed, too?

TIA,

Rich

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message David G. Johnston 2025-02-04 19:11:25 Re: Lookup tables
Previous Message Krishnendu Dasgupta 2025-02-04 19:05:53 PGAdmin Desktop Docker Setup

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2025-02-04 19:11:25 Re: Lookup tables
Previous Message Thiemo Kellner 2025-02-04 19:03:27 Re: Lookup tables