[GENERAL] big un stacking query - save me from myself

2013-03-13 Thread Kirk Wythers
I have a fairly large table with two columns that I need to "de-normalize" (235 million rows) There has got to be a better (i.e. faster) approach than what I am doing. I am using a MAX CASE on each of the 24 variables (column names variable and value) that I want to unstack. Any suggestions wou

[GENERAL] big un stacking query - help save me from myself

2013-03-13 Thread Kirk Wythers
I hace a fairly large table with two columns that I need to "de-normalize" (235 million rows) There has got to be a better (i.e. faster) approach than what I am doing. I am using a MAX CASE on each of the 24 variables (column names variable and value) that I want to unstack. Any suggestions wou

[GENERAL] Re: [PERFORM] PostgreSQL 9.2.3 performance problem caused Exclusive locks

2013-03-13 Thread Joshua Berkus
Emre, > > LOG: process 4793 acquired ExclusiveLock on extension of relation > > 305605 of database 16396 after 2348.675 ms The reason you're seeing that message is that you have log_lock_waits turned on. That message says that some process waited for 2.3 seconds to get a lock for expanding the

Re: [GENERAL] table spaces

2013-03-13 Thread Scott Marlowe
On Wed, Mar 13, 2013 at 7:26 AM, Shaun Thomas wrote: > On 03/12/2013 05:49 PM, Gregg Jaskiewicz wrote: > >> So out of 6 disks then having 4 in Raid 1+0 configuration and other >> two in mirror for WAL. That's another option then for me to test. > > > That is an option, but it's not necessarily a g

Re: [GENERAL] Testing Technique when using a DB

2013-03-13 Thread Joe Van Dyk
On Wed, Mar 13, 2013 at 8:47 AM, Steve Crawford < scrawf...@pinpointresearch.com> wrote: > On 03/12/2013 09:05 PM, Perry Smith wrote: > >> To all who replied: >> >> Thank you. ... >> >> >> I had not seriously considered pg_dump / pg_restore because I assumed it >> would be fairly slow but I will e

Re: [GENERAL] Testing Technique when using a DB

2013-03-13 Thread Steve Crawford
On 03/12/2013 09:05 PM, Perry Smith wrote: To all who replied: Thank you. ... I had not seriously considered pg_dump / pg_restore because I assumed it would be fairly slow but I will experiment with pg_restore and template techniques this weekend and see which ones prove viable. Another pos

Re: [GENERAL] table spaces

2013-03-13 Thread Shaun Thomas
On 03/13/2013 10:30 AM, Greg Jaskiewicz wrote: Is that SSD mixed in with other disks? Kinda. We chose a PCIe-based SSD (FusionIO). We have a RAID-10 for low-transaction and archived data. It worked for us, but it's pretty spendy. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite

Re: [GENERAL] table spaces

2013-03-13 Thread Greg Jaskiewicz
On 13 Mar 2013, at 13:26, Shaun Thomas wrote: > On 03/12/2013 05:49 PM, Gregg Jaskiewicz wrote: > >> So out of 6 disks then having 4 in Raid 1+0 configuration and other >> two in mirror for WAL. That's another option then for me to test. > > That is an option, but it's not necessarily a good

Re: [GENERAL] table spaces

2013-03-13 Thread John R Pierce
On 3/13/2013 6:26 AM, Shaun Thomas wrote: I have to tell you though, we had a server with twelve spindles three years ago, and it barely kept up with our transaction load. We had two hot spares, a RAID-1, and 8-disks in a RAID-10. Several pgbench tests back then showed that our RAID-10 could on

Re: [GENERAL] SELECT 1 = ANY (SELECT ARRAY[1,2,3]) -> ERROR: operator does not exist: integer = integer[] ?

2013-03-13 Thread Thor Michael Støre
On 13. mars 2013, at 15:35, Ian Lawrence Barwick wrote: > -> "Is the integer value 1 contained in the specified result set, > which happens to be an array (which is not comparable with an > integer)?" (NO) > > select 1 = ANY ((SELECT ARRAY[1,2,3])::int[]); > -> "Is the value one contained in an a

Re: [GENERAL] SELECT 1 = ANY (SELECT ARRAY[1,2,3]) -> ERROR: operator does not exist: integer = integer[] ?

2013-03-13 Thread Tom Lane
Ian Lawrence Barwick writes: > 2013/3/13 Thor Michael Støre : >> Could someone make sense of this for me? >> postgres=# select 1 = ANY (SELECT ARRAY[1,2,3]); >> ERROR: operator does not exist: integer = integer[] > A bit tricky to explain... Yeah. The short answer is that "foo = ANY (SELECT

Re: [GENERAL] SELECT 1 = ANY (SELECT ARRAY[1,2,3]) -> ERROR: operator does not exist: integer = integer[] ?

2013-03-13 Thread Ian Lawrence Barwick
2013/3/13 Thor Michael Støre : > Hello, > > Could someone make sense of this for me? > > $ /Library/PostgreSQL/9.2/bin/psql -d postgres postgres > psql (9.2.3) > Type "help" for help. > > postgres=# select 1 = ANY (ARRAY[1,2,3]); > ?column? > -- > t > (1 row) > > postgres=# select 1 = ANY

[GENERAL] SELECT 1 = ANY (SELECT ARRAY[1,2,3]) -> ERROR: operator does not exist: integer = integer[] ?

2013-03-13 Thread Thor Michael Støre
Hello, Could someone make sense of this for me? $ /Library/PostgreSQL/9.2/bin/psql -d postgres postgres psql (9.2.3) Type "help" for help. postgres=# select 1 = ANY (ARRAY[1,2,3]); ?column? -- t (1 row) postgres=# select 1 = ANY (SELECT ARRAY[1,2,3]); ERROR: operator does not exist:

Re: [GENERAL] Select rotate in PostgreSql

2013-03-13 Thread Fabrízio de Royes Mello
On Wed, Mar 13, 2013 at 10:32 AM, Andre Lopes wrote: > Hi all, > > I don't know how to ask for this. I need to rotate a Select in > PostgreSql, just like this: http://dpaste.com/1021691/ > > I can achieve this easily without a procedure? > > Hi Andre, If I understood you want to aggregate "commen

Re: [GENERAL] Select rotate in PostgreSql

2013-03-13 Thread Merlin Moncure
On Wed, Mar 13, 2013 at 8:32 AM, Andre Lopes wrote: > Hi all, > > I don't know how to ask for this. I need to rotate a Select in > PostgreSql, just like this: http://dpaste.com/1021691/ > > I can achieve this easily without a procedure? yes: that's not rotation but simple aggregation. look for s

Re: [GENERAL] C++Builder table exist

2013-03-13 Thread Raymond O'Donnell
On 13/03/2013 13:19, Charl Roux wrote: > Hi Ray, > > Thanks for all the help. It works perfectly. > > void __fastcall TfrmMain::FormCreate(TObject *Sender) > { > unsigned int errorCode; > > AnsiString SQL = "CREATE TABLE IF NOT EXISTS queryBackup( queryName > text PRIMARY KEY, query text )"

[GENERAL] Select rotate in PostgreSql

2013-03-13 Thread Andre Lopes
Hi all, I don't know how to ask for this. I need to rotate a Select in PostgreSql, just like this: http://dpaste.com/1021691/ I can achieve this easily without a procedure? Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-13 Thread Alexander Farber
Thank you, this was indeed the (uneeded) semicolon at end of the COPY line. May I ask another question - On Tue, Mar 12, 2013 at 6:24 PM, Ian Lawrence Barwick wrote: >>> 2013/3/13 Alexander Farber : I have a list of 40 non-english words, each on a separate line and in UTF8 for

Re: [GENERAL] table spaces

2013-03-13 Thread Shaun Thomas
On 03/12/2013 05:49 PM, Gregg Jaskiewicz wrote: So out of 6 disks then having 4 in Raid 1+0 configuration and other two in mirror for WAL. That's another option then for me to test. That is an option, but it's not necessarily a good one. If all you have are six disks, you are probably better

Re: [GENERAL] C++Builder table exist

2013-03-13 Thread Charl Roux
Hi Ray, Thanks for all the help. It works perfectly. void __fastcall TfrmMain::FormCreate(TObject *Sender) { unsigned int errorCode; AnsiString SQL = "CREATE TABLE IF NOT EXISTS queryBackup( queryName text PRIMARY KEY, query text )"; errorCode = frmDataModule->eyeConnection->ExecuteDir

[GENERAL] Do not understand why this happens

2013-03-13 Thread Aln Kapa
HI. I connect to the database using the PGDAC, and then send a NOTIFY to myself every minute. In this case, the logs get that. 2013-03-10 10:34:36 19797 LOG: process 19797 still waiting for AccessExclusiveLock on object 0 of class 1262 of database 0 after 3000.100 ms 2013-03-10 10:34:36 19797 S

Re: [GENERAL] C++Builder table exist

2013-03-13 Thread Raymond O'Donnell
On 13/03/2013 11:46, Charl Roux wrote: > Thanks for the response. > > 1. > I have used the following line to determine if the table does exist in > the database: > if( tableList->IndexOf("queryBackup") < 0 ) > errorCode = frmDataModule->eyeConnection->ExecuteDirect(SQL); Please don't top-post

Re: [GENERAL] C++Builder table exist

2013-03-13 Thread Raymond O'Donnell
On 13/03/2013 10:59, Charl Roux wrote: > Hi, > > I have migrated from MySQL to PostgreSQL. I am running on WindowsXP SP3, > C++Builder6, PostgreSQL9.2, pgExpress4.6(database driver) > I have the following scenarion. If my applications starts up, it will > test if a certain table exists within the

[GENERAL] C++Builder table exist

2013-03-13 Thread Charl Roux
Hi, I have migrated from MySQL to PostgreSQL. I am running on WindowsXP SP3, C++Builder6, PostgreSQL9.2, pgExpress4.6(database driver) I have the following scenarion. If my applications starts up, it will test if a certain table exists within the database. If not, it will create the table, els

Re: [GENERAL] table spaces

2013-03-13 Thread Alban Hertroys
On 12 March 2013 22:31, Gregg Jaskiewicz wrote: > Ok, > > So by that token (more drives the better), I should have raid 5 (or > whichever will work) with all 6 drives in it ? > Raid 5 is usually advised against, as in many scenarios it won't perform very well. For example, see: http://www.revsys

Re: [GENERAL] orafce

2013-03-13 Thread Pavel Stehule
Hello 2013/3/13 Paolo Grifa : > Hi all, > I am quite new in postgres, having experience with Oracle. > I was trying to migrate some very simple applications from Oracle and found > out that some functions like TRUNC() are only available via an addon called > "orafce". The problem is that it seems

Re: [GENERAL] orafce

2013-03-13 Thread Gabriele Bartolini
Hi Paolo, we have recently migrated orafce to github (https://github.com/orafce/orafce) and are in the middle of the process for migrating the mailing list to Google Groups. You are better off asking here: https://groups.google.com/forum/?fromgroups#!forum/orafce-general Thanks, Gabrie

[GENERAL] orafce

2013-03-13 Thread Paolo Grifa
Hi all, I am quite new in postgres, having experience with Oracle. I was trying to migrate some very simple applications from Oracle and found out that some functions like TRUNC() are only available via an addon called "orafce". The problem is that it seems only available for Postgres 9.1, while we