You just need to add a
RETURNING id to your
INSERT ... SELECT:
WITH rows AS (...)
INSERT INTO dealer (user_id)
- Postgres DB Size Command
- Export specific rows from a PostgreSQL table as INSERT SQL script
- How do I query using fields inside the new PostgreSQL JSON datatype?
- postgresql: INSERT INTO … (SELECT * …)
- PostgreSQL: insert from another table
- Bulk/batch update/upsert in PostgreSQL
- SQL Populate table with random data
- What is the maximum number of columns in a PostgreSQL select query
- PostgreSQL: Sub-select inside insert
- Difference between RESTRICT and NO ACTION
- postgres: upgrade a user to be a superuser?
- Exporting data In SQL Server as INSERT INTO
- How to get the top 10 values in postgresql?
- How can I add a column that doesn’t allow nulls in a Postgresql database?
- Check if value exists in Postgres array
- Extract date (yyyy/mm/dd) from a timestamp in PostgreSQL
- Escaping keyword-like column names in Postgres
- How to extract year and month from date in PostgreSQL without using to_char() function?
- Copy table structure into new table
- how to exclude null values in array_agg like in string_agg using postgres?
- How to implement a many-to-many relationship in PostgreSQL?
- postgresql return 0 if returned value is null
- Double colon `::` notation in SQL
- Generating time series between two dates in PostgreSQL
- Postgresql aggregate array
- PostgreSQL IF statement
- Sort by column ASC, but NULL values first?
- Insert data in 3 tables at a time using Postgres
- How can you get the active users connected to a postgreSQL database via SQL?
- How to drop all NOT NULL constraints from a PostgreSQL table in one go
- PostgreSQL: Create schema in specific database
- Optimize GROUP BY query to retrieve latest row per user
- How do you find results that occurred in the past week?
- To ignore duplicate keys during ‘copy from’ in postgresql
- Counting the number of occurrences of a substring within a string in PostgreSQL
- What is the fastest way to truncate timestamps to 5 minutes in Postgres?
- PL/pgSQL checking if a row exists
- How to format bigint field into a date in Postgresql?
- How to use SQL LIKE condition with multiple values in PostgreSQL?
- Concatenate multiple rows in an array with SQL on PostgreSQL
- GROUP BY + CASE statement
- PostgreSQL sequence based on another column
- psql: server closed the connection unexepectedly
- Insert Data Into Tables Linked by Foreign Key
- Conditional SQL count
- Update column value PostgreSQL
- Stop (long) running SQL query in PostgreSQL when session or requests no longer exist?
- How to get week start and end date string in PostgreSQL?
- Using an environment variable in a PSQL script
- How to create simple fuzzy search with PostgreSQL only?