fix(Postgres Node): RMC do not mark collumn as required if identity_generation is BY DEFAULT (#13752)

Co-authored-by: Dana <152518854+dana-gill@users.noreply.github.com>
This commit is contained in:
Michael Kret
2025-03-13 07:35:50 +02:00
committed by GitHub
parent ec8a719efa
commit b5632545c5
7 changed files with 149 additions and 9 deletions

View File

@@ -241,6 +241,10 @@ export async function execute(
const outputColumns = this.getNodeParameter('options.outputColumns', i, ['*']) as string[];
if (nodeVersion >= 2.6 && Object.keys(item).length === 0) {
query = 'INSERT INTO $1:name.$2:name DEFAULT VALUES';
}
[query, values] = addReturning(query, outputColumns, values);
queries.push({ query, values });

View File

@@ -8,7 +8,7 @@ export const versionDescription: INodeTypeDescription = {
name: 'postgres',
icon: 'file:postgres.svg',
group: ['input'],
version: [2, 2.1, 2.2, 2.3, 2.4, 2.5],
version: [2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6],
subtitle: '={{ $parameter["operation"] }}',
description: 'Get, add and update data in Postgres',
defaults: {

View File

@@ -74,7 +74,9 @@ export async function getMappingColumns(
const options =
type === 'options' ? getEnumValues(enumInfo, col.udt_name as string) : undefined;
const hasDefault = Boolean(col.column_default);
const isGenerated = col.is_generated === 'ALWAYS' || col.identity_generation === 'ALWAYS';
const isGenerated =
col.is_generated === 'ALWAYS' ||
['ALWAYS', 'BY DEFAULT'].includes(col.identity_generation ?? '');
const nullable = col.is_nullable === 'YES';
return {
id: col.column_name,