Unix Technical Forum

Re: possible pgadmin bug

This is a discussion on Re: possible pgadmin bug within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> > -----Original Message----- > From: pgadmin-hackers-owner@postgresql.org > [mailto gadmin-hackers-owner@postgresql.org] On Behalf Of > operationsengineer1@yahoo.com > Sent: 03 May 2005 ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 04:40 PM
Dave Page
 
Posts: n/a
Default Re: possible pgadmin bug



> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org
> [mailtogadmin-hackers-owner@postgresql.org] On Behalf Of
> operationsengineer1@yahoo.com
> Sent: 03 May 2005 16:57
> To: pgadmin-hackers@postgresql.org
> Subject: [pgadmin-hackers] possible pgadmin bug
>
> hi guys, i'm not a pgadmin techie, but i do have some
> strange things happening ala pgsql and pgadmin. i
> posted my issues over on the pgsql novice mailing list
> and tom lane suggested i post it over here for your
> review.


OK. pgadmin-support is the more appropriate list for any future issues,
but Tom is probably not familiar with our lists.

> -------------------------------
>
> $assembly = $_POST['product_base'];
> $assembly_notes = $_POST['assembly_notes'];
>
> $db = &ADONewConnection('postgres');
> $db -> Connect($db_string,$db_owner,$db_pw,$db_name);
>
> $assembly_notes_insert_id = $db->getone("select
> nextval('t_assembly_notes_assembly_notes_id_seq')" );
>
> $sql = "INSERT INTO t_assembly_notes
> (assembly_notes_id, assembly_notes,
> assembly_notes_entry_date) VALUES (" .
> $assembly_notes_insert_id . ", " .
> $db->qstr($assembly_notes) . ", " .
> $db->DBDate(time()) . ")";
>
> $result_notes = $db->Execute($sql);
>
> //insert ids into link table
>
> $id = $assembly_notes_insert_id;
>
> if (isset($_POST['product_base']) and
> is_array($_POST['product_base']))
> {
> foreach($_POST['product_base'] as $V)
> {
> echo "Value: $V<br>\n";
>
> $query = "INSERT INTO
> t_link_product_base_assembly_notes " .
> "(product_number, assembly_notes_id) " .
> "VALUES (" . $db->qstr($id) . ", " . $db->qstr($V) .
> ")";
>
> $result_link = $db->Execute($query);
> }
> }
>
> -----------


Right...


> everything works fine except for my foreign keys.
>
> this code checks to see whether my assembly_notes_id
> is in my product table and checks whether my
> product_number is in my assembly_notes table - the
> opposite of what i want to happen.
>
> in pgadmin3 i have my link table's assembly_note_id
> referencing the assembly_note_id in the assembly_notes
> table.
>
> i have my link table's product_number referencing the
> product_number in the product table.
>
> i'm at a loss b/c i don't understand this behavior.


Surely you want the references to be the other way around? The link
table is the top of the logical hierarchy, so assembley_notes and
product to reference it, not the other way around.

> ----------
>
> i'v created a foreign key in pgadmin 3.
>
> i have a link table that links to product_number and
> assembly notes. the reason for the link table is so i
> can allow one note to be attached to more than one
> product_number.
>
> i created a foreign key in pgadmin 3 bwteen the
> product_number in the link table and product_number in
> my product table.
>
> when i go to the pgadmin 3 constraints folder, open
> this foreign key and click on the columns tab, it
> shows conflicting information.
>
> Local says "product_number"
> Referenced says "product_number"
>
> so far, so good.
>
> Toward the bottom of the small window, "Referencing"
> says ".......pg dropped 1......." in the
> drop down menu. i previously had to drop my first
> created column.


Yup, that's the code that populates the dropdown failing to ignore the
dropped columns.

> when i first set it up, i made sure to choose
> "product_number from the drop down menu, but it
> defaults back to ".......pg dropped 1......."
>
> i've deleted and re-done this several times with the
> same results.


I'm not entirely sure what you mean - can you elaborate, and provide
your table definitions as well please?

Regards, Dave

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

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:40 PM.


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