Postgres Inner join insert into and select from syntax Postgres Inner join insert into and select from syntax postgresql postgresql

Postgres Inner join insert into and select from syntax


The order of columns in the target table probably doesn't match the order of columns in your select. This is a very good example on why you should always specify the column list in an insert statement:

INSERT INTO dbo.forgot_password_tokens   (forgot_password_tokens_id, updated_at, contact_details_id, users_id)SELECT ...FROM ...