镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix documentation for adding field with default - #253

Draft
chdsbd wants to merge 3 commits into
masterfrom
chris/fix-not-null
Draft

chdsbd wants to merge 3 commits into
masterfrom
chris/fix-not-null

Conversation

@chdsbd

@chdsbd chdsbd commented Aug 25, 2022

Copy link
Copy Markdown
Collaborator

No description provided.

let ok_sql = r#"
-- NON-VOLATILE
ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
ALTER TABLE "account" ADD COLUMN "last_modified" timestamptz DEFAULT now();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our code for checking volatility of functions doesn't work. now() is stable, while a function like random is volatile.

select
  proname,
  pronamespace::regnamespace,
  provolatile
from pg_proc
where proname = 'now'
  or proname = 'random';

I think we could hard code in a list of functions and then warn when we can't know for certain with a more detailed error message.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant