Postgres Vector db insert Unsuccesful

I’m trying to insert OpenAI embeddings into a PostgreSQL table using the Create Embeddings node in n8n. Everything works with the Simple Vector Store, but the PostgreSQL workflow fails with schema mapping issues.

I consistently get:
Error inserting: column “content” of relation “viko_embeddings_openai” does not exist

My Setup

  • PostgreSQL table: viko.viko_embeddings_openai
    Column | Type | Nullable
    — |----------|----------
    id | integer | NOT NULL (matches chat message id)
    content | text |
    metadata | jsonb |
    embedding | vector(1536) |

Workflow structure :

  1. Set ID node — creates .message_id, .timestamp, .text, etc.
  2. Default Document Loader — maps:
    * Data: {{ $(‘Set id’).item.json.text }}
    * Metadata:
    • id: {{ $(‘Set id’).item.json.message_id | parseInt }}
    • timestamp, agent_id, role: valid values
  3. Recursive Character Text Splitter
  4. Embeddings OpenAI
  5. Create Embeddings — targets viko.viko_embeddings_openai with:
    * ID Column: id
    * Content Column: content
    * Metadata Column: metadata
    * Vector Column: embedding

What I’ve Already Tried

  • Renamed the content column in the table.
  • Switched from dynamic expressions to using document metadata.
  • Inserted id as both dynamic field and metadata to satisfy NOT NULL.
  • Ensured db user has full access to schema viko.
  • Confirmed output of each node is correct (via Execute step and JSON preview).

What I Need Help With

• Is there a known limitation with Create Embeddings and schema-qualified table?
• Does the Default Document Loader + Create Embeddings node reliably route fields like id, content, metadata, and embedding if they are inside metadata?
• Any working example of inserting embeddings into Postgres with custom schema?

Also - In the Default Document Loader and Text Splitter, the document output always includes a field called pageContent (camelCase). However, PostgreSQL does not allow camelCase column names unless quoted, and it’s causing issues when inserting into my content column.

Is there a way to change or remap the pageContent field name to match my content column?

Or alternatively, how does the Create Embeddings node handle this mismatch?

I’ve already tried renaming my database column to pagecontent and content, but no variation seems to get picked up properly by the Create Embeddings node when pageContent is used as the output by upstream nodes.

Is pageContent hardcoded in the embeddings flow? And if so, what’s the best workaround?

Screenshots

I’ve attached:
• Table schema
• Default Document Loader setup
• Create Embeddings configuration
• Error output after execution

Thanks in advance - I’ve spent over two days trying every angle, and am really looking forward to getting this working properly.





Hey @viko ,

Up for a quick call?

I have some time, will try to solve the issue.

Hey @Sudhanshu_Sharma this was unexpected, thanks for being so quick.

I was so bummed with this and posted just to hopefully check weeks later if someone would found solution.

Let me know when it would work for you, I’d love to hop on a call to solve this!

1 Like

SOLVED.
I let the n8n create the table (I did previously manually) and it wanted some specifications in the default section of uuid column to work.

Let the system automatically create the table and then move it to desired location!

1 Like

@viko

Great to know it worked!

Sorry, I missed your last message…didn’t get a notification.

Quick tip: Next time, try tagging with @ so we get notified and don’t miss it. :blush:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.