pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedAlias-Error
5+ messages / 4 participants
[nested] [flat]
* Alias-Error
@ 2003-10-10 08:40 Jost Richstein <jrichstein@softdecc.com>
0 siblings, 1 reply; 5+ messages in thread
From: Jost Richstein @ 2003-10-10 08:40 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-sql
Hi,
I am running a query with alias (a self join) against
version 7.3.4 on Suse Linux 7.3 and on FreeBSD (v5?).
It runs fine on Linux, but produces an error on
FreeBSD: "unknown alias C2". And btw: the query runs
on every other DB I have tried...
The Query is something like this:
SELECT DISTINCT C2.cmc_mchap, C2.cmc_sort
FROM sis_cmca, sis_cmca C2
WHERE cm_status != 'U' AND sis_cmca.cmc_name='INTERN2000' AND
C2.cmc_name='INTERN2000' AND sis_cmca.cmc_mchap=C2.cmc_mchap
....
What causes this error? Workarounds?
Jost
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Alias-Error
@ 2003-10-16 14:43 Tom Lane <tgl@sss.pgh.pa.us>
parent: Jost Richstein <jrichstein@softdecc.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2003-10-16 14:43 UTC (permalink / raw)
To: jrichstein@softdecc.com; +Cc: pgsql-general@postgresql.org; pgsql-sql
Jost Richstein <jrichstein@softdecc.com> writes:
> I am running a query with alias (a self join) against
> version 7.3.4 on Suse Linux 7.3 and on FreeBSD (v5?).
> It runs fine on Linux, but produces an error on
> FreeBSD: "unknown alias C2".
The string "unknown alias" appears nowhere in the 7.3 sources.
Are you sure you are talking to a Postgres database?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Alias-Error
@ 2003-10-21 07:17 Jost Richstein <jrichstein@softdecc.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 5+ messages in thread
From: Jost Richstein @ 2003-10-21 07:17 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-sql
Ok. The exact error message is as follows:
SQLException Time : Mon Oct 20 13:15:25 CEST 2003
SQLException ErrorCode : 0
SQLException SQLState : null
SQLException Message : ERROR: Relation "c2" does not exist
SQLException Connection: 4878867
The query is something like this:
SELECT DISTINCT C2.cmc_mchap, C2.cmc_sort
FROM sis_cmca, sis_cmca C2
WHERE cm_status != 'U' AND sis_cmca.cmc_name='INTERN2000' AND
C2.cmc_name='INTERN2000' AND sis_cmca.cmc_mchap=C2.cmc_mchap
Tom Lane wrote:
>
> Jost Richstein <jrichstein@softdecc.com> writes:
> > I am running a query with alias (a self join) against
> > version 7.3.4 on Suse Linux 7.3 and on FreeBSD (v5?).
> > It runs fine on Linux, but produces an error on
> > FreeBSD: "unknown alias C2".
>
> The string "unknown alias" appears nowhere in the 7.3 sources.
> Are you sure you are talking to a Postgres database?
>
> regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [SQL] Alias-Error
@ 2003-10-21 19:02 Richard Huxton <dev@archonet.com>
parent: Jost Richstein <jrichstein@softdecc.com>
1 sibling, 0 replies; 5+ messages in thread
From: Richard Huxton @ 2003-10-21 19:02 UTC (permalink / raw)
To: jrichstein@softdecc.com; pgsql-general@postgresql.org; pgsql-sql
On Tuesday 21 October 2003 08:17, Jost Richstein wrote:
> Ok. The exact error message is as follows:
>
> SQLException Time : Mon Oct 20 13:15:25 CEST 2003
> SQLException ErrorCode : 0
> SQLException SQLState : null
> SQLException Message : ERROR: Relation "c2" does not exist
> SQLException Connection: 4878867
>
> The query is something like this:
>
> SELECT DISTINCT C2.cmc_mchap, C2.cmc_sort
> FROM sis_cmca, sis_cmca C2
> WHERE cm_status != 'U' AND sis_cmca.cmc_name='INTERN2000' AND
^^^^^^^^^
You're missing a table name here. It could be PG is reporting the wrong error.
> C2.cmc_name='INTERN2000' AND sis_cmca.cmc_mchap=C2.cmc_mchap
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Alias-Error
@ 2003-10-22 08:18 Csaba Nagy <nagy@ecircle-ag.com>
parent: Jost Richstein <jrichstein@softdecc.com>
1 sibling, 0 replies; 5+ messages in thread
From: Csaba Nagy @ 2003-10-22 08:18 UTC (permalink / raw)
To: jrichstein@softdecc.com; +Cc: Postgres general mailing list <pgsql-general@postgresql.org>; pgsql-sql
You have the alias in upper case: "C2", and postgres complains about a
lower case "c2". May be this some case sensitivity problem ?
Just a thought.
HTH,
Csaba.
On Tue, 2003-10-21 at 09:17, Jost Richstein wrote:
> Ok. The exact error message is as follows:
>
> SQLException Time : Mon Oct 20 13:15:25 CEST 2003
> SQLException ErrorCode : 0
> SQLException SQLState : null
> SQLException Message : ERROR: Relation "c2" does not exist
> SQLException Connection: 4878867
>
> The query is something like this:
>
> SELECT DISTINCT C2.cmc_mchap, C2.cmc_sort
> FROM sis_cmca, sis_cmca C2
> WHERE cm_status != 'U' AND sis_cmca.cmc_name='INTERN2000' AND
> C2.cmc_name='INTERN2000' AND sis_cmca.cmc_mchap=C2.cmc_mchap
>
> Tom Lane wrote:
> >
> > Jost Richstein <jrichstein@softdecc.com> writes:
> > > I am running a query with alias (a self join) against
> > > version 7.3.4 on Suse Linux 7.3 and on FreeBSD (v5?).
> > > It runs fine on Linux, but produces an error on
> > > FreeBSD: "unknown alias C2".
> >
> > The string "unknown alias" appears nowhere in the 7.3 sources.
> > Are you sure you are talking to a Postgres database?
> >
> > regards, tom lane
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-10-22 08:18 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-10 08:40 Alias-Error Jost Richstein <jrichstein@softdecc.com>
2003-10-16 14:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-10-21 07:17 ` Jost Richstein <jrichstein@softdecc.com>
2003-10-21 19:02 ` Richard Huxton <dev@archonet.com>
2003-10-22 08:18 ` Csaba Nagy <nagy@ecircle-ag.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