Re: Support for grabbing multiple consecutive values with nextval()

From: Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>
To: Jille Timmermans <jille(at)quis(dot)cx>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Support for grabbing multiple consecutive values with nextval()
Date: 2022-07-13 13:47:13
Message-ID: 12014130.O9o76ZdvQC@aivenronan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It is Friday here, so I would easily miss something.. It is possible
> to use COPY FROM with a list of columns, so assuming that you could
> use a default expression with nextval() or just a SERIAL column not
> listed in the COPY FROM query to do the job, what do we gain with this
> feature? In which aspect does the preallocation of a range handled
> on the client side after being allocated in the backend make things
> better?

The problem the author wants to solve is the fact they don't have a way of
returning the ids when using COPY FROM. Pre-allocating them and assigning them
to the individual records before sending them via COPY FROM would solve that
for them.

--
Ronan Dunklau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-13 13:57:38 Re: Building PostgreSQL in external directory is broken?
Previous Message Aleksander Alekseev 2022-07-13 13:36:32 Re: Building PostgreSQL in external directory is broken?