无服务器的postgresql [英] serverless postgresql

查看:91
本文介绍了无服务器的postgresql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了便于配置和其他原因,我希望我的

单用户GUI应用程序能够在进程中使用postgresql作为库

访问在用户主目录中创建的数据库。我想我可以通过使用适当的args启动postmaster的专属副本

来获得我想要的东西但是它似乎在概念上更清洁而没有

完全独立的过程。有没有人试图做这样的事情?


我看过sqlite,它可能对我的项目有用但是我

会更喜欢更多postgres的标准和特色SQL。在

特定的sqlite缺少日期算术并且有一些有趣的类型问题

(它声称是无类型的,除非它不是,或者什么)。


---------------------------(广播结束)--------- ------------------

提示1:订阅和取消订阅命令转到 ma ******* @ postgresql.org

For ease of configuration and other reasons, I would like for my
single-user GUI app to be able to use postgresql in-process as a library
accessing a database created in the users home directory. I think I
could possibly get what I want by launching a captive copy of postmaster
with appropriate args but it seems conceptually cleaner to not have a
seperate process at all. Has anyone tried to do anything like this?

I''ve looked at sqlite and it might be workable for my project but I
would prefer the more standard and featureful SQL of postgres. In
particular sqlite lacks date arithmetic and has some funny type issues
(it claims to be typeless, except when it isn''t, or something).

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

推荐答案

* Jeff Bowden < jl*@houseofdistraction.com> [2004-01-13 13:38:02 -0800]:
* Jeff Bowden <jl*@houseofdistraction.com> [2004-01-13 13:38:02 -0800]:
为了便于配置和其他原因,我希望我的
单用户GUI应用程序能够能够在进程中使用postgresql作为库访问在用户主目录中创建的数据库。我认为我可以通过使用适当的args启动postmaster的专属副本来获得我想要的东西但是在概念上看起来更干净,根本没有单独的过程。有没有人试图做这样的事情?
For ease of configuration and other reasons, I would like for my
single-user GUI app to be able to use postgresql in-process as a library
accessing a database created in the users home directory. I think I
could possibly get what I want by launching a captive copy of postmaster
with appropriate args but it seems conceptually cleaner to not have a
seperate process at all. Has anyone tried to do anything like this?




嗯,我也玩过postgresql独立。

你也可以做一些好事,比如从inetd调用postmaster ;-)


但我不认为你真的想让postmaster在同一个

过程中您的应用程序,因为它依赖于分支,信号,

mmap()以及其他一些直接影响过程控制的东西 -

这可能与您的应用程序有关。在应用程序方面

你无法真正控制,它做什么,所以这听起来很难。

将邮件管理员放在一个单独的进程中,通过套接字或

pty似乎是更好的解决方案。

cu

-

---------- -------------------------------------------------- ---------

Enrico Weigelt == metux IT服务


电话:+49 36207 519931 www: http://www.metux.de/

传真:+49 36207 519932电子邮件: co*****@metux.de

手机:+49 174 7066481

-------------------------------------------- -------------------------

Diese Mail wurde mit UUCP versandt。 http://www.metux.de/uucp/


---------------------------(广播结束)----------- ----------------

提示3:如果通过Usenet发布/阅读,请发送适当的

subscribe-nomail命令 ma*******@postgresql.org 以便您的

消息可以干净利落地到达邮件列表



hmm, i''ve also played around a little bit w/ postgresql standalone.
you could also do nice things like calling postmaster from inetd ;-)

but I dont think you really wanna have the postmaster in the same
process w/ your application, since it relies on forks, signals,
mmap() and some other things which directly affect the process control -
this probably infers with your application. On the application side
you cant really control, what it does, so it sounds quite difficult.
Having the postmaster in a separate process connected by a socket or
pty seems to be the better solution.
cu
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT services

phone: +49 36207 519931 www: http://www.metux.de/
fax: +49 36207 519932 email: co*****@metux.de
cellphone: +49 174 7066481
---------------------------------------------------------------------
Diese Mail wurde mit UUCP versandt. http://www.metux.de/uucp/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


我现在几乎有同样的需求并得出结论:postgres

just不适合嵌入这样的应用程序。我要用

sqlite,它运行得相当好。我们在php中为sqlite创建了用户定义的函数

以匹配postgres中的日期函数。谁知道什么

我们可能遇到的其他问题但到目前为止sqlite工作得相当好。


我认为sqlite将所有内容存储为字符串但是用于搜索,

排序,订购等它使用类型信息。


我绝对喜欢只包含一个postgres dll并有postgres

正在处理中,只是将所有内容存储在一个漂亮的小文件中,但是从我听到的内容中读取的内容将会涉及到开发人员对b / b
感兴趣的重大更改。到目前为止,sqlite已经为我完成了这项工作。


另外我正在考虑寻找一个嵌入式数据库的firebird

解决方案,因为它可以让你几乎是你的在这里讨论的是使用单个文件存储数据的proccess db中的
。虽然我不想b $ b想要将我的服务器切换到它,但它可能比

sqlite更完整(我确定它有日期和算术功能)并且在嵌入式情况下可以很好地工作。


我会想看看你最终会做什么。


Rick


-----原始消息-----

来自:Jeff Bowden < jl *@houseofdistraction.com>

收件人:pgsql-general < pg *********** @ postgresql.org>

发送时间:2004年1月13日星期二下午2:38

主题:[ GENERAL]无服务器postgresql

I have just about the same sort of needs now and concluded that postgres
just is not suited for embedding into apps like that. I am going with
sqlite and it is working fairly well. We just made user defined functions
in php for sqlite to match the date functions in postgres. Who knows what
other issues we may run into but so far sqlite is working fairly well.

I think that sqlite stores everything as a string but for searching,
sorting, ordering etc it uses the type info.

I to would absolutely love to just include a postgres dll and have postgres
in process and just store everything in a nice little file but from what I
have read hear that would involve major changes that the developers on not
interested in making. So far sqlite has done the job for me.

Also I am considering looking into firebird for an embedded database
solution since it can you pretty much what you are talking about here with
an in proccess db that uses a single file to store it''s data. While I don''t
want to switch my server stuff to it, it is probably more full featured than
sqlite (I''m sure it has date and arithmatic functions) and is made to work
well in embedded situations.

I would be intersted to see what you end up doing.

Rick

----- Original Message -----
From: "Jeff Bowden" <jl*@houseofdistraction.com>
To: "pgsql-general" <pg***********@postgresql.org>
Sent: Tuesday, January 13, 2004 2:38 PM
Subject: [GENERAL] serverless postgresql

为了便于配置和其他原因,我希望我的
单用户GUI应用程序能够使用postgresql-作为库的过程访问在用户主目录中创建的数据库。我认为我可以通过使用适当的args启动postmaster的专属副本来获得我想要的东西但是在概念上看起来更干净,根本没有单独的过程。有没有人试图做这样的事情?

我看过sqlite,它对我的​​项目可能是可行的,但我更喜欢更标准和更有特色的postgres SQL。在
特别是sqlite缺少日期算术并且有一些有趣的类型问题
(它声称是无类型的,除非它不是,或者什么)。


---------------------------(广播结束)----------------- ----------
提示1:订阅和取消订阅命令转到 ma ***** **@postgresql.org
For ease of configuration and other reasons, I would like for my
single-user GUI app to be able to use postgresql in-process as a library
accessing a database created in the users home directory. I think I
could possibly get what I want by launching a captive copy of postmaster
with appropriate args but it seems conceptually cleaner to not have a
seperate process at all. Has anyone tried to do anything like this?

I''ve looked at sqlite and it might be workable for my project but I
would prefer the more standard and featureful SQL of postgres. In
particular sqlite lacks date arithmetic and has some funny type issues
(it claims to be typeless, except when it isn''t, or something).

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org



---------------------------(广播结束)---------------------------

提示4:不要杀人 - 9''邮政局长


---------------------------(end of broadcast)---------------------------
TIP 4: Don''t ''kill -9'' the postmaster


" Rick Gigger" < RI ** @ alpinenetworking.com>写道:
"Rick Gigger" <ri**@alpinenetworking.com> writes:
我绝对喜欢只包含一个postgres dll并有postgres
正在处理并将所有内容存储在一个漂亮的小文件中但是从我读过的内容中听到的这将涉及开发人员没有兴趣做出的重大改变。
I to would absolutely love to just include a postgres dll and have postgres
in process and just store everything in a nice little file but from what I
have read hear that would involve major changes that the developers on not
interested in making.




开发人员不仅对开发人员不感兴趣,开发人员也积极地

反对。我们认为嵌入式数据库库不可靠,足以满足我们对数据库的概念,因为只要周围的应用程序有一个,就会受到

失败的影响。错误。在一个单独的过程中保留

客户端代码是一个更加强大的设计。


问候,tom lane


---------------------------(广播结束)----------------- ----------

提示1:订阅和取消订阅命令转到 ma * ******@postgresql.org



Not only are the developers uninterested in it, the developers actively
oppose it. We think an embedded database library cannot be reliable
enough to meet our notion of a "database", since it would be subject to
failures anytime the surrounding application has a bug. Keeping the
client code in a separate process is a far more robust design.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org


这篇关于无服务器的postgresql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆