sql-postgres

how to get SQL-postgres to work in XEmacs 21.4.22 on windows vista

I've previously used sql-oracle just fine in Xemacs on XP and vista. However, now I'm using Postgresql psql on the command line but I kinda find it lame (as compared to using sql-* from within emacs) So, I'm trying to get it(psql) working within xemacs(21.4.22) on windows. When I type M-x sql-postgres ENTER, I get the following 3 pro...

how does postgreSQL 8 handle concurrency control

Am using postgreSQL 8 to create a database. I have noticed that it migt suffer a problem with concurrency control. 1. please explain to me how does postgreSQL 8 handle concurrency control? 2. when comparing MY SQL with postgreSQL which of these is best to handle concurrency control. ...

ERROR: invalid input syntax for type date: ""

I have the following psql query and can't understand why I get error ERROR: invalid input syntax for type date: "". My query looks as follows: SELECT count(*) FROM campaigns WHERE dstart >= '2010-09-02' AND dend <= '2010-09-02' AND status != 'S' AND status != 'C' AND status != 'E' AND (dsignoff <> '' AND...

PostgreSQL HAVING clause

I posted on here last night looking for help with some homework. I'm down to my last question. Here's the relevant piece of the schema I am working with: CREATE TABLE votesOnPoll( user_id int, poll_id int, option_id int, voteDate date, CONSTRAINT votesOnPoll_pk PRIMARY KEY (user_id, poll_id), CONSTRAINT votesOnPoll_user_f...

Getting all records that are 3months old in Postgres

I need to find all records that are exactly 3months old in Postgres My query looks as follows. SELECT * FROM adds WHERE adtype = 'CL' AND DATEDIFF(dstart,DATE(now())) = DATE_SUB(curdate(),interval 3 month); But this does not seem to work. Any advise help with this query will be helpful. I can calculate this in PHP but want to find out...

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...

Find missing rows using SQL

I have an SQL table as such name | engins| frank ---------------------------+-------+------ John Smith | 8422| 854 (1 rows) And need to make a query such that only return the row john smith when engins is more than 2000 ...