postgresql

PDO not throwing exception with unbound parameters (and no variables in query)

北慕城南 提交于 2020-12-30 06:39:33
问题 So I have no idea what's going on here $link = new PDO('pgsql:dbname=' . $name . ';host=' . $host, $user, $password); $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); try { $stmt = $link->prepare("SELECT s.*, d.invalid_column FROM students s ORDER BY s.student_id"); $stmt->execute(array(1)); } catch (PDOException $e) { print $e->getMessage(); } When I run this little code example, I expect an exception to be thrown (as d

postgresql regexp_replace: how to replace captured group with evaluated expression (adding an integer value to capture group)

丶灬走出姿态 提交于 2020-12-30 06:23:29
问题 I need to convert some strings with this format: B12F34 to something like that: Building 12 - Floor 34 but I have to add a value, say 10, to the second capture group so the new string would be as: Building 12 - Floor 44 I can use this postgres sentence to get almost everything done, but I don't know how to add the value to the second capture group. SELECT regexp_replace('B12F34', 'B(\d+)F(\d+)', 'Building \1 - Floor \2', 'g'); I have been searching for a way to add a value to \2 but all I

Pgadmin is not loading

眉间皱痕 提交于 2020-12-30 04:52:17
问题 i have recently installed pgadmin4 onto my laptop and when I launch the application, it just gets stuck on the loading. I had a look at the logs and this is what I see: The logs 2020-11-14 00:22:46: Checking for system tray... 2020-11-14 00:22:46: Starting pgAdmin4 server... 2020-11-14 00:22:46: Creating server object, port:64222, key:2a079549-63da-44d2-8931-efa9de3a847f, logfile:C:/Users/yonis/AppData/Local/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log 2020-11-14 00:22:46: Python Path: C:

做数据建模有哪些工具是值得推荐的?

最后都变了- 提交于 2020-12-29 20:57:07
数据建模是一个用于定义和分析在组织的信息系统的范围内支持商业流程所需的数据要求的过程。因此,数据建模的过程需要专业建模师与商业人员和信息系统潜在用户的紧密合作。那么数据建模都有哪些工具呢?小编今天给大家准备了6款,一起来看看吧! 1、MapBusiness Online 人们可能没有考虑过的一种数据建模工具是MapBusiness。但是,创建销售或竞争对手区域图可以提供有助于企业发展的信息。企业甚至可以创建销售地区地图,以降低成本。提高销售代理商的生产率。并且发现其所在行业尚未开发的新市场。 2、Vertabelo Vertabelo是一个功能很强大的数据库设计建模工具,能够使用可视化建模,而不是在数据库中人工创建表格。该软件还适用于逆向工程模型。如果已有数据库,则可以使用该工具调整已构建元素的组织。 3、DbSchema DbSchema是一个适用于SQL和非SQL数据库的工具,这个数据库建模工具的一些好处包括交互布局、同步模式的能力、部署来自多个表的数据以及在不连接数据库的情况下设计模式。它可以轻松地从Excel文件上载数据,从而为企业提供了更多的机会来导入可能不在云平台中的原有数据表。该工具具有集成管理数据库所需的一切的能力,而无需购买其他软件。 4、HeidiSQL HeidiSQL是一个免费的数据建模工具,提供很多功能,例如能够在一个窗口中与多台服务器连接

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-29 12:15:21
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

心不动则不痛 提交于 2020-12-29 12:13:45
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

南笙酒味 提交于 2020-12-29 12:12:27
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

佐手、 提交于 2020-12-29 12:09:13
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

狂风中的少年 提交于 2020-12-29 12:08:33
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do

PG::ForeignKeyViolation: ERROR: update or delete on table “xxx” violates foreign key constraint

旧街凉风 提交于 2020-12-29 12:08:17
问题 I have several tables that have foreign key constraints associated with them, each referencing the other in a hierarchical fashion as outlined below. When I try to destroy a Company that has at least 1 Project, that has at least 1 Task, that has at least 1 TaskTime like so... irb(main):014:0> Company.first.destroy I get the below output and error. I am under the impression now that simply having dependent: :delete_all doesn't deal with the foreign key constraints, is this true? If so, how do