Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Jdbc > Re: How to just...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 9 Topic 1967 of 2010
Post > Topic >>

Re: How to just "link" to some data feed

by pg@[EMAIL PROTECTED] (Dave Cramer) Jun 3, 2008 at 08:24 PM

On 3-Jun-08, at 8:04 PM, Albretch Mueller wrote:
> Hi,
> ~
> I have some CSV files which I need to link to from within PG
> ~
> From
http://darkavngr.blogspot.com/2007/06/im****tar-datos-externos-nuestra-base-de.html
> ~
> Say, you have the following data feed in /tmp/codigos_postales.csv
> ~
> "01000","San Angel","Colonia","Alvaro Obregon","Distrito Federal"
> "01010","Los Alpes","Colonia","Alvaro Obregon","Distrito Federal"
> "01020","Guadalupe Inn","Colonia","Alvaro Obregon","Distrito Federal"
> "01028","Secretaria de Contraloria y Desarrollo Administrativo","Gran
> usuario","Alvaro Obregon","Distrito Federal"
> "01029","Infonavit","Gran usuario","Alvaro Obregon","Distrito Federal"
> "01030","Axotla","Pueblo","Alvaro Obregon","Distrito Federal"
> "01030","Florida","Colonia","Alvaro Obregon","Distrito Federal"
> "01040","Campestre","Colonia","Alvaro Obregon","Distrito Federal"
> ~
> then you can defined the DB data model as:
> ~
> CREATE TABLE codigos_postales(
>  cp char(5),
>  asentamiento varchar(120),
>  tipo_asentamiento varchar(120),
>  municipio varchar(120),
>  estado varchar(120)
> );
> ~
> and copy all values into the DB like this:
> ~
> COPY codigos_postales FROM '/tmp/codigos_postales.csv' DELIMITERS  
> ',' CSV;
> ~
> But how do you just link to the data feed effectively keeping it in a
> CSV file format not internal to PG?
> ~
> Also I need for all changes to the data to (of course!) be propagated
> to the data back end
> ~
> Then you can link to the same data feed from some other engine that
> reads in CSV (I think all do or should)
> ~
> How do you link  to a CSV using PG?
> ~
> Thank you
> lbrtchx
>

You can't.

You have to insert it into the table
>

so you need some code which reads the csv and inserts it into the table.

Dave
> -- 
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@[EMAIL PROTECTED]
)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
 




 9 Posts in Topic:
How to just "link" to some data feed
lbrtchx@[EMAIL PROTECTED]  2008-06-03 20:04:10 
Re: How to just "link" to some data feed
pg@[EMAIL PROTECTED] (Da  2008-06-03 20:24:47 
Re: How to just "link" to some data feed
lbrtchx@[EMAIL PROTECTED]  2008-06-03 22:59:49 
Re: How to just "link" to some data feed
oliver@[EMAIL PROTECTED]   2008-06-04 15:03:49 
Re: How to just "link" to some data feed
tgl@[EMAIL PROTECTED] (T  2008-06-04 00:16:22 
Re: How to just "link" to some data feed
lbrtchx@[EMAIL PROTECTED]  2008-06-03 23:58:41 
Re: How to just "link" to some data feed
oliver@[EMAIL PROTECTED]   2008-06-04 16:04:13 
Re: How to just "link" to some data feed
heikki@[EMAIL PROTECTED]   2008-06-04 11:19:08 
Re: How to just "link" to some data feed
tivvpgsqljdbc@[EMAIL PROT  2008-06-04 11:27:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 8:26:08 CDT 2008.