public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Lookup tables
Date: Tue, 4 Feb 2025 11:08:42 -0800 (PST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

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





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Lookup tables
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox