GithubHelp home page GithubHelp logo

Comments (3)

IanMeyers avatar IanMeyers commented on August 23, 2024

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.

jarrettj avatar jarrettj commented on August 23, 2024

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.

jarrettj avatar jarrettj commented on August 23, 2024

Yip, did a pull and got the latest changes. Sorry about that. Rerunning!

from amazon-redshift-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.