[GENERAL] unnesting hstore data

2015-10-31 Thread patrick keshishian
Hi, I'm new to hstore type and I couldn't figure out how to use each(hstore) so I am using akeys() and avals() along with unnest(). Here is a simple example: db=> CREATE TABLE pktest (id int8 PRIMARY KEY, tags hstore) ; CREATE TABLE db=> INSERT INTO pktest VALUES (1, '"key 1"=>"value 1","key

Re: [GENERAL] Selectively Importing Data

2015-10-31 Thread Raymond O'Donnell
On 31/10/2015 00:24, David Blomstrom wrote: > First consider the following table: > > create table taxon ( > taxonid serial, > descr text > ); > > As I understand it, "serial" means that column will automatically > populate with a numerical key. > > If I want to fill the field 'descr' with

Re: [GENERAL] does pg_dump get delayed if I have a loop that does continuous insertions

2015-10-31 Thread Guillaume Lelarge
2015-10-28 21:09 GMT+01:00 anj patnaik : > I was trying to achieve smallest file possible so tried the xz. Right now > the db size returned from SELECT > pg_size_pretty(pg_database_size('postgres') is 1.4 GB and the size of the > dump with xz is 2.2 GB. > > Is there a limit to

Re: [GENERAL] Selectively Importing Data

2015-10-31 Thread Charles Clavadetscher
Hello This should work: \copy taxon (descr) from ; This is true if your sheet has only one column, so you should delete that column. However if you happen to have another table with a foreign key on taxonid you will probably screw up the references. But from your description I take it, that

Re: [GENERAL] Hierarchical Query Question (PHP)

2015-10-31 Thread Andy Colson
On 10/30/2015 05:10 PM, David Blomstrom wrote: Just so I understand what's going on, I can create a lookup table by pasting this code... I don't know anything about biology so this data might be laughable, but its based on your original question:

Re: [GENERAL] Selectively Importing Data

2015-10-31 Thread David Blomstrom
Thanks for the tips. On Sat, Oct 31, 2015 at 7:12 AM, Charles Clavadetscher < clavadetsc...@swisspug.org> wrote: > Hello > > This should work: > > \copy taxon (descr) from ; > > This is true if your sheet has only one column, so you should delete that > column. However if you happen to have

Re: [GENERAL] Hierarchical Query Question (PHP)

2015-10-31 Thread David Blomstrom
Awesome; thanks! On Sat, Oct 31, 2015 at 7:19 AM, Andy Colson wrote: > On 10/30/2015 05:10 PM, David Blomstrom wrote: > >> Just so I understand what's going on, I can create a lookup table by >> pasting this code... >> >> > I don't know anything about biology so this data

Re: [GENERAL] Upgrade from 9.3 to 9.4 issue

2015-10-31 Thread Stephen Davies
On 31/10/15 13:32, Tom Lane wrote: Stephen Davies writes: I have just upgraded from Fedora 21 to 22. This included an upgrade of PostgreSQL from 9.3 to 9.4 which causes postmaster to fail because the existing databases are still at 9.3. As suggested, I then ran