Re: Basics fails; SELECT, UPDATE
От | Sergey Konoplev |
---|---|
Тема | Re: Basics fails; SELECT, UPDATE |
Дата | |
Msg-id | CAL_0b1t8X2RNS3-S=wm6G2XoZcdatpAPrvk8ik9SD0hohpXqug@mail.gmail.com обсуждение исходный текст |
Ответ на | Basics fails; SELECT, UPDATE (Jonas Schwanbom <cygnent@gmail.com>) |
Список | pgsql-novice |
On Wed, Jun 26, 2013 at 4:00 AM, Jonas Schwanbom <cygnent@gmail.com> wrote: > 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.” It looks like you do not have a row with RealPrimaryKey = 'realvalue' in the table. Try to insert one and let us see. > > > 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? > > -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA Profile: http://www.linkedin.com/in/grayhemp Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979 Skype: gray-hemp Jabber: gray.ru@gmail.com
В списке pgsql-novice по дате отправления: