Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
postgres_sql [2019/02/13 07:56]
root [Xml]
postgres_sql [2019/02/28 23:07] (current)
root [Links and References]
Line 468: Line 468:
  
  
 +=== Copy - Bulk Loading with Python === 
 +
 +. With this code example we’re going to generate a CSV live though as opposed to reading one from disk. In production in both  Python you could parse the CSV out from disk, or generate it live from some other part of your pipeline like Kafka/​Kinesis.
 +
 +<code python>
 +conn = psycopg2.connect(DSN)
 +curs = conn.cursor()
 +
 +data = StringIO.StringIO()
 +data.write('​\n'​.join(['​1',​ '​2','​3'​]))
 +data.seek(0)
 +
 +curs.copy_from(data,​ '​my_table'​)
 +</​code>​
  
 == GIS == == GIS ==
Line 538: Line 552:
  
 https://​wiki.postgresql.org/​wiki/​Foreign_data_wrappers https://​wiki.postgresql.org/​wiki/​Foreign_data_wrappers
 +
 +=== Async Postgres - asyncpg ==
 +The developers of UvLoop applied it to the postgres binary protocol to claim 1m row inserts per seconds (faster than go)
 +
 +https://​magic.io/​blog/​asyncpg-1m-rows-from-postgres-to-python/​
 == Links and References ==  == Links and References == 
 * https://​github.com/​begriffs/​postgrest PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standards-compliant,​ faster API than you are likely to write from scratch. * https://​github.com/​begriffs/​postgrest PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standards-compliant,​ faster API than you are likely to write from scratch.
 * http://​www.postgresqltutorial.com/​ a list of tutorials of commands and methods ​ * http://​www.postgresqltutorial.com/​ a list of tutorials of commands and methods ​
  
 +* A good blog regarding features of modern sql https://​modern-sql.com/​blog/​2019-02/​postgresql-11
 Clients Clients
 * Web based client https://​github.com/​rickbergfalk/​sqlpad * Web based client https://​github.com/​rickbergfalk/​sqlpad
 
postgres_sql.1550073360.txt.gz · Last modified: 2019/02/13 07:56 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd