AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-16513

DarkCoffee's questions

Martin Hope
DarkCoffee
Asked: 2013-07-14 15:45:05 +0800 CST

SPI postgresql - 从 postgres.c 将数据插入表中

  • 2

我在 postgresql 9.1(http://doxygen.postgresql.org/postgres_8c_source.html#l00829第 1094 行)的 postgres.c(在 exexc_simple_query 内部)工作。我需要在一个表中插入一些查询信息,稍后我将检查该表。我正在尝试使用这三行通过 SPI 来实现:

SPI_connect();
SPI_exec("INSERT INTO testvalues (11,6)", 5);
SPI_finish();

但是当我启动服务器并发送查询时,出现分段错误:

LOG:  server process (PID 13856) was terminated by signal 11: Segmentation fault
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat your command.
FATAL:  the database system is in recovery mode
LOG:  all server processes terminated; reinitializing
LOG:  database system was interrupted; last known up at 2013-07-14 00:40:22 CEST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 0/17D7368
LOG:  redo is not required
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

你知道我该如何解决吗?有没有更好的方法从 postgres.c 插入数据?

postgresql database-internals
  • 1 个回答
  • 818 Views
Martin Hope
DarkCoffee
Asked: 2013-02-10 22:35:33 +0800 CST

Postgresql - 分段错误(核心转储)

  • 1

我正在研究 postgresql 代码(服务器端)。我按照官方教程从源代码安装了一个版本: http ://www.postgresql.org/docs/8.4/interactive/install-short.html

我对代码做了同样的修改,所以我需要再次安装 postgresql,但这次是我的版本。

我在/usr/local/pgsql2/中重命名了/usr/local/pgsql /并且我做到了:

make distclean
./configure
make
sudo make install
sudo mkdir /usr/local/pgsql/data
sudo chown darkcoffeelinux /usr/local/pgsql/data

直到现在一切都很顺利,但是有了命令

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/

我收到了这个错误:

The files belonging to this database system will be owned by user "darkcoffeelinux".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 24MB
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... Segmentation fault (core dumped)
child process exited with exit code 139
initdb: removing contents of data directory "/usr/local/pgsql/data"

附加信息:我使用的是 kubuntu,postgresql 8.4.15

postgresql linux
  • 2 个回答
  • 8633 Views
Martin Hope
DarkCoffee
Asked: 2012-12-31 18:37:30 +0800 CST

防止 PostgreSQL 在 Ubuntu 中启动

  • 32

我使用的是 PostgreSQL 9.2,它在我启动系统 (Kubuntu) 时自动运行。

我怎样才能避免这种情况?

我需要手动启动它,我不希望它在无人看管的情况下启动,因为我需要查看控制台。

postgresql ubuntu
  • 2 个回答
  • 26981 Views
Martin Hope
DarkCoffee
Asked: 2012-12-29 11:39:05 +0800 CST

libreadline.so.6

  • 0

当我从源代码安装 PostgreSQL 时,我必须安装 libreadline.so.6 库。
从那一刻起,我无法更新我的 kubuntu 系统。

错误是:

Setting up ubuntu-keyring (2011.11.21.1) ...

gpggpg: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP

: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
dpkg: error processing ubuntu-keyring (--configure):
 subprocess installed post-installation script returned error exit status 127

Errors were encountered while processing:
 ubuntu-keyring
 E: Sub-process /usr/bin/dpkg returned an error code (1)'

出于这个原因,我想删除 libreadline.so.6

如果我这样做,我的 PostgreSQL 会发生什么?它们对我的项目都很重要。

编辑

我检查了我的系统并有:

在/usr/local/lib三个文件中:

libreadline.so
libreadline.so.6
libreadline.so.6.2

并在/usr/lib/x86_64-linux-gnu/:

libreadline.so

这些是什么?PostgreSQL 使用其中哪一种?

postgresql installation
  • 1 个回答
  • 4498 Views
Martin Hope
DarkCoffee
Asked: 2012-12-28 23:22:07 +0800 CST

设置 extra_float_digits = 3

  • 3

我将 PostgreSQL 9.2 与我的 Web 应用程序一起使用,该应用程序具有三个带有三个选择的 servlet。

我打开日志。

当我发送我的第一个查询时:select * from "Nomi" limit 4

在它之前,日志向我显示了另一行:

execute <unnamed>: SET extra_float_digits = 3

这个命令是什么?

postgresql postgresql-9.2
  • 1 个回答
  • 4644 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve