Comments (3)
Hello,
This is currently supported. I've just run the utility for a table with a default option, and as you can see below it does generate the default values:
-- [55069] Connected to xxxxx.eu-west-1.redshift.amazonaws.com:5439:master as master
-- [55069] Analyzing Table 'test_copy_default' for Columnar Encoding Optimisations with 1 Threads...
-- [55069] Analyzing 1 table(s) which contain allocated data blocks
-- [55069] Table test_copy_default contains 5 unoptimised columns
-- [55069] Using Force Override Option
-- [55069] Analyzing Table 'test_copy_default'
-- [55069] Column Encoding will be modified for public.test_copy_default
-- [55069] No encoding modifications required for public.test_copy_default
begin;
lock table public.test_copy_default;
create table public.test_copy_default_$mig(
"column_a" integer NOT NULL encode raw
,"column_b" integer NOT NULL encode raw
,"column_c" integer NOT NULL encode raw
,"id" varchar(10) encode raw
,"date_value" date default ('now'::character varying)::date encode raw
)
;
insert into public.test_copy_default_$mig select * from public.test_copy_default;
analyze public.test_copy_default_$mig;
alter table public.test_copy_default rename to test_copy_default_20161007_2NasFFvFbb_$old;
alter table public.test_copy_default_$mig rename to test_copy_default;
commit;
-- [55069] Performed modification of 0 tables
-- [55069] Processing Complete
Do you see something different when you try to generate a migration script?
Thx,
Ian
from amazon-redshift-utils.
I've run it on my entire database with more than 30 tables. Not one table has the default value set. I'm forced to use SQL Workbench to get the SQL source and see what the defaults are and then copy/paste them. Which is a bit time consuming.
My command:
./analyze-schema-compression.py --db adb --db-user auser --db-host xxx.us-east-1.redshift.amazonaws.com --output-file encoding.sql
-- [7281] Column Encoding will be modified for public.app
begin;
lock table public."app";
create table public."app_$mig" (
"id" integer encode delta
,"name" varchar(765) encode lzo
,"developer" varchar(765) encode lzo
,"sku" varchar(765) encode lzo
,"appfiguresid" bigint encode lzo
,"icon" varchar(765) encode lzo
,"currencycode" varchar(765) encode lzo
)
;
alter table public."app_$mig" add primary key (id);
insert into public."app_$mig" select * from public."app";
analyze public."app_$mig";
alter table public."app" rename to "app_$old";
alter table public."app_$mig" rename to "app";
commit;
Maybe I'm running an older version of the code. Let me check.
from amazon-redshift-utils.
Yip, did a pull and got the latest changes. Sorry about that. Rerunning!
from amazon-redshift-utils.
Related Issues (20)
- sp_correlation is giving error with column "trip_count" does not exist in derived_table1
- v_generate_tbl_ddl : Invalid operation: value too long for type character varying(798) HOT 1
- permission denied for relation stv_tbl_perm HOT 4
- Revoking privileges from RBAC roles using v_generate_user_grant_revoke_ddl
- v_get_stored_proc_params.sql invalid WHERE prolang = 100356 HOT 1
- v_generate_user_grant_revoke_ddl returns "ERROR: value too long for type character varying(128)" HOT 1
- v_generate_tbl_ddl creates columns in the incorrect order
- Hy
- Generate DDL for Data Masking Schemas when selecting tables from awslabs view v_generate_tbl_ddl
- Support local config file in WorkloadManagementScheduler
- v_generate_user_grant_revoke_ddl.sql does not include external tables and external schemas.
- MultipleTableRestoreUtility Fails With InvalidClusterState Error When Restoring Multiple Tables From A Snapshot
- DROP permissions tab
- v_generate_tbl_ddl incorrectly pulls comments on tables with same name in different schema
- v_generate_user_grant_revoke_ddl creates invalid statement.
- v_generate_user_grant_revoke_ddl.sql generates invalid SQL when datashares are used
- v_generate_udf_ddl.sql how can I get complete datatype of RETURN?
- Python requirements fail to install on Python 3.10.12
- SystemTablePersistence - Value too long for character type error
- v_generate_external_tbl_ddl generates invalid ddl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-redshift-utils.