Re: possible pgadmin bug - Updated Info - Mailing list pgadmin-hackers

From
Subject Re: possible pgadmin bug - Updated Info
Date
Msg-id 20050503155954.48802.qmail@web52407.mail.yahoo.com
Whole thread Raw
List pgadmin-hackers
For context, I'm using pgadmin III 1.2.0 and pgsql
7.4.5 via cygwin on winxp.

--- operationsengineer1@yahoo.com wrote:
> 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.
>
> -------------------------------
>
> $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);
> }
> }
>
> -----------
>
> 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.
>
> ----------
>
> 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.
>
> 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 sure if this is related to my problem, but
> too
> much information is better than not enough
> information.
>
> tia...
>
> i have the table and the code available if anyone
> thinks some portion of this problem may be pgadmin
> bug
> related.  please let me know at
> operationsengineer1@yahoo.com.
>
> thanks.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgadmin-hackers by date:

Previous
From:
Date:
Subject: possible pgadmin bug
Next
From: Raphaël Enrici
Date:
Subject: which "wx2.6" should we use ?