I'm curious to know if there's a way to include the S3 key as a column in my Redshift table when using the COPY command. I've been unable to find a solution that does not require including the S3 key within the actual S3 file, which isn't always feasible. This limitation feels like a significant oversight. Are there any workarounds or suggestions?
1 Answer
If you're using an external table that's backed by S3, you can simply add `$path` to your select statement to get the S3 file name. It automatically includes the path for you!

I see, but I'm working with an actual S3 file, not an external table setup. This might not apply to my case.