Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.postgresql > #744
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Rainer Weikusat <rweikusat@talktalk.net> |
| Newsgroups | comp.databases.postgresql |
| Subject | Re: Why does this third line work, and the first two not? |
| Date | Thu, 27 Apr 2017 20:10:35 +0100 |
| Lines | 44 |
| Message-ID | <877f25y8d0.fsf@doppelsaurus.mobileactivedefense.com> (permalink) |
| References | <59023252$0$785$e4fe514c@news.xs4all.nl> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-Trace | individual.net HPhKV0ucXX9bpiA2mLQaDQwPedGP4vC+PNMFdmfdo06Xc4wjY= |
| Cancel-Lock | sha1:OxifhxGn5xmpg+LH04rOxiCS8Zo= sha1:mCOQM48v/kduvKgHV2iOEj38n8s= |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
| Xref | csiph.com comp.databases.postgresql:744 |
Show key headers only | View raw
Luuk <luuk@invalid.lan> writes:
> Why does this third line work, and the first two not?
>
> abcd=# select RequestMessageId from table_details;
> ERROR: column "requestmessageid" does not exist
> LINE 1: select RequestMessageId from table_details;
> ^
> HINT: Perhaps you meant to reference the column
> "table_details.RequestMessageId".
>
> abcd=# select a.RequestMessageId from table_details a;
> ERROR: column a.requestmessageid does not exist
> LINE 1: select a.RequestMessageId from table_details a;
> ^
> HINT: Perhaps you meant to reference the column "a.RequestMessageId".
>
> abcd=# select a."RequestMessageId" from table_details a;
> RequestMessageId
> ------------------
> (0 rows)
That's because unquoted SQL identifiers are not case-sensitive. If the
really uses a mixed-case name, accessing it requires a quoted
identifier, cf
mad_database=# create table blubb ("Fump" varchar);
CREATE TABLE
mad_database=# select Fump from blubb;
ERROR: column "fump" does not exist
LINE 1: select Fump from blubb;
^
mad_database=# select "Fump" from blubb;
Fump
------
(0 rows)
mad_database=# drop table blubb;
DROP TABLE
mad_database=# create table blubb (Fump varchar);
CREATE TABLE
mad_database=# select fUMP from blubb;
fump
------
(0 rows)
Back to comp.databases.postgresql | Previous | Next — Previous in thread | Next in thread | Find similar
Why does this third line work, and the first two not? Luuk <luuk@invalid.lan> - 2017-04-27 20:03 +0200
Re: Why does this third line work, and the first two not? Ikke <hviaene@invalid.org> - 2017-04-27 20:53 +0200
Re: Why does this third line work, and the first two not? Luuk <luuk@invalid.lan> - 2017-04-28 18:06 +0200
Re: Why does this third line work, and the first two not? Rainer Weikusat <rweikusat@talktalk.net> - 2017-04-27 20:10 +0100
Re: Why does this third line work, and the first two not? Luuk <luuk@invalid.lan> - 2017-04-28 18:07 +0200
Re: Why does this third line work, and the first two not? Dimitri Fontaine <dimitri.fontaine@schibsted.com> - 2017-04-30 18:15 +0200
Re: Why does this third line work, and the first two not? Luuk <luuk@invalid.lan> - 2017-04-30 21:48 +0200
csiph-web