1

I have a table in redshift with following columns in create statement

ExpiryDate Timestamp without time zone          NULL Encode zstd,
IssueDate Timestamp without time zone           NULL Encode zstd,
RewardNumber varchar(64)                        NULL Encode zstd,
VoucherIdentifier varchar(64)                   NULL Encode zstd

Once I insert data into my table I can see NULL value for "ExpiryDate" and "IssueDate" but I have no clue why I am not able to see any NULL value for "RewardNumber" and "VoucherIdentifier". It simply shows blank for the two columns. I am using DBvisualizer to connect to redshift.

See Screenshot of my DBVisualizer

Am I doing something wrong when I am creating my tables

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
Saurabh Singh
  • 11
  • 1
  • 3
  • 1
    What SQL are you using to insert values into your table. Is it definitely inserting NULL values and not an empty string? You should also check the Properties for data formats in your query tool in case there is a setting to display null values are blank instead of the word "null". – Nathan Griffiths Feb 25 '19 at 20:43

1 Answers1

1

COPY has an optional parameter EMPTYASNULL.

Indicates that Amazon Redshift should load empty CHAR and VARCHAR fields as NULL. Empty fields for other data types, such as INT, are always loaded with NULL. Empty fields occur when data contains two delimiters in succession with no characters between the delimiters. EMPTYASNULL and NULL AS '' (empty string) produce the same behavior.

My hypothesis is that you didn't specify that option when loading your table.

Reference Data Conversion Parameters

MikeJRamsey56
  • 2,779
  • 1
  • 20
  • 34