postgresql

postgres and python

我的未来我决定 提交于 2021-02-07 04:52:09
问题 In postgres 9.2 I am trying to create a python program that can be a trigger. I want to run an external program (an exe on the local disk) so I am using python to run it. When I try to create a simple program like this: CREATE FUNCTION one () RETURNS int AS $$ # PL/Python function body $$ LANGUAGE plpythonu; I get the error: ERROR: language "plpythonu" does not exist HINT: Use CREATE LANGUAGE to load the language into the database. When I run: CREATE LANGUAGE plpythonu I get the error: ERROR:

Can't connect to Postgres database with Bitnami Django stack

折月煮酒 提交于 2021-02-07 04:32:05
问题 I keep running into the problem of not being able to connect to the database: psycopg2.OperationalError: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/tmp/.s.PGSQL.5432”? I did some reading and it seems like it’s a quite common problem that most people fix by checking that the port is correct, ie from changing 5432 to 5433 in their setup.py. But this does not seem to be my problem – in the /opt/bitnami

Generate Python Class and SQLAlchemy code from XSD to store XML on Postgres

*爱你&永不变心* 提交于 2021-02-07 04:24:13
问题 I have some very complex XSD schemas to work with. By complex I mean that each of these XSD would correspont to about 20 classes / tables in a database, with each table having approximately 40 fields. And I have 18 different XSD like that to program. What I'm trying to achieve is: Get a XML file defined by the XSD and save all the data in a PostgreSQL database using SQLAlchemy. Basically I need a CRUD application that will persist a XML file in the database following the model of the XSD

Generate Python Class and SQLAlchemy code from XSD to store XML on Postgres

北慕城南 提交于 2021-02-07 04:24:03
问题 I have some very complex XSD schemas to work with. By complex I mean that each of these XSD would correspont to about 20 classes / tables in a database, with each table having approximately 40 fields. And I have 18 different XSD like that to program. What I'm trying to achieve is: Get a XML file defined by the XSD and save all the data in a PostgreSQL database using SQLAlchemy. Basically I need a CRUD application that will persist a XML file in the database following the model of the XSD

Postgresql fulltext search for Czech language (no default language config)

╄→尐↘猪︶ㄣ 提交于 2021-02-07 03:57:45
问题 I am trying to setup fulltext search for Czech language. I am little bit confused, because I see some cs_cz.affix and cs_cz.dict files inside tsearch_data folder, but there is no Czech language configuration (it's probably not shipped with Postgres). So should I create one? Which dics do I have to create/config? Is there some support for Czech language at all? Should I use all possible dicts? ( Synonym Dictionary, Thesaurus Dictionary, Ispell Dictionary, Snowball Dictionary ) I am able to

Postgresql fulltext search for Czech language (no default language config)

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 03:57:32
问题 I am trying to setup fulltext search for Czech language. I am little bit confused, because I see some cs_cz.affix and cs_cz.dict files inside tsearch_data folder, but there is no Czech language configuration (it's probably not shipped with Postgres). So should I create one? Which dics do I have to create/config? Is there some support for Czech language at all? Should I use all possible dicts? ( Synonym Dictionary, Thesaurus Dictionary, Ispell Dictionary, Snowball Dictionary ) I am able to

How to process distributed transaction within postgresql?

我只是一个虾纸丫 提交于 2021-02-07 03:56:44
问题 Anyone can kindly tell me how to process distributed transaction within postgresql, which is also called "XA"? Is there any resources about it? Great thanks for any answer. 回答1: It looks like you are a bit confused. Generally database systems support two notions of distributed transaction types: Native distributed transactions and XA transactions. Native distributed transactions are generally between different servers of the same RDBMS. Postgres also supports this with the dblink_exec command

How to auto generate IDs in NHibernate

混江龙づ霸主 提交于 2021-02-07 03:33:05
问题 How can I make NHibernate autogenerate unique IDs for a table? The IDs can be any long values, as long as each one is only used once. My current mapping looks like this: <id name="Id"> <generator class="increment"/> </id> This creates increasing IDs starting at 1, but it resets to 1 at each application startup. So the after each restart, the first element that is stored gets the Id 1 and the previous Id 1 element is deleted (not what I want). Edit: The reason for this is that I used

How to auto generate IDs in NHibernate

青春壹個敷衍的年華 提交于 2021-02-07 03:31:27
问题 How can I make NHibernate autogenerate unique IDs for a table? The IDs can be any long values, as long as each one is only used once. My current mapping looks like this: <id name="Id"> <generator class="increment"/> </id> This creates increasing IDs starting at 1, but it resets to 1 at each application startup. So the after each restart, the first element that is stored gets the Id 1 and the previous Id 1 element is deleted (not what I want). Edit: The reason for this is that I used

How to change max_connections for Postgres through SQL command

你说的曾经没有我的故事 提交于 2021-02-07 03:17:12
问题 We have a hosted PostgreSQL, with no access to the system or *.conf files. I do have a admin access and can connect to it using Oracle SQL developer. Can I run any command to increase the max_connections. All other parameters seems to be ok shared mem and buffers can hold more connections so there is not problem there. 回答1: Changing max_connection parameter needs a Postgres restart Commands Check max_connection just to keep current value in mind SHOW max_connections; Change max_connection