Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import CSV file, empty string are managed as empty string in column instead of NULL after upgrade 8.13 #8155

Open
pentolone opened this issue Nov 20, 2024 · 7 comments
Assignees
Labels

Comments

@pentolone
Copy link

Importing csv file with empty string risult in empty string in table too.

To Reproduce

  1. Create table with 1 TEXT column,
  2. Create csv file (comma separated) with empty string like ,,
  3. Click on import
  4. Verify that the column in table has empty string insetad of NULL.

Expected behavior

Empty string stored as NULL value in table columns

@pentolone pentolone added the Bug label Nov 20, 2024
@pentolone
Copy link
Author

database server version 15

@adityatoshniwal
Copy link
Contributor

@pentolone
Below is what we've tried and the output from the table. If you're using quotes then it will be considered as empty string. Blank is take as NULL.

image image

@pentolone
Copy link
Author

Thank for the answer, but we have null values NOT at the end of line, but in the middle.
Something like

adi,,last

Result in table should be adi|null|last but we have adi||last

@adityatoshniwal
Copy link
Contributor

adityatoshniwal commented Nov 25, 2024

@pentolone It doesn't matter where the position is, its working fine:
image

image

@pentolone
Copy link
Author

I tested again just now, we are using pgadmin4 in server mode.

This is the example, I used pgadmin4 interface Import/Export options without changing anything but the column separator

itemcode,unitload,lotto,datascadenza,dataproduzione,qty,aqty,scaffale
202117,MF0131736,AB245BL0724,01/06/2026,,200,,M1BU00000002

This is the result
BlankLine

@adityatoshniwal
Copy link
Contributor

adityatoshniwal commented Nov 25, 2024

@pentolone I tested for on pgAdmin v8.13. What is the version you're using?
Also, can you share the table ddl please?

@pentolone
Copy link
Author

Hi, these are details:

Version: 8.13
Commit: b278265 2024-11-11
Application Mode: Server
Operating System: Alpine Linux v3.20, Linux-5.10.0-23-amd64-x86_64-with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants