Change Existing Column to Serial in Postgres

Change Existing Column to Serial in Postgres In order to change an existing column in a Postgres table to a serial column where the ID autoincrements, you need to: 1) Create the SEQUENCE that is used behind the scenes. 2) Assign the SEQUENCE to the COLUMN 3) Find the...

Postgres Upsert On Conflict Where Clause

Postgres Upsert On Conflict Where Clause A basic example of a Postgres Upsert using “on conflict do update” with a where clause.    Postgres Upsert ON CONFLICT with WHERE clause create table z_test( f1 text PRIMARY KEY, f2 text, f3 text, f4...

Location of PostgresSQL Data Files Windows 7

Location of PostgresSQL Data Files Windows 7 I recently lost my motherboard but still had a functional HDD. I wanted to re-install Postgres once I got my new machine but needed to continue to use the existing data files from my Postgres database. The data files were...

Pin It on Pinterest