Re: [GENERAL] Importing CSV File

2015-10-26 Thread Rajeev Bhatta
You could do it simpler by creating a temp table with all columns in the CSV and then doing either creating another table of the temp table or building a view on top of the table. The decision depends on how frequently you would be importing data from the CSV. If only one time then you are bet

[GENERAL] 回复: postgres cpu 100% need help

2015-10-26 Thread 657985...@qq.com
Dear sir: Recently a wired question about postgresql database really bothered me a lot, so i really need your help. Here is the problem, in the most situations the postgre database work very well, Average 3500tps/s per day, the cpu usage of its process is 3%~10% and every query can be

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread John R Pierce
On 10/26/2015 7:44 PM, David G. Johnston wrote: ​They both have their places. It is usually quite difficult to automate and version control the manual work that goes into using command line tools.​ I hope you mean, its difficult to automate and version control clickity-clicky work that goes

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David G. Johnston
On Mon, Oct 26, 2015 at 10:14 PM, Adrian Klaver wrote: > On 10/26/2015 06:48 PM, David Blomstrom wrote: > >> Doesn't this thread demonstrate the advantage of GUI's??? I created a >> database and table with pgAdmin III with no help at all. >> > > At this point I would say sticking with pgAdmin is

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 06:48 PM, David Blomstrom wrote: Doesn't this thread demonstrate the advantage of GUI's??? I created a database and table with pgAdmin III with no help at all. At this point I would say sticking with pgAdmin is the best option. I then got a flurry of well-intentioned tips about

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 06:08 PM, David Blomstrom wrote: Judging from the anti-Mac comments, it sounds like PostgreSQL is kind of a Linux/Microsoft thing. If PostgreSQL isn't compatible with Apple, then That is definitely not true. OS X under the hood comes from the same basic lineage as Linux, by way o

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
> On Oct 26, 2015, at 7:48 PM, David Blomstrom > wrote: > > Doesn't this thread demonstrate the advantage of GUI's??? I created a > database and table with pgAdmin III with no help at all. > > I then got a flurry of well-intentioned tips about the command-line tool. I > tried all of them. I

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Doesn't this thread demonstrate the advantage of GUI's??? I created a database and table with pgAdmin III with no help at all. I then got a flurry of well-intentioned tips about the command-line tool. I tried all of them. I tried them twice. I tried them upside down and backwards. People then bega

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
You will do what you need to do but please do not claim that pg is not Mac compatible. Many on this thread are regular Mac/pg users. We all thought we were doing you a favour in trying to free you from GUI tools. For us they are restraining. For you they may be liberating. Stick with pgAdmin and

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Judging from the anti-Mac comments, it sounds like PostgreSQL is kind of a Linux/Microsoft thing. If PostgreSQL isn't compatible with Apple, then that's definitely the end of the line. I used M$ for years and would never go back. I used to be a passionate Linux supporter - largely because I wanted

Re: [GENERAL] Red Hat Policies Regarding PostgreSQL

2015-10-26 Thread Tom Lane
Michael Convey writes: > Due to policies for Red Hat family distributions, the PostgreSQL > installation will not be enabled for automatic start or have the database > initialized automatically. > To which policies are they referring? Licensing, security, or other?​ Packaging policy: daemons s

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 05:54 PM, David Blomstrom wrote: That's exactly what I've been doing. I just did it again... Hmm, maybe time to try Robs suggestion: " Cmd-Spacebar Terminal This should find the actual normal terminal. Click on it." Edited from his original post- at the prompt therein: psql --

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Melvin Davidson
The law of O/S & databases: For every Linux / PostgreSQL user, there is and equal an opposite Mac / MySQL user. However, the latter is completely useless. On Mon, Oct 26, 2015 at 8:54 PM, David Blomstrom wrote: > That's exactly what I've been doing. I just did it again... > > Last login: Mon Oct

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David G. Johnston
On Mon, Oct 26, 2015 at 8:54 PM, David Blomstrom wrote: > That's exactly what I've been doing. I just did it again... > > Last login: Mon Oct 26 17:53:05 on ttys001 > > Davids-MacBook-Pro-2:~ davidblomstrom$ > /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit > > Server [localhost]: Server [localh

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
That's exactly what I've been doing. I just did it again... Last login: Mon Oct 26 17:53:05 on ttys001 Davids-MacBook-Pro-2:~ davidblomstrom$ /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Server [localhost]: Server [localhost Database [postgres]: Database [postgres]: Port [5432]: Port [5432

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 13:29, John R Pierce wrote: On 10/26/2015 5:20 PM, David G. Johnston wrote: What exactly are you showing us here? he's demonstrating a lack of reading comprehension. I'm done. thread on ignore. I think its proof that Apple products rot your brain! -- Sent via pgsql-gener

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 05:27 PM, David Blomstrom wrote: I'm just showing you what happened when I typed in \l and hit enter, then typed in \dt and hit enter, etc. To repeat: Do: Server [localhost]: Database [postgres]: Port [5432]: Username [postgres]: Just hit the Enter key after each of the abov

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread John R Pierce
On 10/26/2015 5:20 PM, David G. Johnston wrote: What exactly are you showing us here? he's demonstrating a lack of reading comprehension. I'm done. thread on ignore. -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I'm just showing you what happened when I typed in \l and hit enter, then typed in \dt and hit enter, etc. As Adrian Klaver said, this isn't going anywhere. The Seattle PostgreSQL User Group has its monthly meeting in a month or two. I work night shift, so I can't really make it, but if I can drop

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David G. Johnston
On Mon, Oct 26, 2015 at 8:07 PM, David Blomstrom wrote: > Server [localhost]: Server [localhost]: > > Database [postgres]: Database [postgres]: > > Port [5432]: Port [5432]: > > Username [postgres]: Username [postgres]: > What exactly are you showing us here? David J.

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 05:07 PM, David Blomstrom wrote: On Mon, Oct 26, 2015 at 5:02 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 10/26/2015 04:42 PM, David Blomstrom wrote: Last login: Mon Oct 26 16:35:25 on ttys002 /Library/PostgreSQL/9.5/scripts/runpsql.sh; ex

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
On Mon, Oct 26, 2015 at 5:02 PM, Adrian Klaver wrote: > On 10/26/2015 04:42 PM, David Blomstrom wrote: > >> Last login: Mon Oct 26 16:35:25 on ttys002 >> >> /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit >> >> Davids-MacBook-Pro-2:~ davidblomstrom$ >> /Library/PostgreSQL/9.5/scripts/runpsql.sh;

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:42 PM, David Blomstrom wrote: Last login: Mon Oct 26 16:35:25 on ttys002 /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Davids-MacBook-Pro-2:~ davidblomstrom$ /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Server [localhost]: \l Database [postgres]: \dt Port [5432]: Use

[GENERAL] Red Hat Policies Regarding PostgreSQL

2015-10-26 Thread Michael Convey
>From ​http://www.postgresql.org/download/linux/redhat/ comes the following quote: -- Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enable

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Last login: Mon Oct 26 16:35:25 on ttys002 /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Davids-MacBook-Pro-2:~ davidblomstrom$ /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Server [localhost]: \l Database [postgres]: \dt Port [5432]: Username [postgres]: Cmd-Spacebar Terminalpsql: cou

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David G. Johnston
On Mon, Oct 26, 2015 at 7:36 PM, David Blomstrom wrote: > I just deleted the PSQL icon from the dock, so I have to go into > Applications > PostgreSQL and open it. When I click on the PSQL icon, it > opens my Apple terminal, with the following text: > > Last login: Mon Oct 26 16:35:25 on ttys002

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 12:27, David Blomstrom wrote: LOL - This is precisely why I prefer GUI's. ;) I have two PostgreSQL icons on my taskbar - a blue elephant (pgAdmin III) and a little monitor (PSQL). When I click on PSQL, it always opens at least two windows or instances. When I type things in and hit

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 05:28 PM, David Blomstrom wrote: No, I'm on a Mac running OS X El Capitan. I don't have my mac with me today so this is a little rough. Cmd-Spacebar Terminal This should find the actual normal terminal. Click on it. at the prompt therein: psql --username davdi --host localhos

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:21 PM, David Blomstrom wrote: On Mon, Oct 26, 2015 at 4:19 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 10/26/2015 04:13 PM, David Blomstrom wrote: Oops, let me try it again... Still not making sense. Show the exact command you are usi

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I just deleted the PSQL icon from the dock, so I have to go into Applications > PostgreSQL and open it. When I click on the PSQL icon, it opens my Apple terminal, with the following text: Last login: Mon Oct 26 16:35:25 on ttys002 /Library/PostgreSQL/9.5/scripts/runpsql.sh; exit Davids-MacBook-P

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I thought PSQL seemed awfully similar to my Apple Terminal. I just noticed that when I click on the PSQL icon, it opens an Apple Terminal icon in the taskbar. I think that's why I'm getting different results - I'm typing into a PostgreSQL terminal and an Apple terminal. On Mon, Oct 26, 2015 at 4:3

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:26 PM, John R Pierce wrote: On 10/26/2015 4:22 PM, Gavin Flower wrote: By type of shell, is meant are using a bash shell in your terminal, or csh, or something else? Bash stands for BOurne Again Shell, it process commands like 'psql' that you type into the shell. Please copy i

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread John R Pierce
On 10/26/2015 4:27 PM, David Blomstrom wrote: I have two PostgreSQL icons on my taskbar - a blue elephant (pgAdmin III) and a little monitor (PSQL). When I click on PSQL, it always opens at least two windows or instances. When I type things in and hit enter, it spawns more windows. I've counted

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
No, I'm on a Mac running OS X El Capitan.

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
LOL - This is precisely why I prefer GUI's. ;) I have two PostgreSQL icons on my taskbar - a blue elephant (pgAdmin III) and a little monitor (PSQL). When I click on PSQL, it always opens at least two windows or instances. When I type things in and hit enter, it spawns more windows. I've counted a

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread John R Pierce
On 10/26/2015 4:22 PM, Gavin Flower wrote: By type of shell, is meant are using a bash shell in your terminal, or csh, or something else? Bash stands for BOurne Again Shell, it process commands like 'psql' that you type into the shell. Please copy i the email addresses of the other helping y

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 12:15, David Blomstrom wrote: Server [localhost]: \c geozoo2 david Database [postgres]: *Shell2* Username [postgres]: \c geozoo2 david psql: warning: extra command-line argument "david" ignored psql: warning: extra command-line argument "l" ignored psql: invalid port number: "

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread John R Pierce
On 10/26/2015 4:13 PM, David Blomstrom wrote: Oops, let me try it again... *Shell1* Server [localhost]: \l Database [postgres]: its asking you for the server host to log onto, and what database on that host. you can't issue commands, including metacommands like \l, until you've logged on

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David G. Johnston
On Mon, Oct 26, 2015 at 7:13 PM, David Blomstrom wrote: > Oops, let me try it again... > > *Shell1* > > Server [localhost]: \l > > Database [postgres]: > > * * * * * > > Server [localhost]: \dt > > Database [postgres]: > > > *Shell2* > > Database [postgres]: \l > > Port [5432]: > > * * * * * > >

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
On Mon, Oct 26, 2015 at 4:19 PM, Adrian Klaver wrote: > On 10/26/2015 04:13 PM, David Blomstrom wrote: > >> Oops, let me try it again... >> > > Still not making sense. > > Show the exact command you are using to get the below and explain where > you are running it. > > >> *Shell1* >> >> Server [l

Re: [GENERAL] Importing CSV File

2015-10-26 Thread David Blomstrom
Wow, I must be getting dyxlexic; yes, it is \r\n I guess it would be easy enough to just copy the stuff I want to import into a separate spreadsheet and save it as a CSV. I've done that before with really big spreadsheets, actually. Thanks.

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:13 PM, David Blomstrom wrote: Oops, let me try it again... Still not making sense. Show the exact command you are using to get the below and explain where you are running it. *Shell1* Server [localhost]: \l Database [postgres]: * * * * * Server [localhost]: \dt Datab

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Oops, let me try it again... *Shell1* Server [localhost]: \l Database [postgres]: * * * * * Server [localhost]: \dt Database [postgres]: *Shell2* Database [postgres]: \l Port [5432]: * * * * * Port [5432]: \dt Username [postgres]:

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:10 PM, David Blomstrom wrote: The below makes no sense to me. Server [localhost]: /l Database [postgres]: * * * * * Server [localhost]: /dt Database [postgres]: * * * * * However...I've noticed that when I open up the shell, Again, what shell? I get multiple instances

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 11:18, David Blomstrom wrote: I pasted this into the shell... CREATE ROLE david LOGIN CREATEDB; CREATE DATABASE GeoZoo2 OWNER david; and I did it again, replacing LOGIN with my password, but when I refresh pgAdmin III, there are no new databases. And when I paste this in, it doe

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Server [localhost]: /l Database [postgres]: * * * * * Server [localhost]: /dt Database [postgres]: * * * * * However...I've noticed that when I open up the shell, I get multiple instances - sometimes over half a dozen. If I type the same things into one of the other instances, I get this: Pr

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 03:57 PM, David Blomstrom wrote: When I type in /l, it just says "database Postgres," even though I can see TWO databases in pgAdmin III. When I type in /dt, it says Username [postgres]. Huh. It should be \l and \dt Step us through what you are doing, using cut and paste directly

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 11:57, David Blomstrom wrote: When I type in /l, it just says "database Postgres," even though I can see TWO databases in pgAdmin III. When I type in /dt, it says Username [postgres]. On Mon, Oct 26, 2015 at 3:40 PM, Gavin Flower mailto:gavinflo...@archidevsys.co.nz>> wrote:

Re: [GENERAL] PAM LDAP CREATE USER

2015-10-26 Thread Aaron_Wright
> From: Tom Lane > aaron_wri...@selinc.com writes: > > I recently upgraded from 8.4 to 9.3, and my custom LDAP PAM module no > > longer works. > > 8.4.what and 9.3.what? 8.4.16 to 9.3.4 > Have you checked the behavior in any other releases? Not yet. I was interested in getting a laugh test

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
When I type in /l, it just says "database Postgres," even though I can see TWO databases in pgAdmin III. When I type in /dt, it says Username [postgres]. On Mon, Oct 26, 2015 at 3:40 PM, Gavin Flower wrote: > On 27/10/15 11:18, David Blomstrom wrote: > [...] > >> CREATE DATABASE GeoZoo2 >> > [..

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 11:18, David Blomstrom wrote: [...] CREATE DATABASE GeoZoo2 [...] Would strongly advise NOT using capital letters in names of databases in pg! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mai

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 11:18, David Blomstrom wrote: I pasted this into the shell... CREATE ROLE david LOGIN CREATEDB; CREATE DATABASE GeoZoo2 OWNER david; and I did it again, replacing LOGIN with my password, but when I refresh pgAdmin III, there are no new databases. And when I paste this in, it doe

Re: [GENERAL] PAM LDAP CREATE USER

2015-10-26 Thread Tom Lane
aaron_wri...@selinc.com writes: > I recently upgraded from 8.4 to 9.3, and my custom LDAP PAM module no > longer works. 8.4.what and 9.3.what? Have you checked the behavior in any other releases? > In brief, my LDAP PAM module authenticates a centralized user and then > creates a matching dat

[GENERAL] how to insert stream into table using nodejs?

2015-10-26 Thread Leonardo
Hello all, i'm looking for a way to insert a file into a table using available binding for nodejs. just for comparison, if i where using java on server the upload code would be like this: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOE

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 09:29, David Blomstrom wrote: [...] Regarding my "usage patterns," I use spreadsheets (Apple's Numbers program) to organize data. I then save it as a CSV file and import it into a database table. It would be very hard to break with that tradition, because I don't know of any other w

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 03:18 PM, David Blomstrom wrote: I pasted this into the shell... What shell, psql? CREATE ROLE david LOGIN CREATEDB; CREATE DATABASE GeoZoo2 OWNER david; Did you see any errors? and I did it again, replacing LOGIN with my password, but when I refresh pgAdmin III, there ar

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I pasted this into the shell... CREATE ROLE david LOGIN CREATEDB; CREATE DATABASE GeoZoo2 OWNER david; and I did it again, replacing LOGIN with my password, but when I refresh pgAdmin III, there are no new databases. And when I paste this in, it doesn't create a table... CREATE TABLE public.g

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Adrian Klaver
On 10/26/2015 02:45 PM, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table

[GENERAL] PAM LDAP CREATE USER

2015-10-26 Thread Aaron_Wright
I recently upgraded from 8.4 to 9.3, and my custom LDAP PAM module no longer works. In brief, my LDAP PAM module authenticates a centralized user and then creates a matching database user, using a separate super user connection to the database, before returning successfully from the PAM module.

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
OK, I figured out how to drop the primary key and change the NULLS. So it looks like this now: CREATE TABLE public.gz_life_mammals ( id integer NOT NULL, taxon text NOT NULL, parent text NOT NULL, slug text, namecommon text, plural text, extinct smallint NOT NULL, rank smallint NO

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Gavin Flower
On 27/10/15 10:45, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table, e

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Adrian Klaver
On 10/26/2015 02:45 PM, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 01:51 PM, David Blomstrom wrote: I'm focusing primarily on vertebrates at the moment, which have a total of (I think) about 60,000-70,000 rows for all taxons (species, families, etc.). My goal is to create a customized database that does a really good job of handling vertebrates fir

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 10:26, David Blomstrom wrote: Here's what it looks like now: CREATE TABLE public.gz_life_mammals ( id integer NOT NULL, taxon text NOT NULL, parent text NOT NULL, slug text, namecommon text, plural text, extinct smallint NOT NULL, rank smallint NOT NULL, key smallin

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 02:26 PM, David Blomstrom wrote: Here's what it looks like now: CREATE TABLE public.gz_life_mammals ( id integer NOT NULL, taxon text NOT NULL, parent text NOT NULL, slug text, namecommon text, plural text, extinct smallint NOT NULL, rank smallint NOT NULL,

[GENERAL] Importing CSV File

2015-10-26 Thread David Blomstrom
I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table, everything beyond /r/n is ignored. Is there som

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Here's what it looks like now: CREATE TABLE public.gz_life_mammals ( id integer NOT NULL, taxon text NOT NULL, parent text NOT NULL, slug text, namecommon text, plural text, extinct smallint NOT NULL, rank smallint NOT NULL, key smallint NOT NULL, CONSTRAINT "Primary Key" PRIM

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 03:21 PM, Gavin Flower wrote: On 27/10/15 10:17, David Blomstrom wrote: What does "top post" mean? And what do you mean by "embedded spaces"? Are you referring to the underscores in the TABLE name? On Mon, Oct 26, 2015 at 2:12 PM, Gavin Flower

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
On 27/10/15 10:17, David Blomstrom wrote: What does "top post" mean? And what do you mean by "embedded spaces"? Are you referring to the underscores in the TABLE name? On Mon, Oct 26, 2015 at 2:12 PM, Gavin Flower mailto:gavinflo...@archidevsys.co.nz>> wrote: Hi David, Please don't

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
What does "top post" mean? And what do you mean by "embedded spaces"? Are you referring to the underscores in the TABLE name? On Mon, Oct 26, 2015 at 2:12 PM, Gavin Flower wrote: > Hi David, > > Please don't top post! > > > On 27/10/15 09:42, David Blomstrom wrote: > >> I've created my first tab

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Gavin Flower
Hi David, Please don't top post! On 27/10/15 09:42, David Blomstrom wrote: I've created my first table in postgreSQL. I'd like to ask 1) if you see any errors, 2) do you have any suggestions for improving it, and 3) can you give me the code I need to paste into the shell (or whatever you call

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Incidentally, this is the script I'm using to display pages. It queries each table twice (field Taxon for scientific names, Slug for common names). It then picks up three auxiliary tables listing "parataxa," floaters and groups. $sql = "SELECT SUM(num) as num FROM ( SELECT COUNT(Taxon) AS num FR

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 02:51 PM, David Blomstrom wrote: I'm focusing primarily on vertebrates at the moment, which have a total of (I think) about 60,000-70,000 rows for all taxons (species, families, etc.). My goal is to create a customized database that does a really good job of handling vertebrates f

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I'm focusing primarily on vertebrates at the moment, which have a total of (I think) about 60,000-70,000 rows for all taxons (species, families, etc.). My goal is to create a customized database that does a really good job of handling vertebrates first, manually adding a few key invertebrates and p

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
I've created my first table in postgreSQL. I'd like to ask 1) if you see any errors, 2) do you have any suggestions for improving it, and 3) can you give me the code I need to paste into the shell (or whatever you call the command-line tool) to recreate it? This is what the table's schema looks li

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 02:29 PM, David Blomstrom wrote: Sorry for the late response. I don't have Internet access at home, so I only post from the library or a WiFi cafe. Anyway, where do I begin? Regarding my "usage patterns," I use spreadsheets (Apple's Numbers program) to organize data. I then save

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread David Blomstrom
Sorry for the late response. I don't have Internet access at home, so I only post from the library or a WiFi cafe. Anyway, where do I begin? Regarding my "usage patterns," I use spreadsheets (Apple's Numbers program) to organize data. I then save it as a CSV file and import it into a database tab

Re: [GENERAL] question

2015-10-26 Thread anj patnaik
Thanks Adrian. I've got postgres 9.4 running on a second RHEL 6.5 machine. This is the machine I want to restore the pg_dump to. Last week, I ran this command on the main PG 9.4 db server: ./pg_dump -t RECORDER -Fc postgres -Z0 | xz -9 > /tmp/dump_xz The -Z0 turns off compression. So I used xz

Re: [GENERAL] question

2015-10-26 Thread anj patnaik
Quick update on the above: 1) I got past the password prompt by changing the pg_hba.conf on target machine to trust. 2) I am still running this command to restore on remote machine and want feedback as it appears to NOT create the desired table: xzcat dump_xz |/opt/PostgreSQL/9.4/bin/psql -h myc

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 10:33 AM, Rob Sargent wrote: On 10/26/2015 11:14 AM, Adrian Klaver wrote: On 10/26/2015 08:32 AM, Rob Sargent wrote: On 10/26/2015 09:22 AM, Adrian Klaver wrote: On 10/26/2015 08:12 AM, Rob Sargent wrote: On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Bloms

Re: [GENERAL] Where do I enter commands?

2015-10-26 Thread Alexander Reichstadt
Hello David, This cookbook has worked for me for the last five years on Mac OS X, always and totally reliable up to incl. El Capitan and every intermittent release before. And most of all, it worked even as a repair measure. So if my server would stop working after a small Mac Os X update, I to

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 11:14 AM, Adrian Klaver wrote: On 10/26/2015 08:32 AM, Rob Sargent wrote: On 10/26/2015 09:22 AM, Adrian Klaver wrote: On 10/26/2015 08:12 AM, Rob Sargent wrote: On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're

Re: [GENERAL] Where do I enter commands?

2015-10-26 Thread Josip Rodin
On Sun, Oct 25, 2015 at 07:57:48AM -0700, David Blomstrom wrote: > I can see PostgreSQL is going to have a learning curve - hopefully shorter > than the years it took me to learn MySQL - but it looks interesting. The > community seems painfully small compared to MySQL, and there are less > online r

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 08:32 AM, Rob Sargent wrote: On 10/26/2015 09:22 AM, Adrian Klaver wrote: On 10/26/2015 08:12 AM, Rob Sargent wrote: On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're suggesting I make separate tables for kingdoms

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Lasse Westh-Nielsen
Nope, the log is empty. Literally zero bytes. On Mon, Oct 26, 2015 at 3:57 PM, Melvin Davidson wrote: > Just out of curiosity, is there anything in the postgresql.log which gives > an indication of a problem? > > On Mon, Oct 26, 2015 at 11:18 AM, Adrian Klaver > wrote: > >> On 10/26/2015 08:04

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Harald Fuchs
Thomas Kellerer writes: > I always wonder whether it's more efficient to aggregate this path > using an array rather than a varchar. Mainly because representing the > numbers as varchars will require more memory than as integer, but then > I don't know the overhead of an array structure and wheth

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Melvin Davidson
Just out of curiosity, is there anything in the postgresql.log which gives an indication of a problem? On Mon, Oct 26, 2015 at 11:18 AM, Adrian Klaver wrote: > On 10/26/2015 08:04 AM, Lasse Westh-Nielsen wrote: > >> Adrian, >> >> The service starts once the package is installed. >> >> - It did

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 09:22 AM, Adrian Klaver wrote: On 10/26/2015 08:12 AM, Rob Sargent wrote: On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're suggesting I make separate tables for kingdoms, classes and on down to species. I'll resea

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Adrian Klaver
On 10/26/2015 08:12 AM, Rob Sargent wrote: On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're suggesting I make separate tables for kingdoms, classes and on down to species. I'll research foreign keys and see what I can come up wi

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Adrian Klaver
On 10/26/2015 08:04 AM, Lasse Westh-Nielsen wrote: Adrian, The service starts once the package is installed. - It did that on Ubuntu14.04 - On Ubuntu 15.04, `sudo service postgresql status` _claims_ it has been started. Yes, it starts but it is a go nowhere, do nothing service: $ cat

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Rob Sargent
On 10/26/2015 08:43 AM, Jim Nasby wrote: On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're suggesting I make separate tables for kingdoms, classes and on down to species. I'll research foreign keys and see what I can come up with. I hope I can make separate tables for ma

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Lasse Westh-Nielsen
Stuart, You are a life-saver! With those two commands inserted into the cloud-init script, the service actually starts and can complete my CREATE command. Thanks! - Lasse On Mon, Oct 26, 2015 at 2:31 PM, Stuart Bishop wrote: > On 26 October 2015 at 18:21, Lasse Westh-Nielsen > wrote: >

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Lasse Westh-Nielsen
Adrian, The service starts once the package is installed. - It did that on Ubuntu14.04 - On Ubuntu 15.04, `sudo service postgresql status` _claims_ it has been started. On Mon, Oct 26, 2015 at 2:57 PM, Adrian Klaver wrote: > On 10/26/2015 07:08 AM, Lasse Westh-Nielsen wrote: > >> Adrian, >

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Thomas Kellerer
Alban Hertroys schrieb am 25.10.2015 um 22:07: > WITH RECURSIVE taxons AS ( > -- Hierarchical root nodes > SELECT N AS id, Taxon, Rank, 1 AS level, '' || N AS Path -- A useful > addition explained further down > FROM t > WHERE ParentID IS NULL > > -- Child nodes > UNION

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Adrian Klaver
On 10/26/2015 07:08 AM, Lasse Westh-Nielsen wrote: Adrian, Thanks. I know about the systemd change, and indeed the postgres package I end up with _has_ systemd integration already: $ cat /etc/systemd/system/multi-user.target.wants/postgresql.service # systemd service for managing all Po

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Jim Nasby
On 10/25/15 8:10 PM, David Blomstrom wrote: @ Adrian Klaver: Oh, so you're suggesting I make separate tables for kingdoms, classes and on down to species. I'll research foreign keys and see what I can come up with. I hope I can make separate tables for mammal species, bird species, fish species,

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Stuart Bishop
On 26 October 2015 at 18:21, Lasse Westh-Nielsen wrote: > Hey, > > I posted to stackoverflow about my problem upgrading from Ubuntu 14.04 to > Ubuntu 15.04: > http://stackoverflow.com/questions/33306475/ubuntu-15-04-postgresql-doesnt-start > > Tl;dr: postgresql service does not start properly when

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Lasse Westh-Nielsen
Adrian, Thanks. I know about the systemd change, and indeed the postgres package I end up with _has_ systemd integration already: $ cat /etc/systemd/system/multi-user.target.wants/postgresql.service # systemd service for managing all PostgreSQL clusters on the system. This # service is actually a

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Lasse Westh-Nielsen
Bill, Thanks for your help. But I have already tried with a variant that gives the postgres service time to do what it needs to do: #!/bin/bash -eux exec > >(tee /var/log/bootstrap.log) exec 2>&1 apt-get --quiet --quiet update apt-get --quiet --quiet upgrade apt-get install --quiet --quiet pos

Re: [GENERAL] Service not starting on Ubuntu 15.04

2015-10-26 Thread Adrian Klaver
On 10/26/2015 04:21 AM, Lasse Westh-Nielsen wrote: Hey, I posted to stackoverflow about my problem upgrading from Ubuntu 14.04 to Ubuntu 15.04: http://stackoverflow.com/questions/33306475/ubuntu-15-04-postgresql-doesnt-start Pretty sure it is no coincidence that the 14.04 --> 15.04 upgrade ch

  1   2   >