Re: Query in postgreSQL version Windows

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Ardian Xharra (Boxxo)" <axharra(at)boxxo(dot)info>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query in postgreSQL version Windows
Date: 2006-01-02 21:29:15
Message-ID: 20060102212915.GA66357@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 02, 2006 at 04:01:56PM -0500, Ardian Xharra (Boxxo) wrote:
> I installed PostgreSQL on windows and when I try to run some
> queries pgadmin says an error.

What version of PostgreSQL? What's the exact error message? That
often provides a clue as to what's wrong. I'll guess that the
Windows box is running 8.1.x and the error is:

ERROR: missing FROM-clause entry for table "pg_class"

> I know that if I change the query this it will work but is it
> possible to make this quey work in this way

Why don't you want to rewrite the query?

> SELECT atthasdef
> FROM pg_attribute
> WHERE attrelid=pg_class.oid AND pg_class.relname='client_overtime' AND attname='id_client_overtime'
>
> This query works fine in PostgreSQL (Linux-Unix platform)

Another guess: the Linux box is running a version of PostgreSQL
older than 8.1, or if it's running 8.1 then you've enabled
add_missing_from. As the 8.1 Release Notes mention, that option
is now disabled by default. Rather than trying to make the query
work as-is, rewrite it to be proper SQL by adding pg_class to the
FROM clause.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tyler MacDonald 2006-01-02 22:33:43 Re: inserting many rows
Previous Message Ardian Xharra (Boxxo) 2006-01-02 21:01:56 Query in postgreSQL version Windows