postgresql

"Can't adapt type" error on a Foreign key attribute with SQLAlchemy/PostGreSQL

I got a problem with PostGreSQL 8.4 and tables reflection. My metadata object seems to be ok (it has foreign keys, primary keys, every columns and tables). But when I try to associate an object to an another one through a Foreign key, I get : "sqlalchemy.exc.ProgrammingError: (ProgrammingError) can't adapt type 'EventParameters' 'INSERT ...

Ruby/Rails/PostgreSQL PGError: syntax error at or near

I'm getting the error in the title when trying to select a cookie value from a table in a postgresql database, and I've no idea why. Selecting other fields in this table work fine. Here's the line where it is breaking: user=UniqueUser.find(:all, :select => 'DISTINCT visitor_id', :conditions=> "visitor_id=#{visitorid}") The column is...

Help me select RDBMS for a standalone app. Few Concerns.

My app. is in C# 3.5 and MySQL 5.1. It is a Windows based standalone application. It is running successfully since last two years except few issues and that too were later found out to be MySQL bugs. The bug disturbed the real-time reports as it store the same timestamp in two rows. I don't know whether MySQL fixed it or not so I want t...

PHP prepared postgres query fails with:"could not determine data type of parameter $1"

Hello everyone. I currently have to implement a query on a postgres database using a prepared statement. My current code looks like this: $arrFilter = array("", ""); $result = $db->prepare("select_music", "SELECT * FROM tblmusik WHERE lm_titel LIKE '%" . "$1" . "%' AND lm_text LIKE '%" . "$2" . "%'); ( db->prepare() just executes p...

3CX Report from Database

i need to create various report from 3cx phonesystem database. i have phonesystem DB in postgreSQL. but i couldnt understand the DB Structure. Is there any documentation to study about 3cx phonesystem db. i have 3cx software. But for my report , i cant use that software. ...

PostgreSQL's .NET provider runs slow as compared to the old ODBC provider.

Why is it that the NPGSQL .NET Data Provider is slow when compared with the ODBC Provider? I have not tried NPGSQL 2.0 but I did worked with NPGSQL 1.0. It was very slow. What are your experiences with NPGSQL 2.0? ...

SQL IN operator in the WHERE clause

The following query: SELECT SUM (peak_power) FROM t_mpi_pv WHERE info_id IN ( SELECT mp_info_id FROM t_mp WHERE mp_id IN ( ARRAY[29800001,29800008,29800015,29800022,29800029] ) ) Doesn't work. I get the error: "Operator does not exist: integer = integer[]". But SELECT SUM (peak_power) FROM t_mpi_pv WHERE info_id IN ( SEL...

Selecting two counts on two joins in one query

create table Autorzy(ID int, imie varchar, nazwisko varchar); create table Wydawnictwa(ID int, nazwa varchar, adres varchar, tel varchar); create table Ksiazki(ID int, ISBN bigint, wydawnictwo_id int, data date, ilosc int, tytul varchar); create table KsiazkaAutor(ID int, autor_id int, ksiazka_id int); create table Recenzje (id int, tres...

need sequence as A1 A2 in postgres

Dear all, Using sequence we can insert a sequence of integers in postgers like that I just want to insert A1 and A2 , Is this possible to do this in a straight forward manner , or otherwise do need to write a function ? Please let me know the easiest way of doing this Thanks in advance ! ...

Stored procedures and Triggers in PostgreSQL

I never used these two features in PostgreSQL. Which language is used to write stored procedures and triggers in PGSQL? Is it the same that Oracle or SQL Server follows or it is C? ...

how to make array_agg() work like group_concat() from mySQL

So I have this table: create table test ( id integer, rank integer, image varchar(30) ); Then some values: id | rank | image ---+------+------- 1 | 2 | bbb 1 | 3 | ccc 1 | 1 | aaa 2 | 3 | c 2 | 1 | a 2 | 2 | b I want to group them by id and concatenate the image name in the or...

Compatible boolean data type of various relational databases

I am trying to create a select statement that is compatible with all major relational databases (MySQL, PostgreSQL, Derby, SQLite, ...). Here the simple select statement: SELECT * FROM taggings WHERE public IS TRUE The problem is that SQLite for example does not support the boolean data type, so I rewrote my statement to: SELECT * FROM...

Pick another RDBMS

Other then Oracle, MySQL, and PostgreSQL, what is out there? Is there anything else used in a production environment? By production I mean it's used to support an active project or application and not an unstable system. I'm curious about other database systems (aside from NoSQL) that are applicable for use. Looking at the feature set ...

JPA 2 (EclipseLink) Trying to use UUID as primary key EntityManager.find() always throws exception (Database is PostgreSQL)

I'm trying to use a UUID for a primary key using JPA 2 (EclipseLink). I'm using PostgreSQL as the database. I have my entity declared as follows: I have an Employee table with its PK set as a UUID. I have a JPA Entity mapping to the employee table, which looks like this: @Entity public class Employee { @Id private String id; ...

Which variant of PostgreSQL to choose for my .NET app.?

I want to use PostgreSQL for my standalone .NET Windows application. I downloaded PostgreSQL Advanced Server from EnterpriseDB's website and it is very smooth. The GUI also very good. But I suspect how along EnterpriseDB will support it. The second option is to download from postgresql.org. I want an edition that lasts long and I can e...

Can PostgreSQL index array columns?

I can't find a definite answer to this question in the documentation. If a column is an array type, will all the entered values be individually indexed? I created a simple table with 1 int[] column, and put a unique index on it. What I noticed is that I couldn't add the same array of ints, which leads me to believe the index is a compos...

For a beginner, is there much difference between MySQL and PostgreSQL

IS there much difference between MySQL and PostgreSQL for a beginner like me, using basic select statements and the like, or are the main differences with using more advanced queries? ...

Trying to use jdbc driver for postgresql but it's not working

I have added the jdbc driver to my classpath as far as I know i.e. I added the following to my .profile export CLASSPATH=$CLASSPATH:location/to/the/jarfile.jar When I compile my java program I always get this error javac v9.java v9.java:8: <identifier> expected Class.forName("org.postgresql.Driver");//load the driver ^ v9.j...

Python and psycopg detect network error

Hi When connected to a postgresql database using psycopg and I pull the network cable I get no errors. How can I detect this in code to notify the user? ...

Detect that an UPDATE has failed in PostgreSQL SQL-procedure (not PlPgSQL)

Hello, to mimic the MySQL-REPLACE statement (aka UPSERT) I need to try to UPDATE a record and if that fails - INSERT it. But how can I detect that the UPDATE has failed in my SQL procedure? begin transaction; create table pref_users ( id varchar(32) primary key, first_name varchar(32), last_name ...