Unix Technical Forum

problem adding a foreign key in v1.5 and a question re v1.5 vs 1.2.2

This is a discussion on problem adding a foreign key in v1.5 and a question re v1.5 vs 1.2.2 within the pgsql Interfaces Pgadmin Support forums, part of the PostgreSQL category; --> hi! i'm using pgadmin3 v1.5 devel, built today from a fresh cvs checkout. with this version i am having ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 07:14 PM
Miha Radej
 
Posts: n/a
Default problem adding a foreign key in v1.5 and a question re v1.5 vs 1.2.2

hi!

i'm using pgadmin3 v1.5 devel, built today from a fresh cvs checkout.

with this version i am having problems adding foreign keys (to existing
tables or when creating a new table) since pgadmin doesn't seem to
refresh the columns in the selected table and i cannot select a column
to specify it as a referencing column. the pull-down list contains the
name of the first column from the table which was selected by default
when the dialog window opened.

i wanted to try it with v1.2.2 but that version no longer recognizes any
information about the servers. it realizes that i have 2 servers on the
list but instead of the server names the string "(:0)" is written and in
the server properties all values are blank.

i find this a bit strange because i recall having no problems using
either version of pgadmin a short while ago.

i am running pgadmin3 on suse linux 9.3. please tell me if you need me
to provide additional information and / or images.

regards,
Miha

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 07:14 PM
Andreas Pflug
 
Posts: n/a
Default Re: problem adding a foreign key in v1.5 and a

Miha Radej wrote:
> hi!
>
> i'm using pgadmin3 v1.5 devel, built today from a fresh cvs checkout.
>
> with this version i am having problems adding foreign keys (to existing
> tables or when creating a new table) since pgadmin doesn't seem to
> refresh the columns in the selected table and i cannot select a column
> to specify it as a referencing column.


Please specify the situation when you miss the columns.

the pull-down list contains the
> name of the first column from the table which was selected by default
> when the dialog window opened.
>
> i wanted to try it with v1.2.2 but that version no longer recognizes any
> information about the servers. it realizes that i have 2 servers on the
> list but instead of the server names the string "(:0)" is written and in
> the server properties all values are blank.
>
> i find this a bit strange because i recall having no problems using
> either version of pgadmin a short while ago.


The registry format changed a day ago; the old was getting too crowded.
1.5 will convert from older versions.

Regards,
Andresa

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 07:14 PM
Miha Radej
 
Posts: n/a
Default Re: problem adding a foreign key in v1.5 and a question re v1.5 vs

hi!

the foreign key problem seems to come from using an incorrect schema
name. ie. in a database i am using i have a few schemas. i am working on
one of them and when selecting a referencing table all table names are
displayed as 'schema.tablename' except the tables from the current
schema i'm working on, where just the form 'tablename' is used. and
pgadmin3 appears to use the public schema if no schema seems to be
specified, which then returns no columns.

ie: i am working on a schema called 'myschema' and i select a table
'tablename' as a referenced table. pgadmin generates the following query
to retrieve the column names from a newly selected table:
SELECT attname
FROM pg_attribute att, pg_class cl, pg_namespace nsp
WHERE attrelid=cl.oid AND relnamespace=nsp.oid
AND nspname='public'
AND relname='tablename'
AND attnum > 0

ORDER BY attnum

instead of
SELECT attname
FROM pg_attribute att, pg_class cl, pg_namespace nsp
WHERE attrelid=cl.oid AND relnamespace=nsp.oid
AND nspname='myschema'
AND relname='tablename'
AND attnum > 0

ORDER BY attnum

regards,
Miha

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 07:17 PM
Sune B. Woeller
 
Posts: n/a
Default Problem adding foreign key when table in personal schema

Hi list,

I can reproduce this error - could it be added as an
official bug, please?

I wish to create a foreign key on a table, referencing a
table in a schema that has the same name as my user id (my
personal schema). In the list of tables when adding the
foreign key ('References'), tables in my personal schema are
listed by table name, without the schema part. When choosing
such a table, the column list is empty.

The tables in my personal schema are in the search path, but
the column list apparently does not take that in account ?

regards, Sune B. Woeller


Miha Radej wrote:
> hi!
>
> the foreign key problem seems to come from using an incorrect schema
> name. ie. in a database i am using i have a few schemas. i am working on
> one of them and when selecting a referencing table all table names are
> displayed as 'schema.tablename' except the tables from the current
> schema i'm working on, where just the form 'tablename' is used. and
> pgadmin3 appears to use the public schema if no schema seems to be
> specified, which then returns no columns.
>
> ie: i am working on a schema called 'myschema' and i select a table
> 'tablename' as a referenced table. pgadmin generates the following query
> to retrieve the column names from a newly selected table:
> SELECT attname
> FROM pg_attribute att, pg_class cl, pg_namespace nsp
> WHERE attrelid=cl.oid AND relnamespace=nsp.oid
> AND nspname='public'
> AND relname='tablename'
> AND attnum > 0
>
> ORDER BY attnum
>
> instead of
> SELECT attname
> FROM pg_attribute att, pg_class cl, pg_namespace nsp
> WHERE attrelid=cl.oid AND relnamespace=nsp.oid
> AND nspname='myschema'
> AND relname='tablename'
> AND attnum > 0
>
> ORDER BY attnum
>
> regards,
> Miha
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>




---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-17-2008, 07:17 PM
Andreas Pflug
 
Posts: n/a
Default Re: Problem adding foreign key when table in personal

Sune B. Woeller wrote:

> Hi list,
>
> I can reproduce this error - could it be added as an
> official bug, please?



On my list for investigation.

Regards,
Andreas


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com