Withdata Software

Producing high-quality database tools

Main menu

Skip to primary content
Skip to secondary content
  • Withdata Software
  • Blog
  • Categories
  • Tags

Category Archives: PostgreSQL

Some ETL (Extract-Transform-Load) tools for PostgreSQL

Posted on August 11, 2017 by Shiji Pan

Withdata Software provide some ETL (Extract-Transform-Load) tools for PostgreSQL: FileToDB Load TXT, CSV, TSV, XML, JSON, Excel, SQL, RDF, INI data to PostgreSQL DBToFile Export PostgreSQL data to TXT, CSV, TSV, XML, JSON, Excel, SQL files DBCopier Copy data between PostgreSQL and ... Read more

Posted in PostgreSQL | Tagged ETL, Extract-Transform-Load, PostgreSQL

How to get index column names of a table from PostgreSQL

Posted on October 24, 2016 by Shiji Pan

select i.relname as index_name, a.attname as column_name from pg_class t, pg_class i, pg_index ix, pg_attribute a, pg_namespace n where t.oid = ix.indrelid and i.oid = ix.indexrelid and a.attrelid = t.oid and a.attnum = ANY(ix.indkey) and n.oid=t.relnamespace and t.relkind = 'r' and ... Read more

Posted in PostgreSQL | Tagged get index columns, PostgreSQL

How to get primary key of a table from PostgreSQL

Posted on October 24, 2016 by Shiji Pan

SELECT pg_attribute.attname, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) FROM pg_index, pg_class, pg_attribute, pg_namespace WHERE pg_class.oid = 'my_table_name'::regclass AND indrelid = pg_class.oid AND nspname = 'my_schema_name' AND pg_class.relnamespace = pg_namespace.oid ... Read more

Posted in PostgreSQL | Tagged get primary key, PostgreSQL

How to get column names from PostgreSQL table

Posted on October 21, 2016 by Shiji Pan

select column_name from information_schema.columns where table_name='my_table_name' see also: How to get column names from Sql Server table How to get column names from DB2 table How to get column names from Oracle table How to get column names from Mysql table How to get column names from SQLite ... Read more

Posted in PostgreSQL

How to execute sql file via command line for PostgreSQL

Posted on August 29, 2013 by Shiji Pan

Use psql psql -U username -d myDataBase -a -f myInsertFile More information: http://blog.manoharbhattarai.com.np/2013/04/03/execute-sql-file-from-command-line-in-postgresql/ ... Read more

Posted in PostgreSQL | Tagged command line, command line execute sql, PostgreSQL

How to limit the number of rows returned by a PostgreSQL query

Posted on August 10, 2013 by Shiji Pan

In MySQL, you can use “Limit <skip>,<count>”, like this: select * from sometable order by name limit 20,10 How to do in PostgreSQL? You’d use “Limit <count> offset <skip>”, like this: select * from sometable order by name limit 10 offset ... Read more

Posted in PostgreSQL | Tagged equivalent for the MySQL Limit, PostgreSQL

Replace Update or Insert a row Into PostgreSQL Table

Posted on August 1, 2013 by Shiji Pan

In Mysql, if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in PostgreSQL? A way to do an “UPSERT” in postgresql is to do two sequential ... Read more

Posted in PostgreSQL | Tagged merge into, PostgreSQL, replace into, upsert

Recent Posts

  • Use Cases for Dumping to CSV
  • Convert Text to Speech by CSV / TSV
Withdata Software. ©2004 - 2025 All rights reserved.