GVKun编程网logo

postgresql 9.6

3

在本文中,我们将给您介绍关于postgresql9.6的详细内容,此外,我们还将为您提供关于c#中的PostgresqlNpgsql.PostgresException、centos7下源码编译安装p

在本文中,我们将给您介绍关于postgresql 9.6的详细内容,此外,我们还将为您提供关于c#中的Postgresql Npgsql.PostgresException、centos 7下源码编译安装php支持PostgreSQL postgresql手册 postgresql官网下载 postgresql视频教、grails 3.3.9 和 PostgreSQL 12.7 入门:错误“org.postgresql.Driver”、Greenplum与PostgreSQL社区双管齐下,谁是PostgreSQL 13 中国的"头号玩家"?的知识。

本文目录一览:

postgresql 9.6

postgresql 9.6

如何解决postgresql 9.6?

我是 postgres 管理的新手,当开发人员使用 LOCK TABLE tab1; 语句运行 PREPARED 时,postgres 使用 ACCES EXCLUSIVE BY DEFAULT。我的问题是,即使在重新启动 postgres 和 pg_lock 之后,视图 pg_prepared_xactpg_locks 中的锁在一周后仍然存在,就像:

 vXID                 mode
-1/192836             AccessExclusiveLock
Name               DATABASE                  Owner             XID          prepared at
                   db1                       postgres          192836       20-07-2021

我会知道为什么 LOCK 还在这里??以及如何解决? vXID 中的 -1 是什么意思?因为我什至无法在 tab1

上显示我的数据

解决方法

带有 PREPARED 语句

准备好的交易和准备好的语句是非常不同的东西。你在这里拥有的是一个准备好的交易。重新启动是准备好的事务。您需要在 pg_prepared_xacts 中找到它的“gid”,然后手动提交或roll it back。如果您不是有意使用准备好的事务,您应该设置 max_prepared_transactions =0,这样就不会再发生。如果您有意使用它们,则需要学习如何处理它们。

c#中的Postgresql Npgsql.PostgresException

c#中的Postgresql Npgsql.PostgresException

我有cmd.ExecuteReader()的问题我得到一个Npgsql.PostgresException

public void connectDB()
    {
        try
        {
            server = "localhost";
            database = "DoveVer3";
            uid = "admin";
            password = "admin";
            string connectionString;
            connectionString = "Host=" + server + ";Username =" + uid + ";" + "PASSWORD=" + password + ";DATABASE=" + database;

            connection.ConnectionString = connectionString;
            connection.open();

        }
        catch (Exception e)
        {
            MessageBox.Show(e.Message);

        }


    }

我在下面的代码中获得了Exeption:

public void AddDovetoDB(Dove dove)
    {
        //add new dove record to tableDB
        connectDB();
        cmd = new NpgsqlCommand();
        cmd.Connection = connection;
        cmd.CommandText = "SELECT * FROM " + DoveTableDB + " WHERE `" + DoveIdColumnDoveTable + "` = '" + dove.GetDoveId() + "'";
        NpgsqlDataReader rdr = cmd.ExecuteReader(); //// <<<<< HERE
        if (rdr.Read() != true)
        {
            rdr.Close();
            cmd.Parameters.Clear();

            cmd.CommandText = "INSERT INTO " + DoveTableDB + "(" + DoveIdColumnDoveTable + "," + DoveIdFatherColumnDoveTable + "," + DoveIdMotherColumnDoveTable + "," + DoveEyesColorColumnDoveTable + "," + DoveFeatherColorDoveTable + "," + DoveImageNameColumnDoveTable + "," + DoveSexColumnDoveTable +") VALUES ('" + dove.GetDoveId() + "','" + dove.GetDoveFatherId() + "','" + dove.GetDoveMotherId() + "','" + dove.GetEyesColor() + "','" + dove.GetFeathersColor()+ "','" + dove.GetimageName() + "','" + dove.GetSex()+ "')";
            cmd.ExecuteNonQuery();

        }
        connection.Close();
    }

我的数据库名为DoveVer3,我的架构DoveSchema在这里是我的表代码:

Name: DoveTable; Type: TABLE; Schema: DoveSchema; Owner: admin
--

CREATE TABLE "DoveTable" (
    "doveId" character varying(20)[] NOT NULL,"doveFather" character varying(20)[],"doveMother" character varying,"doveEyesColor" character varying(20)[],"doveFeathersColor" character varying(20)[],"doveSex" smallint DEFAULT 3 NOT NULL,"imageName" character varying(30)
);
ALTER TABLE "DoveTable" OWNER TO admin;

例外基础信息:

relation “dovetable” don’t exist; Statemants: {SELECT * FROM DoveTable
WHERE doveId = ‘Test’}

解决方法

默认情况下,传递给Postgresql的所有标识符都将被视为小写.根据您的创建脚本,在定义表时使用了 quoted-identifer,因此在使用表名时需要以下内容.

SELECT * FROM "DoveTable"

请注意,它用双引号括起来,’D’和’T’都是大写的.使用带引号的标识符时,必须始终按照定义它们的方式将它们写出来.

centos 7下源码编译安装php支持PostgreSQL postgresql手册 postgresql官网下载 postgresql视频教

centos 7下源码编译安装php支持PostgreSQL postgresql手册 postgresql官网下载 postgresql视频教

1. 下载源码

$ mkdir /usr/downloads
$ wget -c http://cn2.php.net/distributions/php-5.6.20.tar.gz
$ tar -xvf php-5.6.20.tar.gz
$ mv php-5.6.20 /usr/local/src
$ cd !$ &amp; cd php-5.6.20
登录后复制

2. 阅读安装指导

$ ls -also
$ less README
$ less INSTALL
登录后复制

3. 安装依赖包

$ yum install apr apr-util apr-devel apr-util-devel prce lynx
登录后复制

4. 安装httpd

$ wget -c http://apache.fayea.com//httpd/httpd-2.4.20.tar.gz
$ tar -xvf httpd-2.4.20.tar.gz
$ cd httpd-2.4.20
$ ./configure \
--prefix=/usr/local/programs/apache2 \
--enable-rewrite \
--enable-so \
--enable-headers \
--enable-expires \
--with-mpm=worker \
--enable-modules=most \
--enable-deflate \
--enable-module=shared
$ make
$ make install
$ cd /usr/local/programs/apache2
$ cp bin/apachectl /etc/init.d/httpd ## 复制启动脚本
$ /etc/init.d/httpd start ## 启动apache服务器,访问http://localhost/
$ egrep -v ''^[ ]*#|^$'' /usr/local/apache2/conf/httpd.conf | nl ## 查看apache服务器的配置
## 将apache加入系统服务
vi /etc/rc.d/rc.local
```
/usr/local/programs/apache2/bin/apachectl start
```
$ cat /etc/rc.local
登录后复制

4. 安装postgresql

立即学习“PHP免费学习笔记(深入)”;

$ yum install readline-devel  ## 安装readline依赖
$ cd /usr/downloads
$ wget -c https://ftp.postgresql.org/pub/source/v9.5.0/postgresql-9.5.0.tar.bz2
$ tar -xvf postgresql-9.5.0.tar.bz2
$ cd postgresql-9.5.0
$ ./configure --prefix=/usr/local/programs/postgresql
$ make
$ su
$ make install
$ /sbin/ldconfig /usr/local/programs/postgresql/lib ## 刷新下共享动态库
$ cd /usr/local/programs/postgresql
$ bin/psql --version  ## 检查运行情况
## 开始对postgresql的配置
$ vi /etc/profile.d/postgresql.sh ## 增加环境变量,不推荐直接在/etc/profile中添加,系统更新升级时会需要merge
``` 
PATH=/usr/local/programs/postgresql:$PATH
export PATH
```
$ source /etc/profile ## 更新环境变量

## 增加用户和其他文件夹
$ adduser postgres
$ passwd postgres 
$ mkdir /usr/local/programs/postgresql/logs
$ mkdir /usr/local/programs/postgresql/data
$ chown postgres /usr/local/programs/postgresql/data
$ su - postgres

## 初始化数据库
$ ./bin/initdb -D ./data
$ ./bin/createdb test
$ ./bin/psql test
## 已有数据库,可导入data文件夹后尝试root访问,假如带密码,可能需要进一步研究下
$ ./bin/postgres -D ./data &gt;./logs/start-log-1.log 2&gt;&amp;1 &amp;
$ ./bin/psql --list  ##列出数据库
## ok,安装完成

## 自定义设置,权限控制等,可以跳过,等熟悉使用后再做
## 编辑数据库配置及权限文件:
$ vi /usr/local/programs/postgresql/data/postgresql.conf   ## 数据库配置文件
$ chown postgres postgresql.conf
$ chmod 644 postgresql.conf
$ vi /usr/local/programs/postgresql/data/pg_hba.conf   ## 权限文件
$ vi /usr/local/programs/postgresql/data/pg_ident.conf

## 设置开机自启动:
$ vi /etc/rc.d/rc.local    ## 添加如下内容
```
/usr/local/programs/postgresql/bin/postgresql start
```
登录后复制

5. 安装php

## 源码已经在第一步中下载,现在开始安装:
$ yum install libxml2 libxml2-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel
$ ./configure \
--prefix=/usr/local/programs/php \
--with-apxs2=/usr/local/programs/apache2/bin/apxs \
--with-zlib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib-dir \
--enable-mbstring \
--with-pgsql=/usr/local/programs/postgresql \
--with-pdo-pgsql=/usr/local/programs/postgresql 
$ make
$ make test
&gt; Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt]  XFAIL REASON: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags
&gt; Bug #67296 (filter_input doesn''t validate variables) [ext/filter/tests/bug49184.phpt]  XFAIL REASON: See Bug #49184
&gt; Bug #53640 (XBM images require width to be multiple of 8) [ext/gd/tests/bug53640.phpt]  XFAIL REASON: Padding is not implemented yet
&gt; zend multibyte (7) [ext/mbstring/tests/zend_multibyte-07.phpt]  XFAIL REASON: https://bugs.php.net/bug.php?id=66582
&gt; zend multibyte (9) [ext/mbstring/tests/zend_multibyte-09.phpt]  XFAIL REASON: https://bugs.php.net/bug.php?id=66582
&gt;Bug #70470 (Built-in server truncates headers spanning over TCP packets) [sapi/cli/tests/bug70470.phpt]  XFAIL REASON: bug is not fixed yet

## 查阅官方的bug,发现:
&gt; id=66582: status : Closed. Fixed in master (PHP7)
&gt; id=42718: status : Assigned
&gt; id=42718: reference to id=49184, unsolved for many years
## 那就不关心了,直接装吧
$ make install
&gt; You may want to add: /usr/local/programs/php/lib/php to your php.ini include_path

## 那就按它说的设置吧
$ cp php.ini-development /usr/local/programs/php/lib/php.ini
```
include_path = ".;/usr/local/programs/php/lib/php"

## 然后,编辑httpd的设置,确保其能正确解析php文件
```
...
LoadModule php5_module modules/libphp5.so
...
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5

...
<ifmodule dir_module>
    DirectoryIndex index.html index.php
</ifmodule>     
```

## 重启httpd,测试
$ cd /usr/local/programs/apache2
$ bin/httpd -h
$ bin/httpd -k stop
$ bin/httpd -f conf/httpd.conf
## 默认设置的www页面在./htdocs/下,那就先去里面建一个测试页面吧
$ vi htdocs/index.php
```
<?php phpinfo(); ?>
```
$ curl http://localhost/index.php |grep postgresql
#ok
登录后复制

后续应该做的事

* 1. 启动时,不需要要手动指定配置文件
* 2. php初始化www目录设置
* 3. php 用户、权限管理等

'').addClass(''pre-numbering'').hide(); $(this).addClass(''has-numbering'').parent().append($numbering); for (i = 1; i '').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了centos 7下源码编译安装php支持PostgreSQL,包括了postgresql,centos 7方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

grails 3.3.9 和 PostgreSQL 12.7 入门:错误“org.postgresql.Driver”

grails 3.3.9 和 PostgreSQL 12.7 入门:错误“org.postgresql.Driver”

如何解决grails 3.3.9 和 PostgreSQL 12.7 入门:错误“org.postgresql.Driver”

我试图在我的 grails 3.3.9 项目中连接 postgres 数据库; 我的 posgrest 服务器正在工作,因为我可以从 Intelli J 2021 数据库连接和操作 posgres 数据库,但我无法连接到 grails 3.3.9。 密码和用户是正确的,但它总是向我抛出这个错误:

Running application...
2021-07-05 19:06:25.298 ERROR --- [           main] org.postgresql.Driver                        : Connection error: 

org.postgresql.util.PsqlException: El servidor requiere autenticación basada en  contraseña,pero no se ha provisto ninguna contraseña.

还有这个 mi Application.yml

hibernate:
   cache:
    queries: false
    use_second_level_cache: false
    use_query_cache: false

dataSource:
  IkebanaUsuarios:
    pooled: true
    jmxexport: true
    driverClassName: "org.postgresql.Driver"
    username: "postgres"
    password: "postgres"


environments:
    development:
      dataSource:
          dbCreate: update
          url: jdbc:postgresql://localhost:5432/IkebanaERP
test:
    dataSource:
        dbCreate: update
        url: jdbc:postgresql://localhost:5432/IkebanaERP
production:
    dataSource:
        dbCreate: update
        url: jdbc:postgresql://localhost:5432/IkebanaERP
        properties:
            jmxenabled: true
            initialSize: 5
            maxActive: 50
            minIdle: 5
            maxIdle: 25
            maxWait: 10000
            maxAge: 600000
            timeBetweenevictionRunsMillis: 5000
            minevictableIdleTimeMillis: 60000
            validationQuery: SELECT 1
            validationQueryTimeout: 3
            validationInterval: 15000
            testOnBorrow: true
            testWhileIdle: true
            testOnReturn: false
            jdbcInterceptors: ConnectionState
            defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED

我的 build.graddle 就是这个

.......
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"

runtime ''org.xerial:sqlite-jdbc:3.6.17''
runtime ''org.postgresql:postgresql:9.4.1208.jre1.8''
runtime ''MysqL:mysql-connector-java:5.1.29''
runtime ''org.postgresql:postgresql:42.2.1.jre7''

testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-web-testing-support"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}

请帮忙;非常感谢

解决方法

您正在为 IkebanaUsuarios 数据源定义属性,而不是为 Grails 使用的默认属性定义属性。

您可以删除 IkebanaUsuarios 块,留下这个:

dataSource:
    pooled: true
    jmxExport: true
    driverClassName: "org.postgresql.Driver"
    username: "postgres"
    password: "postgres"

或者,如果您还需要该辅助数据源,您可以为两者定义属性。我猜你不需要它,因为你没有提到故意有两个。

Greenplum与PostgreSQL社区双管齐下,谁是PostgreSQL 13 中国的

Greenplum与PostgreSQL社区双管齐下,谁是PostgreSQL 13 中国的"头号玩家"?

了解更多Greenplum相关内容,欢迎访问Greenplum中文社区网站

**9月24日,PostgreSQL全球开发组宣布PostgreSQL 13 正式发布!**作为世界上最流行的开源数据库之一,PostgreSQL起源于加利福尼亚大学伯克利分校,得益于全球开发者社区超过25年的开源开发,它已成为一款以其可靠性和健壮性著称、优秀的单机开源数据库产品。PostgreSQL的新版本在索引和查找方面进行了重大改进,改进包括索引的空间节省和性能提高,使用聚合或分区的查询时响应更快,使用增强的统计信息时查询计划更优等。

众所周知,Greenplum是一款基于PostgreSQL内核的开源分布式MPP数据库。自创建以来,Greenplum针对大数据场景和用户需求开发了众多优秀特性并做了极致优化。**Greenplum紧密拥抱Postgres社区,以敏捷的方式快速升级Postgres内核,**并已于9月22日,花费半年多跨越三个大版本,完成了9.6到12的内核升级。

不仅如此,Greenplum团队双管齐下,同时致力于对PostgreSQL社区的贡献。虽非专职Postgresql 团队,但Greenplum中国团队一直都是国内PostgreSQL代码提交最多、质量最高的团队,是名副其实的“头号玩家”。

PG12的贡献者纪念奖章

据统计,**在PostgreSQL 13中,Greenplum中国团队共贡献了26个patch,相关功能15个。**具体信息请查看下表,点击阅读原文查看相关讨论邮件链接。

目前,Greenplum研发团队正在致力于Postgresql 12内核升级的后续整理工作,对稳定性和性能进行更多的测试和优化,从而打造更加强大的Greenplum内核“骨架”,在Greenplum 7中为大家带来更多的惊喜。同时,Greenplum中国团队也会继续在两个Greenplum和Postgresql两个社区双管齐下,积极参与Postgresql社区的贡献,作中国的头号玩家

本文分享自微信公众号 - Greenplum中文社区(GreenplumCommunity)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

我们今天的关于postgresql 9.6的分享已经告一段落,感谢您的关注,如果您想了解更多关于c#中的Postgresql Npgsql.PostgresException、centos 7下源码编译安装php支持PostgreSQL postgresql手册 postgresql官网下载 postgresql视频教、grails 3.3.9 和 PostgreSQL 12.7 入门:错误“org.postgresql.Driver”、Greenplum与PostgreSQL社区双管齐下,谁是PostgreSQL 13 中国的"头号玩家"?的相关信息,请在本站查询。

本文标签: