Search Postgresql Archives

Re: Lookup tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux