我想知道是否可以将列输入值重用作为另一个列值输入的默认值(如果留空)。我试图在DEFAULT代码之后简单地填充引用。
CREATE TABLE members (
name varchar(50) NOT NULL,
username varchar(50) DEFAULT name
);
INSERT INTO members (name) VALUES ('el duderino');
SELECT * FROM members;
Run Code Online (Sandbox Code Playgroud)
所需结果;
name | username
--------------+--------------
el duderino | el duderino
Run Code Online (Sandbox Code Playgroud)
insert语句运行但由于以下错误而无法建立表,因此找不到该表...
psql:website.sql:38:错误:无法在默认表达式中使用列引用
是否可以在一行的默认语句中引用值的名字?还是必须分阶段进行?任何帮助,不胜感激!
注意:我正在Cloud 9开发机器上运行Postgresql。
在搜索论坛和 stackoverflow 后,我无法弄清楚此检查亮点试图提醒我什么:
选择/悬停在突出显示的文本上除了标准上下文操作之外不会返回任何内容。
最初,这些变量是在构造函数之前声明和实例化的。(重现所采取的操作)当我使用上下文操作“将初始化移动到构造函数”时,构造函数中的初始化突出显示为深绿色。请参阅附图。
有人知道这是怎么回事吗?
例子:
public class HoaQueueEditorDialog extends ListDialogBase implements Mutable {
private static final String SAVE = "Save";
private static final String CANCEL = "Cancel";
private static final String CHAR_DELIMITER = ",";
private static final String[] COL_NAMES = {"Workflow Step Name"};
private static final Color NORM_BACKGROUND = TRexUIManager.getColor(TRexUIManager.CONTENT_BACKGROUND);
private static final Color NORM_FOREGROUND = Color.black;
private static final int[] COL_WIDTHS = {325};
private static final ArrayList<AppOptionsUtil.WorkflowStepInfo> SUPPORTED_STEPS_LIST = AppOptionsUtil.getDisplayHoaInfoWfStepsSupportedList();
// UI Elements
private TButton saveButton; …Run Code Online (Sandbox Code Playgroud) 已经玩 Jekyll 几天了,但一直没有幸运地尝试让主题在我的本地计算机上运行。
我尝试了几个不同的主题,但收到的错误似乎指向丢失的文件???我不太确定,因为我对 Ruby 完全陌生。
~ $ cd ~/jekyll-theme/
~ $ jekyll serve
Run Code Online (Sandbox Code Playgroud)
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87:在“物化块”中:找不到addressable-2.4.0在任何来源中(Bundler::GemNotFound)
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in `map!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in `materialize'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/definition.rb:176:in `specs'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/definition.rb:235:in `specs_for'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/definition.rb:224:in `requested_specs'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:118:in `block in definition_method'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:19:in `setup'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/exe/jekyll:9:in `<top (required)>'
from C:/Ruby23-x64/bin/jekyll:22:in `load'
from C:/Ruby23-x64/bin/jekyll:22:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我尝试发出以下命令:
~ $ bundle exec jekyll serve
导致相同的错误和跟踪
任何见解都将受到高度赞赏。