Thread: some error when executing query in pgAdmin tool
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">I created one table in pgAdmin tool but when I am executing query it is giving error….</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">CREATE TABLE "ADV"</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">(</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "T-Section_Id" varchar(10) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> "CDA_No" varchar(7) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "Imp_Schedule_Id" int4 NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> "Sanction_No" varchar(20) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> "Sanction_Date" date NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "Station_From" varchar(20) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> "Station_To" varchar(20) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> "Amt_Claimed" int4,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "Amt_Admitted" int4,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "Dak_Id" varchar(20) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "Refund_Dak_Id" int4 NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> "T-Wing_Allowance_Id" varchar(10) NOT NULL,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id")</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">) </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">WITHOUT OIDS;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">ALTER TABLE "ADV" OWNER TO postgres;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Above table I created…..</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Select * from ADV; when I am executing this query I am getting error is</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Relation ADV does not exist… like this error is giving … may I know y am I getting this error</span></font><pclass="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="navy" face="Tahoma"size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">Thanks & Regards</span></font><font color="navy"><span style="color:navy"></span></font></b><pclass="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="navy"face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">Penchal reddy </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> Software Engineer </span></font><font color="navy"><span style="color:navy"></span></font></b><pclass="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="navy"face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">Infinite Computer Solutions </span></font></b><b><font color="red" face="Tahoma" size="1"><spanstyle="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> Exciting Times…Infinite Possibilities... </span></font><font color="navy"><span style="color:navy"></span></font></b><pclass="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="navy"face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">SEI-CMMI level 5 </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">| </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black; font-weight:bold">ISO 9001:2000</span></font><font color="navy"><span style="color:navy"></span></font></b><p class="MsoNormal"style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">IT SERVICES </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> BPO </span></font><fontcolor="navy"><span style="color:navy"></span></font></b><p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><fontcolor="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">Telecom </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black;font-weight:bold">Finance</span></font></b><b><font color="red" face="Tahoma"size="1"><span style="font-size: 8.0pt;font-family:Tahoma;color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><spanstyle="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold"> </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black; font-weight:bold">Healthcare </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:red; font-weight:bold">| </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black;font-weight:bold">Manufacturing</span></font></b><b><font color="red"face="Tahoma" size="1"><span style="font-size: 8.0pt;font-family:Tahoma;color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><spanstyle="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold"> </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black; font-weight:bold">Energy & Utilities </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black;font-weight:bold">Retail& Distribution </span></font></b><b><fontcolor="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:red;font-weight:bold">|</span></font></b><b><fontcolor="navy" face="Tahoma"size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold"> </span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black; font-weight:bold">Government </span></font><font color="navy"><spanstyle="color:navy"></span></font></b><p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><fontcolor="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:navy;font-weight:bold">Tel +91-80-5193-0000(Ext:503)</span></font></b><b><font color="red" face="Tahoma" size="1"><spanstyle="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> Fax +91-80-51930009 </span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold"> Cell No +91-9980012376</span></font></b><b><font color="red" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:red;font-weight:bold">|</span></font></b><b><font color="navy" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:navy; font-weight:bold">www.infics.com</span></font></b><b><font color="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:black; font-weight:bold"> </span></font><font color="navy"><span style="color:navy"></span></font></b><p class="MsoNormal"style="mso-margin-top-alt:auto;margin-bottom:5.0pt"><b><font color="gray" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:gray;font-weight:bold">Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and/ orits Customers and is intended for use only by the individual or entity to which it is addressed, and may contain informationthat is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipientor it appears that this mail has been forwarded to you without proper authority, you are notified that any use ordissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at</span></font></b><b><fontcolor="black" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:black;font-weight:bold"> </span></font></b><b><u><font color="gray" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma;color:gray; font-weight:bold">info.in@infics.com </span></font></u></b><b><font color="gray" face="Tahoma" size="1"><span style="font-size:8.0pt;font-family:Tahoma; color:gray;font-weight:bold">and delete this mail from your records.</span></font><font color="navy"><span style="color:navy"></span></font></b><pclass="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12.0pt"> </span></font></div>
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Penchalaiah P.
Sent: 23 May 2006 13:11
To: pgsql-sql@postgresql.org
Subject: [SQL] some error when executing query in pgAdmin tool
I created one table in pgAdmin tool but when I am executing query it is giving error….
CREATE TABLE "ADV"
(
"T-Section_Id" varchar(10) NOT NULL,
"CDA_No" varchar(7) NOT NULL,
"Imp_Schedule_Id" int4 NOT NULL,
"Sanction_No" varchar(20) NOT NULL,
"Sanction_Date" date NOT NULL,
"Station_From" varchar(20) NOT NULL,
"Station_To" varchar(20) NOT NULL,
"Amt_Claimed" int4,
"Amt_Admitted" int4,
"Dak_Id" varchar(20) NOT NULL,
"Refund_Dak_Id" int4 NOT NULL,
"T-Wing_Allowance_Id" varchar(10) NOT NULL,
CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id")
)
WITHOUT OIDS;
ALTER TABLE "ADV" OWNER TO postgres;
Above table I created…..
Select * from ADV; when I am executing this query I am getting error is
Relation ADV does not exist… like this error is giving … may I know y am I getting this error
Try
SELECT * FROM "ADV";
pgAdmin quoted the tablename because you used uppercase characters. Without the quotes, the name is folded to lowercase.
Regards, Dave.
From: Penchalaiah P. [mailto:penchalaiahp@infics.com]
Sent: 23 May 2006 13:18
To: Dave Page
Subject: RE: [SQL] some error when executing query in pgAdmin toolHi sir…
I tried like that also … but I am getting same error……I tried like these……
1).Select * from adv;
2). Select * from “adv”;
3).Select * from public.adv; here public is the schema name
Like I said, try:
SELECT * FROM "ADV";
You created the table with a quoted, uppercase name, so that is how you must reference it.
Regards, Dave
Penchalaiah P. wrote: > I created one table in pgAdmin tool but when I am executing query it > is giving error…. > > CREATE TABLE "ADV" > > ( > > "T-Section_Id" varchar(10) NOT NULL, > > "CDA_No" varchar(7) NOT NULL, > > "Imp_Schedule_Id" int4 NOT NULL, > > "Sanction_No" varchar(20) NOT NULL, > > "Sanction_Date" date NOT NULL, > > "Station_From" varchar(20) NOT NULL, > > "Station_To" varchar(20) NOT NULL, > > "Amt_Claimed" int4, > > "Amt_Admitted" int4, > > "Dak_Id" varchar(20) NOT NULL, > > "Refund_Dak_Id" int4 NOT NULL, > > "T-Wing_Allowance_Id" varchar(10) NOT NULL, > > CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id") > > ) > > WITHOUT OIDS; > > ALTER TABLE "ADV" OWNER TO postgres; > > Above table I created….. > > Select * from ADV; when I am executing this query I am getting error is > > Relation ADV does not exist… like this error is giving … may I know y > am I getting this error > > *Thanks & Regards* > > *Penchal reddy **|** Software Engineer * > > *Infinite Computer Solutions **|** Exciting Times…Infinite > Possibilities... * > > *SEI-CMMI level 5 **| **ISO 9001:2000* > > *IT SERVICES **|** BPO * > > *Telecom **|** **Finance **|** **Healthcare **| **Manufacturing **|** > **Energy & Utilities **|** **Retail & Distribution **|** **Government * > > *Tel +91-80-5193-0000(Ext:503)**|** Fax +91-80-51930009 **|** Cell No > +91-9980012376**|**www.infics.com** * > > *Information transmitted by this e-mail is proprietary to Infinite > Computer Solutions and/ or its Customers and is intended for use only > by the individual or entity to which it is addressed, and may contain > information that is privileged, confidential or exempt from disclosure > under applicable law. If you are not the intended recipient or it > appears that this mail has been forwarded to you without proper > authority, you are notified that any use or dissemination of this > information in any manner is strictly prohibited. In such cases, > please notify us immediately at** **_info.in@infics.com _**and delete > this mail from your records.* > by quoting ADV in the CREATE TABLE you made it case-sensitive then by not quoting it in the SELECT, you used the case-insensitive form, wich PostgreSQL (IIRC) translates as lower case adv != ADV