Case:
I have csv data extract to be loaded with a great COPY INTO and also have a csv file with table description.
I want to create table from this description file before loading data.
Q:Is it possible to create a table by using description file?
I looked at 'CREATE TABLE mytable FROM LOADER myloader();' example but it does not seem support additional attributes to define columns.
One solution I know is to create a Python function to parse file and generate ddl statement but was curios if it can be done easier way.
Idea for enhancement: COPY INTO would be expanded to support creating tables at the same time by adding description file as another parameter.
Asked
Active
Viewed 179 times
0

Alex O
- 1
- 1
1 Answers
0
Unfortunately, this is not currently possible.
The problem from my experience with implementing this kind of convenience feature is that it would be difficult to define a syntax that:
- is backward compatible so that it does not break existing code
- convenient for a majority of users
- simple enough to implement

Panagiotis Koutsourakis
- 261
- 1
- 8