postgresql

Where does PostgreSQL store the database?

Where are the files for my PostgreSQL database stored? I know that with MySQL it stores a file for each table and that PostgreSQL does something different but it's got to store it's data somewhere when I turn my computer off and I'm trying to figure out where. ...

Good C/C++ connector library for PostgreSQL

My application is a commercial GIS C++ application, and I'm looking for a robust/easy to use connector for Postgresq. (Side note: I also plan to use PostGIS) Does anyone have any recommendations based on your experience? A plus would be if you have tried out various ones. I have looked at: Postgres's C client pqxx QSql EDIT Also, d...

PHP and Databases: Views, Functions and Stored Procedures performance

I'm working on a PHP web application with PostgreSQL. All of the SQL queries are being called from the PHP code. I've seen no Views, Functions or Stored Procedures. From what I've learned, it's always better to use these database subroutines since they are stored in the database with the advantages: Encapsulation Abstraction Access rig...

Postgresql vlookup

Let's say I have a table "uservalue" with the following columns: integer user_id integer group_id integer value I can get the maximum value for each group easily: select max(value) from uservalue group by group_id; What I would like is for it to return the user_id in each group that had the highest value. The max function in matla...

Upper Limit for Number of Rows In Open Source Databases?

I have a project in which I'm doing data mining a large database. I currently store all of the data in text files, I'm trying to understand the costs and benefits of storing the data relational database instead. The points look like this: CREATE TABLE data ( source1 CHAR(5), source2 CHAR(5), idx11 INT, idx12 INT, ...

Reverse foreign key to django-fts searchable model in template

I have a pair of Django models with a foreign key, one of which is searchable with django-fts, say: class Foo(models.Model): ... class Bar(fts.SearchableModel): foo = models.ForeignKey(Foo) When I have an instance of Foo, in view I can insert print foo.bar_set.all() and I see an array of results. However if I try to use it in...

weird problem with OdbcDataReader.GetBoolean() throwing cast is not valid exception for bool column

Ok, this one is driving me completely crazy. I have a table in a PostgreSQL database and I'm trying to get the value a boolean column for a specific record with OdbcDataReader.GetBoolean(int col). The problem is that GetBoolean() keeps throwing a cast is not valid exception even though the same code worked just several days ago. What's...

planning for oracle takeover of sun - farewell mysql?

Now that the shareholders have voted and oracle will be taking over SUNW, does anyone have any facts about the implication for mysql users? If you don't have facts, I suppose conjecture would be interesting as well (but please label it so). I was afraid of what would happen when the original mysql team sold out to SUN (I don't blame th...

PHP & Postgres: View vs. SELECT, when to use a view?

Related to my previous question: PHP and Databases: Views, Functions and Stored Procedures performance Just to make a more specific question regarding large SELECT queries. When would it be more convenient to use a View instead of writing the SELECT query in the code and calling it: $connector->query($sql)->fetchAll(); What are the ...

SQL Find all direct descendants in a tree

I have a tree in my database that is stored using parent id links. A sample of what I have for data in the table is: id | name | parent id ---+-------------+----------- 0 | root | NULL 1 | Node 1 | 0 2 | Node 2 | 0 3 | Node 1.1 | 1 4 | Node 1.1.1| 3 5 | Node 1.1.2| 3 Now I would like to get a list o...

Python threads - crashing when they access postgreSQL

Hello, here is a simple threading program which works fine: import psycopg2 import threading import time class testit(threading.Thread): def __init__(self, currency): threading.Thread.__init__(self) self.currency = currency def run(self): global SQLConnection global cursor SQLString = "...

PostgreSQL via subsonic

Hi. I try to work with my postgre DB via SubSonic. I have simple config: <configuration> <connectionStrings> <add name="test" connectionString="Server=localhost;Port=5432;User Id=iliy;Password=111;Database=test;" providerName="Npgsql"/> </connectionStrings> </configuration> But it does not work. I got "Unable to fi...

postgres full text search

Hi! I am doing a web-project based on asp.net mvc framework. As db I am using postgre SQL. The question is how to organize searching in my application. One option would be using of .net libraries such as lucene.net. Another option is to use the Postgre full text search. So what is the best option? ...

Postgres: SQL to list table foreign keys

Is there a way using SQL to list all foreign keys for a given table? I know the table name / schema and I can plug that in. ...

Eliminating Duplicate rows in Postgres

I want to remove duplicate rows return from a SELECT Query in Postgres I have the following query SELECT DISTINCT name FROM names ORDER BY name But this somehow does not eliminate duplicate rows? ...

Postgresql: is better using multiple databases with 1 schema each, or 1 database with multiple schemas?

After this comment to a my question, im thinking if is better using 1 database with X schemas or viceversa. My situation: im developing a web-app where, when people do register, i create (actually) a database (no, its not a social network: everyone must have access to his own data and never see the data of the other user). Thats the wa...

PostgreSQL exclusive lock stops application.

My applications tests are pretty hard on the database. They run create, drop and alter table statements. However, I would still expect postresql to handle these even in the case of a deadlock (i.e detect the lock and trow one thread out). I am not running requests concurrently either. However, in my case it just freezes and I have to m...

Downside to using persistent connections?

I have heard in the past that persistent connections are not good to use on a high traffic web server. Is this true, or does it only apply to apache's prefork mode? Would CGI mode have this problem? This involves PHP, Apache, and Postgresql. ...

Postgres visual database design tool for Linux

I'm not looking for something like phpPgAdmin or pgAdmin III. I'm looking for something similar to MySQL Workbench. A tool to design databases visually and convert those visual designs into queries that will generate the database. It should also be able to create a visual representation of an existing database and use that visual repr...

How to use schemas in Django?

I whould like to use postgreSQL schemas with django, how can I do this? ...