Re: Basics fails; SELECT, UPDATE

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Jonas Schwanbom <cygnent(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Basics fails; SELECT, UPDATE
Date: 2013-06-26 18:47:27
Message-ID: CAL_0b1t8X2RNS3-S=wm6G2XoZcdatpAPrvk8ik9SD0hohpXqug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Jun 26, 2013 at 4:00 AM, Jonas Schwanbom <cygnent(at)gmail(dot)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(dot)ru(at)gmail(dot)com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Megan 2013-06-27 12:51:50 ssl certificates with psql
Previous Message Jonas Schwanbom 2013-06-26 11:00:47 Basics fails; SELECT, UPDATE