From: | Jonas Schwanbom <cygnent(at)gmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Basics fails; SELECT, UPDATE |
Date: | 2013-06-26 11:00:47 |
Message-ID: | CAGMbmfY22ZzuV0J074DiwgzPhgazHeLDCydzLq9GinN5c9tBdg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hello! Nice strangers. I'll keep to the basics, both (re)questing (?)
(pardon my english) and answering.
PostgreSQL won't select a specific row and it won't change an old value to
a new one. Not for me. Why the heck is that?
The funny thing is that in small tables I make to test things, in them
everything works!
These are the commands that won't work for me:
SELECT * FROM RealTable WHERE RealPrimaryKey = 'realvalue';
SELECT RealColumn FROM RealTable WHERE RealPrimaryKey = 'realvalue';
I get a blank sheet. The names of the columns are on top, otherways it's
blank. Why on earth????
It works without the ”WHERE”-part; I can see the full, filled table if I
want to. But not any specific row or rows.
Neither will this work, not if there allready is a value in ”RealColumn”:
UPDATE RealTable SET RealColumn = 'newrealvalue' WHERE RealPrimaryKey =
'realvalue';
Postgre SQL responds: ”Query returned successfully: 0 rows affected, 15 ms
execution time.”
Or other execution time, that differs; if it where allways the same,
something would be wrong.
I can put in
”
GRANT ALL ON RealTable TO public;
”
or not, the result is the same either way; the problems remains.
But in small tables like this, that I make to test things, in them
everything works!
CREATE TABLE T (T CHAR(2) PRIMARY KEY, Q CHAR(2));
INSERT INTO T (T, Q) VALUES ('A1', 'A2'), ('B1', 'B2');
SELECT * FROM T WHERE T = 'A1';
ALTER TABLE T ADD COLUMN R CHAR(2);
SELECT * FROM T WHERE T = 'A1';
UPDATE T SET R = 'C1' WHERE T = 'A1'
SELECT * FROM T WHERE T = 'A1';
UPDATE T SET Q = 'X' WHERE T = 'A1'
SELECT * FROM T WHERE T = 'A1';
Can anyone help me out?
From | Date | Subject | |
---|---|---|---|
Next Message | Sergey Konoplev | 2013-06-26 18:47:27 | Re: Basics fails; SELECT, UPDATE |
Previous Message | walerina | 2013-06-25 07:44:44 | Re: How to Recover iPhone Contacts You Lost Somehow? |