name-conflict

How to disambiguate a plpgsql variable name in a ON CONFLICT clause?

送分小仙女□ 提交于 2020-03-21 20:04:13
问题 Given this table: create table test ( name text primary key ); I need to write a plpgsql function with a variable name that collides with the primary key name, which I must use in a on conflict clause: create or replace function func( name text -- this variable name... ) returns void language plpgsql as $$ begin insert into test (name) values (name) on conflict (name) do update -- ...conflicts with this line set name = func.name; end; $$; This compiles, but then throws an ambiguous column

Setting `cache_classes` to `false` fixes my bug. What to do next?

陌路散爱 提交于 2020-03-05 06:18:30
问题 I'm adding a mountable engine to my rails app, which provides a forum-like functionality (i.e. adds questions, answers, comments, etc). Everything works fine in development. In staging/production, however, I get an error when trying to create an answer, specifically a CanCan permission error (though I think that may be a red herring). But it feels like ti might be related to namespacing or name collision? At any rate, the issue goes away when I set config.cache_classes = false in my

How do I resolve name conflict in MATLAB?

旧街凉风 提交于 2019-12-14 03:57:05
问题 I created a GUI called "stack" in MATLAB. It has a .m file associated with it. This GUI is called on multiple occasions by another GUI in the same folder. Now I discovered that "stack" is a built-in function in MATLAB which I need to use for something else in the same working directory. All calls to the stack function somehow invoke the GUI by calling the stack.m script. I do not want to rename this because it is used in many places. Is there a way to use the built-in function without needing

Strange global variable behaviour, once variable name is changed issue disappears

醉酒当歌 提交于 2019-12-12 10:19:36
问题 During my university exercise I have come across strange behaviour of a variable. /* Main parameters */ double sizeX, sizeY; /* Size of the global domain */ int nPartX, nPartY; /* Particle number in x, y direction */ int nPart; /* Total number of particles */ int nCellX, nCellY; /* (Global) number of cells in x, y direction */ int steps; /* Number of timesteps */ double dt; /* Stepsize for timesteps */ int logs; /* Whether or not we want to keep logfiles */ void ReadInput(const char *fname) {

How to resolve a name collision between a C++ namespace and a global function?

假装没事ソ 提交于 2019-11-30 18:31:13
if I define a namespace log somewhere and make it accessible in the global scope, this will clash with double log(double) from the standard cmath header. Actually, most compilers seem to go along with it -- most versions of SunCC, MSVC, GCC -- but GCC 4.1.2 doesn't. Unfortunately, there seems no way to resolve the ambiguity, as using declarations are not legal for namespace identifiers. Do you know any way I could write log::Log in the global namespace even if cmath is included? Thanks. EDIT : Would anybody know what the C++03 standard has to say about this? I would have thought that the scope

How to resolve a name collision between a C++ namespace and a global function?

让人想犯罪 __ 提交于 2019-11-30 02:42:02
问题 if I define a namespace log somewhere and make it accessible in the global scope, this will clash with double log(double) from the standard cmath header. Actually, most compilers seem to go along with it -- most versions of SunCC, MSVC, GCC -- but GCC 4.1.2 doesn't. Unfortunately, there seems no way to resolve the ambiguity, as using declarations are not legal for namespace identifiers. Do you know any way I could write log::Log in the global namespace even if cmath is included? Thanks. EDIT