473,395 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Serials in where clause

Im having trouble whith a Serial Primary key that i cannot use in a where
clause

here is what i did

ixmati=# create table jordi(
ixmati(# "jordi_idPK" serial NOT NULL,
ixmati(# jordi_nombre varchar);
NOTICE: CREATE TABLE creará una secuencia implícita "jordi_jordi_idPK_seq"
para la columna "serial" "jordi.jordi_idPK"
CREATE TABLE
ixmati=# alter table only jordi
ixmati-# add constraint "jordi_idPK" primary key ( "jordi_idPK");
NOTICE: ALTER TABLE / ADD PRIMARY KEY creará el índice implícito "jordi_idPK"
para la tabla "jordi"
Here is the error
ixmati=# select * from jordi where jordi_idPK = 1;
ERROR: column "jordi_idpk" doesn't exists
Any ideas??
thanx
j0rd1
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
3 1343
Try this:

select * from jordi where "jordi_idPK" = 1
El 05/07/2004 12:31 PM, j0rd1 adame en su mensaje escribio:
Im having trouble whith a Serial Primary key that i cannot use in a where
clause

here is what i did

ixmati=# create table jordi(
ixmati(# "jordi_idPK" serial NOT NULL,
ixmati(# jordi_nombre varchar);
NOTICE: CREATE TABLE creará una secuencia implícita "jordi_jordi_idPK_seq"
para la columna "serial" "jordi.jordi_idPK"
CREATE TABLE
ixmati=# alter table only jordi
ixmati-# add constraint "jordi_idPK" primary key ( "jordi_idPK");
NOTICE: ALTER TABLE / ADD PRIMARY KEY creará el índice implícito "jordi_idPK"
para la tabla "jordi"
Here is the error
ixmati=# select * from jordi where jordi_idPK = 1;


--
Sinceramente,
Josué Maldonado.

"Theta pone orden en el caos conquistando todo lo que en mest pueda ser
prosupervivencia y destruyendo todo lo que en mest pueda ser
contrasupervivencia, al menos por medio de organismos vivos."

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
El Lun 05 Jul 2004 14:03, Stephan Szabo escribió:
You created the column with double quotes, so when you want to refer to
it, you should use double quotes as well ("jordi_idPK" = 1)

This is an error I had for creating tables using pgadmin3, but now i know
thanx

j0rd1

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3
On Mon, 5 Jul 2004, j0rd1 adame wrote:
Im having trouble whith a Serial Primary key that i cannot use in a where
clause

here is what i did

ixmati=# create table jordi(
ixmati(# "jordi_idPK" serial NOT NULL,
ixmati(# jordi_nombre varchar);
NOTICE: CREATE TABLE creará una secuencia implícita "jordi_jordi_idPK_seq"
para la columna "serial" "jordi.jordi_idPK"
CREATE TABLE
ixmati=# alter table only jordi
ixmati-# add constraint "jordi_idPK" primary key ( "jordi_idPK");
NOTICE: ALTER TABLE / ADD PRIMARY KEY creará el índice implícito "jordi_idPK"
para la tabla "jordi"
Here is the error
ixmati=# select * from jordi where jordi_idPK = 1;
ERROR: column "jordi_idpk" doesn't exists


You created the column with double quotes, so when you want to refer to
it, you should use double quotes as well ("jordi_idPK" = 1)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS...
2
by: Jim.Mueksch | last post by:
I am having a problem with using calculated values in a WHERE clause. My query is below. DB2 gives me this error message: Error: SQL0206N "APPRAISAL_LESS_PRICE" is not valid in the context where...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
5
by: pwiegers | last post by:
Hi, I'm trying to use the result of a conditional statement in a where clause, but i'm getting 1)nowhere 2) desperate :-) The query is simple: -------- SELECT idUser,...
92
by: bonneylake | last post by:
Hey Everyone, Well i was hoping someone could explain the best way i could go about this. i have a few ideas on how i could go about this but i am just not sure if it would work. Right now i...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.