Re: [GENERAL] pg_basebackup on standby node failed

2014-02-03 Thread Michael Paquier
On Tue, Feb 4, 2014 at 5:51 AM, Ying He wrote: > When I do: > pg_basebackup -D /backupDir > > I am getting: > pg_basebackup: directory "/usr/local/pgsql/data/pg_tblspc/tablespace1" > exists but is not empty > > tablespace1 is a tablespace created by CREATE TABLESPACE and > ""/usr/local/pgsql/data/

Re: [GENERAL] Composite type

2014-02-03 Thread George Ant
Chris, thank you for your time. Your reply was really helpful! I followed your advice. I didn't sacrifice relational design (I didn't have this intention) and I used joins/views. Kind Regards, George Antonopoulos -- View this message in context: http://postgresql.1045698.n5.nabble.com/Compos

[GENERAL] help on using C for postgresql

2014-02-03 Thread Madhurima Das
I am a beginner in Postgresql and trying to write a C++ program to connect a database and retrieve information from a database. I have downloaded Postgresql 9.3 in my MAC laptop and could create a database XXX with a user YYY and password ZZZ. I can create, modify etc using the pgAdmin3 tool. Nex

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Susan Cassidy
Works great, thanks a bunch. Susan On Mon, Feb 3, 2014 at 12:39 PM, Rob Sargent wrote: > On 02/03/2014 01:01 PM, Susan Cassidy wrote: > > description| description > ---+- > 18 cm long wrench | Scene 1 > absolute root | > blue screwdriver | Scene 1 >

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Adrian Klaver
On 02/03/2014 01:00 PM, Susan Cassidy wrote: The query is currently: select sti.description, sc.description from scene_thing_instances sti left outer join scenes sc on sti.scene_id = sc.scene_id order by sti.description, CASE when (sti.description = 'absolute root'::text) the

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Susan Cassidy
The query is currently: select sti.description, sc.description from scene_thing_instances sti left outer join scenes sc on sti.scene_id = sc.scene_id order by sti.description, CASE when (sti.description = 'absolute root'::text) then 1 when (sti.description ilike 'root%'

Re: [GENERAL] pg_basebackup on standby node failed

2014-02-03 Thread Ying He
Thanks Michael. It seems having an issue using pg_basebackup. When I do: pg_basebackup -D /backupDir I am getting: pg_basebackup: directory "/usr/local/pgsql/data/pg_tblspc/tablespace1" exists but is not empty tablespace1 is a tablespace created by CREATE TABLESPACE and ""/usr/local/pgsql/da

[GENERAL] Re: way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread David Johnston
Susan Cassidy-3 wrote > I have a column that contains items like > 'absolute root' > 'root 3' > 'root 4' > 'root 5' > 'scene 1' > 'scene 2' > 'scene 3' > > and I would like them to sort in that order. > > I tried: > select sti.description, sc.description from scene_thing_instances sti join > scen

Re: [GENERAL] postgres FDW cost estimation options unrecognized in 9.3-beta1

2014-02-03 Thread John R Pierce
On 2/3/2014 4:59 AM, Rajni Baliyan wrote: Is there any way to automate the archive deletion process. Any script or command in HA setup using pgpool please don't reply to an existing thread with a completely different topic and subject matter. your message is threaded under messages about f

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Rob Sargent
On 02/03/2014 01:01 PM, Susan Cassidy wrote: description| description ---+- 18 cm long wrench | Scene 1 absolute root | blue screwdriver | Scene 1 red toolbox | Scene 1 root 3| Scene 1 root 4| Scene 2 root 6

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Rob Sargent
On 02/03/2014 01:22 PM, Adrian Klaver wrote: On 02/03/2014 12:01 PM, Susan Cassidy wrote: CCing the list. This didn't sort the way I want. It ended up as: description| description ---+- 18 cm long wrench | Scene 1 absolute root | blue screwdriver

Re: [GENERAL] Server hanging with high CPU wait -- Checkpoint issue?

2014-02-03 Thread Jeff Janes
On Mon, Feb 3, 2014 at 11:16 AM, George Woodring wrote: > I am running 9.3.2 on CentOS 6.5 > > We have a new server we are migrating to that seems to lock up for up to > 30sec at a time with all of the processes in wait. I am seeing a weird > output with the checkpoint logs and am wondering if I

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Rob Sargent
On 02/03/2014 01:22 PM, Adrian Klaver wrote: On 02/03/2014 12:01 PM, Susan Cassidy wrote: CCing the list. This didn't sort the way I want. It ended up as: description| description ---+- 18 cm long wrench | Scene 1 absolute root | blue screwdriver

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Adrian Klaver
On 02/03/2014 12:01 PM, Susan Cassidy wrote: CCing the list. This didn't sort the way I want. It ended up as: description| description ---+- 18 cm long wrench | Scene 1 absolute root | blue screwdriver | Scene 1 red toolbox | Scene 1 ro

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Susan Cassidy
description| description ---+- 18 cm long wrench | Scene 1 absolute root | blue screwdriver | Scene 1 red toolbox | Scene 1 root 3| Scene 1 root 4| Scene 2 root 6| Scene 3 small wrench | Scene 1 tire

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread salah jubeh
Hello , The case Syntax is not correct , have a look here http://www.postgresql.org/docs/current/static/functions-conditional.html Furthermore; I think,  this will not ensure the order of root 3, root 4 and root 5 as well as scene1,... Regards On Monday, February 3, 2014 7:55 PM, Susan Ca

[GENERAL] Server hanging with high CPU wait -- Checkpoint issue?

2014-02-03 Thread George Woodring
I am running 9.3.2 on CentOS 6.5 We have a new server we are migrating to that seems to lock up for up to 30sec at a time with all of the processes in wait. I am seeing a weird output with the checkpoint logs and am wondering if I need to adjust something with the checkpointer config. My checkpo

Re: [GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Adrian Klaver
On 02/03/2014 10:53 AM, Susan Cassidy wrote: I have a column that contains items like 'absolute root' 'root 3' 'root 4' 'root 5' 'scene 1' 'scene 2' 'scene 3' and I would like them to sort in that order. I tried: select sti.description, sc.description from scene_thing_instances sti join scenes

Re: [GENERAL] Drop all overloads of a function without knowing parameter types

2014-02-03 Thread Evan Martin
Thanks for that "oid::regprocedure" trick! A query like this is fairly simple once you know it, but completely non-obvious when you don't. I'm not sure what conditions others want to search on (couldn't find it in the list archives), but "by qualified function name" seems like the obvious one.

[GENERAL] way to custom sort column by fixed strings, then by field's content

2014-02-03 Thread Susan Cassidy
I have a column that contains items like 'absolute root' 'root 3' 'root 4' 'root 5' 'scene 1' 'scene 2' 'scene 3' and I would like them to sort in that order. I tried: select sti.description, sc.description from scene_thing_instances sti join scenes sc on sti.scene_id = sc.scene_id order by CAS

Re: [GENERAL] Drop all overloads of a function without knowing parameter types

2014-02-03 Thread Tom Lane
Evan Martin writes: > Is there any easy way to drop a function (all overloads of it) without > knowing the parameter types? Something along the lines of do $$ declare fname text; begin for fname in select oid::regprocedure from pg_proc where proname = 'foo' loop execute 'drop function ' || fn

[GENERAL] Drop all overloads of a function without knowing parameter types

2014-02-03 Thread Evan Martin
Hi All, Is there any easy way to drop a function (all overloads of it) without knowing the parameter types? If not, it would be good to see it added. When I change a function definition I just want to run the SQL script that defines it and have any existing function replaced. CREATE OR REPLA

Re: [GENERAL] need of a lateral join with record set returning function?

2014-02-03 Thread David Johnston
Raphael Bauduin wrote > Hi, > > I'm trying to understand what happens here: > > I have atype product defined: > > [...] > > which I'm trying to use in this query calling json_populate_recordset > > =# select q.* from (select json_populate_recordset(null::product, > event->'products') from eve

[GENERAL] need of a lateral join with record set returning function?

2014-02-03 Thread Raphael Bauduin
Hi, I'm trying to understand what happens here: I have atype product defined: =# \d product Composite type "public.product" Column | Type | Modifiers -+--+--- price_advantage | double precision | type| integer

[GENERAL] Q: How to use indexer api smartly

2014-02-03 Thread amihay gonen
My goal is to implement a new index type base on bitmap index algorithm. I've to main problems : 1. How to get "Target list" - list of columns need to be returned from query on the index. I want to implement index only access , today the indexer api get row-id and then PG retrive the data fro

Re: [GENERAL] 9.3.2 server creates hundreds of thousands of temporary files

2014-02-03 Thread Tom Lane
Florian Weimer writes: > It's still quite surprising that this temporarily needs multiple > gigabytes of RAM, much more than what's required in in terms of work_mem > to make this query run quickly. I doubt there's anything all that interesting there, but if you want people to investigate this

Re: [GENERAL] In a moment of madness I destroyed...

2014-02-03 Thread Luca Ferrari
On Mon, Feb 3, 2014 at 1:33 AM, Jerry Levan wrote: > Would a text pg_dumpall from the mac be portable to the 9.3.x version on the > PAE kerneled > fedora box? > Of course. > I guess I could then possibly use the dblink stuff to suck the tables over > one at a time... Well, if data is still t

Re: [GENERAL] 9.3.2 server creates hundreds of thousands of temporary files

2014-02-03 Thread Florian Weimer
On 01/22/2014 06:56 PM, Tom Lane wrote: Florian Weimer writes: I've got a query which causes PostgreSQL to create hundreds of thousands of temporary files, many of them empty. The process also needs a lot of memory. I suspect this is due to bookkeeping for those files. The query looks like

Re: [GENERAL] postgres FDW cost estimation options unrecognized in 9.3-beta1

2014-02-03 Thread Rajni Baliyan
Hi All, Is there any way to automate the archive deletion process. Any script or command in HA setup using pgpool Thanks in advance Best Regards, *Rajni Baliyan | Database - Consultant* *ASHNIK PTE. LTD.*101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533 M : +65 83858518 T: +65 6438 3

Re: [GENERAL] Large objects and savepoints - Snapshot reference leak

2014-02-03 Thread Andreas Lubensky
Thanks Alvaro, that is good to know. At the moment we are stuck with version 9.1.9 and have to stay there at least for Linux. But do I understand correctly, that the warning can be ignored for the moment? On Fri, 2014-01-31 at 15:15 -0300, Alvaro Herrera wrote: > Andreas Lubensky wrote: > > Hi, >