pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Larry Rosenman <ler@lerctr.org>
To: pgsql-sql@postgresql.org
Subject: plpgsql function / ??? / help
Date: Mon, 14 May 2001 18:00:25 GMT
Message-ID: <20010514.18002500@ler-freebie.iadfw.net> (raw)

I have the following 2 tables, and a spread sheet that needs to be 
converted to the assigned_networks table.   In the spreadsheet there is 
an approximation of the router name, but it needs some massaging.  I need 
to load the id field of the router table into the router field of the 
assigned networks table.  Is there an easy way to code a function that 
can massage the name to the correct DNS name to do this at insert time? 

Thanks!

LER


-- 
Larry Rosenman                             http://www.lerctr.org/~ler/
Phone: +1 972 414 9812                          E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 US

ler=# \d router
                                     Table "router"
 Attribute |          Type          |                     Modifier        
              
-----------+------------------------+-----------------------------------
----------------
 id        | integer                | not null default 
nextval('"router_id_seq"'::text)
 name      | character varying(256) | 
 ethernet  | inet                   | 
 model     | character varying(256) | 
 nexthop   | inet                   | 
 comments  | character varying(256) | 
Index: router_pkey

ler=# \d assigned_networks
               Table "assigned_networks"
     Attribute     |          Type          | Modifier 
-------------------+------------------------+----------
 netblock          | cidr                   | 
 router            | integer                | 
 interface         | character varying(256) | 
 dest_ip           | inet                   | 
 mis_token         | character(16)          | 
 assigned_date     | date                   | 
 assigned_by       | character varying(256) | 
 justification_now | integer                | 
 justification_1yr | integer                | 
 cust_asn          | smallint               | 

ler=# 



Message-ID: <20010514.18002500@ler-freebie.iadfw.net>
Permalink:  ../20010514.18002500@ler-freebie.iadfw.net/
Also on:    postgresql.org/message-id/20010514.18002500@ler-freebie.iadfw.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ler@lerctr.org
  Subject: Re: plpgsql function / ??? / help
  In-Reply-To: <20010514.18002500@ler-freebie.iadfw.net>
  References: <20010514.18002500@ler-freebie.iadfw.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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