FAQ
Hi,
I have problem with simple query on existing table. On list below is evidently, that my table "Zed" exists, but when I ask that by SELECT, I have no result. When I list this table in PgAdmin3, all records I can see and when I want display this table thru QGIS, I can acces that.

Table "Zed" was imported into PostgreSQL/PostGIS thru QGIS. Next table which I queryed was table administrativni_uzemi and here, how you can see below, all works fine. Interesting is that, that table "Zed" was imported by QGIS and working table "administrativni_uzemi" was imported by GRASS.




c:Program FilesPostgreSQL8.2bin>psql -d cvicna -U postgres -E
Welcome to psql 8.2.13, the PostgreSQL interactive terminal.

Type:  copyright for distribution terms
h for help with SQL commands
? for help with psql commands
g or terminate with semicolon to execute query
q to quit

Warning: Console code page (852) differs from Windows code page (1250)
8-bit characters may not work correctly. See psql reference
page "Notes for Windows users" for details.

cvicna=# dt

List of relations
Schema |              Name              | Type  |  Owner
--------+--------------------------------+-------+----------
...
...
public | Zed                            | table | postgres
public | ZeleznicniPrejezd              | table | postgres
public | ZeleznicniTrat                 | table | postgres
public | ZeleznicniZastavka             | table | postgres
public | administrativni_uzemi          | table | postgres
public | geometry_columns               | table | postgres
public | spatial_ref_sys                | table | postgres
public | vrstevnice_vse                 | table | postgres
(108 rows)

cvicna=# select * from Zed;
ERROR:  relation "zed" does not exist
cvicna=# select * from administrativni_uzemi limit 1;
ogc_fid |



wkb_geometry



cat | mslink  | mapid  |   namen1   |   namen2   | namsu
1 | namsu2 | mapno
---------+----------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------+-----+---------+--------+------------+------------+------
--+--------+--------
1 | 0102000020B48E0100160000001F85EB11E71F21C14E6210D82E532FC18716D98EE41
F21C1EC51B85E52532FC19EEFA746E41F21C121B0726864532FC1C1CAA105E21F21C1986E12C3695
32FC104560EADD11F21C15A643BDF80532FC1A69BC4A0B31F21C1E17A14AEAE532FC1713D0A57A91
F21C10E2DB29DC6532FC1C3F528DCA11F21C12FDD2406D8532FC11283C08A911F21C19A9999D90F5
42FC1BE9F1A6F851F21C1FCA9F1D236542FC106819583751F21C1CDCCCC0C7A542FC1C74B3789731
F21C16666666682542FC18B6CE77B721F21C1F853E3A5B8542FC1022B87966A1F21C1F2D24D62075
52FC1C976BE5F521F21C10AD7A370AB552FC177BE9F1A2F1F21C185EB51F84E562FC1F0A7C60B101
F21C1DBF97E2AD8562FC1A01A2F1DFC1E21C18B6CE7FB2A572FC121B07268EF1E21C1E92631C85F5
72FC1F2D24DA2861E21C10E2DB29DA6572FC1BC749398711E21C1022B87D6B4572FC14E6210586E1
E21C15C8FC275D9572FC1 |   1 | 1079816 | 100001 | 0711525227 | 0711536148 | 60402
0 | 798347 | 044319
(1 row)

cvicna=#




When I use cvicna=# z (list table, view, and sequence access privileges) I have this result:




Access privileges for database "cvicna"
Schema |               Name                |   Type   | Access privileges
--------+-----------------------------------+----------+-------------------
public | Zed                               | table    |
public | ZeleznicniPrejezd                 | table    |
public | ZeleznicniTrat                    | table    |
public | ZeleznicniZastavka                | table    |
public | administrativni_uzemi             | table    |
public | administrativni_uzemi_ogc_fid_seq | sequence |
public | geometry_columns                  | table    |
public | spatial_ref_sys                   | table    |
public | vrstevnice_vse                    | table    |
public | vrstevnice_vse_ogc_fid_seq        | sequence |
(110 rows)

So I see, that GRASS probably made sequnces on created tables and QGIS not. Possibly this is my problem? This is only one, that I realized. What could by wrong? Could by something broken in schema pg_catalog?


Thanks for your advise.

Best regards.

Jaromír Kamler

Search Discussions

  • Thomas Kellerer at May 21, 2009 at 9:05 am

    Jaromír Kamler wrote on 21.05.2009 10:17:
    Hi,
    I have problem with simple query on existing table. On list below is
    evidently, that my table "Zed" exists, but when I ask that by SELECT, I
    have no result. When I list this table in PgAdmin3, all records I can
    see and when I want display this table thru QGIS, I can acces that.

    Table "Zed" was imported into PostgreSQL/PostGIS thru QGIS. Next table
    which I queryed was table administrativni_uzemi and here, how you can
    see below, all works fine. Interesting is that, that table "Zed" was
    imported by QGIS and working table "administrativni_uzemi" was imported
    by GRASS.




    Schema | Name | Type | Owner
    --------+--------------------------------+-------+----------
    ...
    ...
    public | Zed | table | postgres

    cvicna=# select * from Zed;
    Apparently the table was created using double quotes and thus it is
    case-sensitive now. You have to use

    select * from "Zed";

    Thomas
  • Jaromír Kamler at May 21, 2009 at 11:20 am
    Yes, you are right. I apologize for my stupid question, but this little dreamt that me :-). I wrote there Zed with big "Z"
    but I have "forgot" double quotes. Is there some possibility to get out case-sensitivity?


    Regards,

    Jaromír Kamler

    ______________________________________________________________
    Od: spam_eater@gmx.net
    Komu: pgsql-novice@postgresql.org
    Datum: 21.05.2009 11:06
    Předmět: [NOVICE] Re: Unable to query on existing table - ERROR: relation "zed" does not exist
    >
    Jaromír Kamler wrote on 21.05.2009 10:17:
    Hi,
    I have problem with simple query on existing table. On list below is
    evidently, that my table "Zed" exists, but when I ask that by SELECT, I
    have no result. When I list this table in PgAdmin3, all records I can
    see and when I want display this table thru QGIS, I can acces that. >
    Table "Zed" was imported into PostgreSQL/PostGIS thru QGIS. Next table
    which I queryed was table administrativni_uzemi and here, how you can
    see below, all works fine. Interesting is that, that table "Zed" was
    imported by QGIS and working table "administrativni_uzemi" was imported
    by GRASS.
    >
    >
    >
    >
    Schema |              Name              | Type  |  Owner
    --------+--------------------------------+-------+----------
    ...
    ...
    public | Zed                            | table | postgres >
    cvicna=# select * from Zed;
    Apparently the table was created using double quotes and thus it is
    case-sensitive now. You have to use

    select * from "Zed";

    Thomas


    --
    Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-novice
  • Thomas Kellerer at May 21, 2009 at 11:40 am

    Jaromír Kamler wrote on 21.05.2009 13:20:
    Yes, you are right. I apologize for my stupid question, but this little
    dreamt that me :-). I wrote there Zed with big "Z"
    but I have "forgot" double quotes. Is there some possibility to get out
    case-sensitivity?
    Re-create the tables without the quotes or rename them all to lower-case

    Thomas

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedMay 21, '09 at 8:17a
activeMay 21, '09 at 11:40a
posts4
users2
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase