postgresql

lua 5.3.5 安装/初体验

陌路散爱 提交于 2020-12-01 02:49:20
安装 官网 http://www.lua.org/start.html 参考 https://blog.csdn.net/qq_23954569/article/details/70879672 cd ~ sudo apt-get install -y libreadline7 libreadline- dev wget http: // www.lua.org/ftp/lua-5.3.5.tar.gz tar zxf lua- 5.3 . 5 . tar .gz cd lua - 5.3 . 5 sudo make linux test sudo make install 因为放在了home,所以重装之后,只需要执行最后1句就OK了 包管理luarocks 才1M cd ~ wget https: // luarocks.org/releases/luarocks-3.0.4.tar.gz tar zxpf luarocks- 3.0 . 4 . tar .gz cd luarocks - 3.0 . 4 . /configure; sudo make bootstrap sudo luarocks install luasocket 安装luasql-postgres 安装时要求本地有postgres源码 Error: Could not find header file

Rails: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations

走远了吗. 提交于 2020-11-30 23:09:04
问题 I'm trying to create the database in Rails. In Postgres I see the development and test database, however, I'm getting a permissions error. I've tried to follow this link, didn't work for me. Error: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations : SELECT "schema_migrations".* FROM "schema_migrations" Rails: permission denied for relation schema_migrations default: &default adapter: postgresql encoding: unicode pool: 5 host: localhost username: root password:

Rails: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations

旧时模样 提交于 2020-11-30 23:06:04
问题 I'm trying to create the database in Rails. In Postgres I see the development and test database, however, I'm getting a permissions error. I've tried to follow this link, didn't work for me. Error: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations : SELECT "schema_migrations".* FROM "schema_migrations" Rails: permission denied for relation schema_migrations default: &default adapter: postgresql encoding: unicode pool: 5 host: localhost username: root password:

heidisql 安装教程

社会主义新天地 提交于 2020-11-30 10:29:18
HeidiSQL 是一款用于简单化迷你的服务器和数据库管理的图形化界面,采用Delphi开发,支持MySQL、SQL Server、PostgreSQL服务器。HeidiSQL提供了一个用于在数据库浏览之间切换SQL查询和标签带有语法突出显示的简单易用的界面。可以方便浏览您的数据库,管理表、视图、存储过程、触发器,浏览和编辑记录,管理用户权限。此外,你可以从文本文件导入数据,运行SQL查询,在两个数据库之间同步表以及导出选择的表到其它数据库或者SQL脚本中。 安装教程 1、点击右键安装后进入下图的安装界面,我们可以看到HidiSQL支持MySQL,SQL Server,PostgreSQL,点击next 2、更改安装的目录(也可以使用默认) 3、点击install安装,完成后点击Finish即可 使用教程 1、点击新建后,选择在根分类创建会话 2、左侧在会话名称下出现的Unnamed,右键选择Rename即可重命名。右侧选择数据库类型(mysql),输入主机名(默认本机127.0.0.1),用户名(默认root)和密码,点击“打开”按钮即可连接。点击“保存”按钮,下次连接便可不用输入密码。 3、打开后的界面如下图所示,在右边可以看到数据库的基本信息 4、点击查询直接进入查询编辑界面,我们在查询编辑界面输入sql语句,点击“执行”三角形按钮即可,下方便会出现执行结果,或正确或错误。

What does exclusion constraint `EXCLUDE USING gist (c WITH &&)` mean?

只愿长相守 提交于 2020-11-30 07:56:18
问题 From PostgreSQL document Exclusion constraints ensure that if any two rows are compared on the specified columns or expressions using the specified operators, at least one of these operator comparisons will return false or null. The syntax is: CREATE TABLE circles ( c circle, EXCLUDE USING gist (c WITH &&) ); I was wondering what EXCLUDE USING gist (c WITH &&) means? In particular, gist() , c WITH && and EXCLUDE USING . Can it be rewritten in terms of check ? Thanks. 回答1: Whereas a CHECK

postgresql: .pgpass not working

瘦欲@ 提交于 2020-11-30 06:15:24
问题 I have created a .pgpass file in my home directory which looks like this localhost:5432:somedb:someuser:somepass I am using a shell script which creates a directory and puts a pg_dump of somedb there : mkdir directory pg_dump somedb > directory/somefile.dump It still prompts for the password. Where is the mistake here ? 回答1: Did you try specifying the host, user, & db? pg_dump -U someuser -h localhost somedb > directory/somefile.dump 回答2: Although question has already been answered and

postgresql: .pgpass not working

末鹿安然 提交于 2020-11-30 06:14:52
问题 I have created a .pgpass file in my home directory which looks like this localhost:5432:somedb:someuser:somepass I am using a shell script which creates a directory and puts a pg_dump of somedb there : mkdir directory pg_dump somedb > directory/somefile.dump It still prompts for the password. Where is the mistake here ? 回答1: Did you try specifying the host, user, & db? pg_dump -U someuser -h localhost somedb > directory/somefile.dump 回答2: Although question has already been answered and

Delete empty rows

不羁的心 提交于 2020-11-30 04:36:18
问题 I use PostgreSQL database and in one table I have the datetime column edit_user . Some rows are blank, and these rows I would like to delete. I tried DELETE FROM table WHERE edit_user=""; but I got the error LINE 1: delete from table where edit_user=""; Also, I thought in the column as a blank value could be 0000-00-00 , but there isn't. How I should execute this command correctly? 回答1: DELETE FROM table WHERE edit_user IS NULL; 回答2: If you are trying to delete empty spaces , try using =''

Delete empty rows

坚强是说给别人听的谎言 提交于 2020-11-30 04:35:32
问题 I use PostgreSQL database and in one table I have the datetime column edit_user . Some rows are blank, and these rows I would like to delete. I tried DELETE FROM table WHERE edit_user=""; but I got the error LINE 1: delete from table where edit_user=""; Also, I thought in the column as a blank value could be 0000-00-00 , but there isn't. How I should execute this command correctly? 回答1: DELETE FROM table WHERE edit_user IS NULL; 回答2: If you are trying to delete empty spaces , try using =''

postgresql - add boolean column to table set default

余生颓废 提交于 2020-11-30 02:19:09
问题 Is this proper postgresql syntax to add a column to a table with a default value of false ALTER TABLE users ADD "priv_user" BIT ALTER priv_user SET DEFAULT '0' Thanks! 回答1: ALTER TABLE users ADD COLUMN "priv_user" BOOLEAN DEFAULT FALSE; you can also directly specify NOT NULL ALTER TABLE users ADD COLUMN "priv_user" BOOLEAN NOT NULL DEFAULT FALSE; UPDATE : following is only true for versions before postgresql 11. As Craig mentioned on filled tables it is more efficient to split it into steps: