You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article talks about the advantages of passing one-dimensional arrays and combining them on the PG side via unnest. But it is inconvenient to collect one-dimensional arrays on the application side. It is convenient to put them into a structure and then put it into an array. Is it possible to come up with something to easily get single arrays for passing from an array of structures? Or pass an array of structures to the pgx driver function, and it will cut it into single arrays itself.
The text was updated successfully, but these errors were encountered:
In most cases, COPY should be preferred as it provides the best performance. If COPY cannot be used, such as when ON CONFLICT is needed then pgx's batch functionality should be preferred as that works with ON CONFLICT and provides feedback about what happened to each row.
It is unusual that this array / unnest pattern is the optimal approach and it's unlikely pgx will include helpers for this specific use case.
This article talks about the advantages of passing one-dimensional arrays and combining them on the PG side via unnest. But it is inconvenient to collect one-dimensional arrays on the application side. It is convenient to put them into a structure and then put it into an array. Is it possible to come up with something to easily get single arrays for passing from an array of structures? Or pass an array of structures to the pgx driver function, and it will cut it into single arrays itself.
The text was updated successfully, but these errors were encountered: