Re: Query Fails

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sheikh Salman Ahmed <salman_sheikh(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query Fails
Date: 2008-07-01 08:58:26
Message-ID: 4869F1B2.3030703@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sheikh Salman Ahmed wrote:
> Hallo Fellows
>
> I am a new User of postgresql.I have installed it on window XP.I feel it little complicated on Window.I have already connected it with visual c++ 2005,but when i wanted to insert some data in my databank,then it fails and shows sytax error or doesn't recognise my table, but connection to data it shows.
> i am using this code to insert data.
>
> res = PQexec (conn, "INSERT INTO public.Person values (121,'xxx','yyy')");

You probably need to provide the error message for anyone to be sure.

However, at a guess you created your table as "Person" which means it's
case-sensitive. You're now trying to access it without quotes which
means it gets case-folded to "person". Search the list archives for
plenty of discussion.

Summary:
CREATE TABLE FOO
SELECT * FROM foo -- works
SELECT * FROM Foo -- works

CREATE TABLE "FOO"
SELECT * FROM foo -- fails
SELECT * FROM FOO -- fails
SELECT * FROM "FOO" -- works

--
Richard Huxton
Archonet Ltd

In response to

  • Query Fails at 2008-06-30 20:37:29 from Sheikh Salman Ahmed

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2008-07-01 09:05:16 Re: FTS question
Previous Message Rafael Martinez 2008-07-01 08:45:07 Problems with a C function, pg_uname(), and String concatenation.