12345678910111213141516171819202122232425262728293031323334 |
- # Note that this file will not work on PG due to the not standard COPY TO s3 command
- send
- Query {"query": "CREATE SECRET aws_secret_access_key AS 'minioadmin'"}
- ----
- until
- ReadyForQuery
- ----
- CommandComplete {"tag":"CREATE SECRET"}
- ReadyForQuery {"status":"I"}
- # Create aws connection to be used
- send
- Query {"query": "CREATE CONNECTION aws_conn TO AWS (ACCESS KEY ID = 'minioadmin', SECRET ACCESS KEY = SECRET aws_secret_access_key, REGION = 'us-east-1', ENDPOINT = 'http://localhost:40109')"}
- ----
- until
- ReadyForQuery
- ----
- CommandComplete {"tag":"CREATE CONNECTION"}
- ReadyForQuery {"status":"I"}
- # Ensure COPY TO works and returns COPY tag.
- # Using a SELECT query with zero rows so that it does not try to write to s3.
- send
- Query {"query": "COPY (SELECT generate_series(1, 0)) TO 's3://copytos3/1' WITH (AWS CONNECTION = aws_conn, FORMAT = 'csv', MAX FILE SIZE = '100MB')"}
- ----
- until
- ReadyForQuery
- ----
- CommandComplete {"tag":"COPY 0"}
- ReadyForQuery {"status":"I"}
|