Hi Muhammad,
My mistake re PostgreSQL - I was misled by its support for an Oracle PL-SQL language variant. You say that PostgreSQL forced you to use quotes in the create. I still think that is your basic problem. What happens if you don't put the quotes in the create? Regards, Tony From: interest-bounces+tony=rightsoft.com...@qt-project.org [mailto:interest-bounces+tony=rightsoft.com...@qt-project.org] On Behalf Of Muhammad Bashir Al-Noimi Sent: Tuesday, 9 April 2013 7:04 AM To: interest@qt-project.org Subject: Re: [Interest] QSqlTableModel - table name issue in Postresql On 04/08/2013 03:00 AM, Tony Rietwyk wrote: Hi Muhammad, I don't know Postgresql at all. I believe it is based on Oracle. Oops!! you don't know Postgresql!!! It's not related to Oracle https://en.wikipedia.org/wiki/Postgresql Your problem sounds like the table name was quoted in the create statement, leading to the mixed-case table name being stored in the database. After that you must always quote the table name in any sql, otherwise it gets converted to uppercase, and doesn't match. What was the create statement used for the table? I don't think that create statement related to this issue because Postgresql forced me to use quotes... any way I'll give you the statement: CREATE TABLE "Persons" ( id integer NOT NULL, name text, address text, image text, email text, CONSTRAINT "Persons_pkey" PRIMARY KEY (id ) ) WITH ( OIDS=FALSE ); ALTER TABLE "Persons" OWNER TO postgres; What is the exact error message you are getting back? " Unable to find table Persons" I used these line to get the above error message: if (!p_tableModel->select()) qDebug() << p_tableModel->lastError().text(); -- Best Regards, Muhammad Bashir Al-Noimi
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest