pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Pg (Perl for Postgresql)
4+ messages / 2 participants
[nested] [flat]

* Pg (Perl for Postgresql)
@ 2002-12-19 23:01 Laurette Cisneros <laurette@nextbus.com>
  2002-12-19 23:14 ` Re: Pg (Perl for Postgresql) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Laurette Cisneros @ 2002-12-19 23:01 UTC (permalink / raw)
  To: pgsql-interfaces


Does this belong on this list?

Using Pg, it seems I get an error when trying to query a 7.3 database:

$fromconn = Pg::connectdb( "host=testhost port=5439 dbname=test-73"
);
    die $fromconn->errorMessage unless ($fromconn->status eq PGRES_CONNECTION_OK);
 
$query = "select x, y from table1;";
$result = $fromconn->exec( $query );
$status = $result->resultStatus;
if ( $status ne PGRES_TUPLES_OK ) {
   print "query failed: ";
   print $status;
   print "\n$query\n";
   print "\n";
}

returns:
query failed: 7
select x, y from table1;

Is there a newer version of Pg that should be used that can read both 7.2
and 7.3 databases?

Thanks,

-- 
Laurette Cisneros
The Database Group
(510) 420-3137
NextBus Information Systems, Inc.
www.nextbus.com
----------------------------------
Life is an SQL old chum...




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pg (Perl for Postgresql)
  2002-12-19 23:01 Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
@ 2002-12-19 23:14 ` Tom Lane <tgl@sss.pgh.pa.us>
  2002-12-19 23:51   ` Re: Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2002-12-19 23:14 UTC (permalink / raw)
  To: Laurette Cisneros <laurette@nextbus.com>; +Cc: pgsql-interfaces

Laurette Cisneros <laurette@nextbus.com> writes:
> Is there a newer version of Pg that should be used that can read both 7.2
> and 7.3 databases?

I suspect this failure has nothing to do with Pg itself.  I suggest
printing out the query error message, rather than guessing about the
problem ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pg (Perl for Postgresql)
  2002-12-19 23:01 Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
  2002-12-19 23:14 ` Re: Pg (Perl for Postgresql) Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-12-19 23:51   ` Laurette Cisneros <laurette@nextbus.com>
  2002-12-19 23:59     ` Re: Pg (Perl for Postgresql) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Laurette Cisneros @ 2002-12-19 23:51 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces

Ok, I see the problem...

The column and the table are named the same:

select x, y from y;

In 7.3 it gives the error message:
ERROR:  You can't use relation names alone in the target list, try relation.*.

It works fine in 7.2

Laurette (not guessing)

On Thu, 19 Dec 2002, Tom Lane wrote:

> Laurette Cisneros <laurette@nextbus.com> writes:
> > Is there a newer version of Pg that should be used that can read both 7.2
> > and 7.3 databases?
> 
> I suspect this failure has nothing to do with Pg itself.  I suggest
> printing out the query error message, rather than guessing about the
> problem ...
> 
> 			regards, tom lane
> 

-- 
Laurette Cisneros
The Database Group
(510) 420-3137
NextBus Information Systems, Inc.
www.nextbus.com
----------------------------------
Life is an SQL old chum...




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pg (Perl for Postgresql)
  2002-12-19 23:01 Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
  2002-12-19 23:14 ` Re: Pg (Perl for Postgresql) Tom Lane <tgl@sss.pgh.pa.us>
  2002-12-19 23:51   ` Re: Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
@ 2002-12-19 23:59     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2002-12-19 23:59 UTC (permalink / raw)
  To: Laurette Cisneros <laurette@nextbus.com>; +Cc: pgsql-interfaces

Laurette Cisneros <laurette@nextbus.com> writes:
> The column and the table are named the same:
> select x, y from y;

> In 7.3 it gives the error message:
> ERROR:  You can't use relation names alone in the target list, try relation.*.

> It works fine in 7.2

Hm, there must be more to it than meets the eye, because that condition
alone doesn't cause a problem:

regression=# create table y (x int, y int);
CREATE TABLE
regression=# select x, y from y;
 x | y
---+---
(0 rows)

How did you declare the table, exactly?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-12-19 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19 23:01 Pg (Perl for Postgresql) Laurette Cisneros <laurette@nextbus.com>
2002-12-19 23:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-12-19 23:51   ` Laurette Cisneros <laurette@nextbus.com>
2002-12-19 23:59     ` Tom Lane <tgl@sss.pgh.pa.us>

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