Skip site navigation (1) Skip section navigation (2)

Bug with Foreign table interface

From: Thom Brown <thom(at)linux(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Bug with Foreign table interface
Date: 2011-04-28 14:10:46
Message-ID: BANLkTikkjMwwKxJwoemi23TyB8hKUa_jjg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
This is for pgAdmin 1.14 beta 1 on OSX.

When setting up a foreign table, upon adding a column, the "Member
name" and "Data type" values remain in the input fields.

Also, upon attempting to open a foreign table, pgAdmin is displaying
the message "An error has occurred: No Table or view" and then
crashes.  The error message on the server is: "LOG:  unexpected EOF on
client connection"

Steps to recreate:

1) Install the file_fdw extension
2) Create a server called "file" using this extension
3) Create a foreign table using the following definition:

CREATE FOREIGN TABLE stuff (id int, animal text) SERVER 'file' OPTIONS
(format 'text', filename '/tmp/stuff.txt', delimiter ',');

Also create a file in /tmp/stuff.txt with the following contents:

1,Llama
2,Dog
3,Sheep
4,Whale
5,Lizard

Using psql, the following query works fine:

postgres=# select * from stuff;
 id | animal
----+--------
  1 | Llama
  2 | Dog
  3 | Sheep
  4 | Whale
  5 | Lizard
(5 rows)

When just clicking on the foreign table name in the browser, I can see
the definition in the SQL pane.  If I click in that pane, pgAdmin
crashes again.  It is displaying the following in the pane:

-- Foreign table: stuff

-- DROP FOREIGN TABLE stuff;

CREATE FOREIGN TABLE stuff
   (id integer ,
    animal text )
   SERVER file
   OPTIONS (format=text,delimiter=,,filename=/tmp/stuff.txt);
ALTER FOREIGN TABLE stuff OWNER TO thom;

So there appears to be single quotes missing from the options section.
 I never entered them in the actual interface to create the foreign
table, but pgAdmin was showing the correct creation SQL in the editor.
 It is also displaying = between the parameter and value in the
options list, but this isn't valid.

The same problem appears in the properties tab for the foreign table.
It displays the options list in the same way, without quotes and uses
= between parameter and value.

Also, when I was in the editor, when clicking on the SQL tab and
clicking on the text, it also crashes.

I also don't see where user mappings are shown in the interface.  I
have every browser object set to display including user mappings.

One last thing, I don't see the server named "file" appearing in the
Dependents list for file_fdw.  My "stuff" table appears in the
Dependents list for my server called "file", but it says "Unknown" in
the Type column.  This relationship is not reciprocated as the foreign
table doesn't show any dependency on the foreign server, and the
foreign server shows no dependency on the file_fdw extension.

Regards

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Responses

pgadmin-hackers by date

Next:From: Nikhil SDate: 2011-04-28 14:22:37
Subject: Re: pgAdmin III: erroneous references to "proargdefvals" attribute
Previous:From: Dave PageDate: 2011-04-28 13:28:42
Subject: Re: pgAdmin III: erroneous references to "proargdefvals" attribute

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group