pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres 12.4 inner join with where statement = 'string' returning error
3+ messages / 3 participants
[nested] [flat]
* Postgres 12.4 inner join with where statement = 'string' returning error
@ 2021-01-04 01:33 VAE Ventures <vaeventures@outlook.com>
0 siblings, 2 replies; 3+ messages in thread
From: VAE Ventures @ 2021-01-04 01:33 UTC (permalink / raw)
To: pgsql-admin; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
I am running a db on postgres12.4
I have been trying to run a query that looks like this:
SELECT * FROM table_1 INNER JOIN table_2 ON table_1.column = table_2.column WHERE table_1.column = ‘string’;
I am being returned:
ERROR: column 'string' does not exist
The following queries work fine:
SELECT * FROM table_1 INNER JOIN table_2 ON table_1.column = table_2.column WHERE table_1.column = int;
SELECT * FROM table_1 WHERE column = ‘string’;
I read several posts about this error, which seems very common and is usually solved by switching up quotation variations around the table name, column name, and the name of the string I am querying for. I have tried every variation of double and single quotes around each table name, column name, and name of string, and nothing worked.
For some reason, it seems that querying for a string is what is throwing everything off. I am new to postgres, am I missing something? Appreciate any advice possible
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres 12.4 inner join with where statement = 'string' returning error
@ 2021-01-04 02:45 Ron <ronljohnsonjr@gmail.com>
parent: VAE Ventures <vaeventures@outlook.com>
1 sibling, 0 replies; 3+ messages in thread
From: Ron @ 2021-01-04 02:45 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
On 1/3/21 7:33 PM, VAE Ventures wrote:
> I am running a db on postgres12.4
>
> I have been trying to run a query that looks like this:
>
> SELECT * FROM table_1 INNER JOIN table_2 ON table_1.column =
> table_2.column WHERE table_1.column = ‘string’;
>
> I am being returned:
>
> ERROR: column 'string' does not exist
>
> The following queries work fine:
>
> SELECT * FROM table_1 INNER JOIN table_2 ON table_1.column =
> table_2.column WHERE table_1.column = int;
>
> SELECT * FROM table_1 WHERE column = ‘string’;
>
> I read several posts about this error, which seems very common and is
> usually solved by switching up quotation variations around the table name,
> column name, and the name of the string I am querying for. I have tried
> every variation of double and single quotes around each table name, column
> name, and name of string, and nothing worked.
>
> For some reason, it seems that querying for a string is what is throwing
> everything off. I am new to postgres, am I missing something? Appreciate
> any advice possible
Please show us an actual query with it's actual error message.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres 12.4 inner join with where statement = 'string' returning error
@ 2021-01-04 03:13 David G. Johnston <david.g.johnston@gmail.com>
parent: VAE Ventures <vaeventures@outlook.com>
1 sibling, 0 replies; 3+ messages in thread
From: David G. Johnston @ 2021-01-04 03:13 UTC (permalink / raw)
To: VAE Ventures <vaeventures@outlook.com>; +Cc: pgsql-admin; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Sun, Jan 3, 2021 at 6:33 PM VAE Ventures <vaeventures@outlook.com> wrote:
> SELECT * FROM table_1 INNER JOIN table_2 ON table_1.column =
> table_2.column WHERE table_1.column = ‘string’;
> ERROR: column 'string' does not exist
>
The only way you will get "column 'string' does not exist" is if you wrote
the word -string- surrounded by double-quotes so that it is interpreted as
an object identifier instead of a literal value. Assuming corresponding
tables and columns exist, the query you show would not return that error.
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-01-04 03:13 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 01:33 Postgres 12.4 inner join with where statement = 'string' returning error VAE Ventures <vaeventures@outlook.com>
2021-01-04 02:45 ` Ron <ronljohnsonjr@gmail.com>
2021-01-04 03:13 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox