Re: [GENERAL] Restoring selected records from backup file

2012-03-02 Thread Adrian Klaver
On Friday, March 02, 2012 2:20:14 am Piyush Lenka wrote: > hi, > > 1. How can we restore selected records from a plain text backup > (backup.sql). The only way I know is to use some text processing tool to walk through and pull out the records. > 2. Is it possible using psql. If yes how I ass

Re: [GENERAL] role missing in dump

2012-03-02 Thread Adrian Klaver
On Friday, March 02, 2012 2:39:22 pm Thomas Prause wrote: > Hi, > when upgrading from 8.4 to 9.1 (Ubuntu 10.10 to 11.10) I did face some > problems (probably due to a non standard data directory. But I don't > care about that. Finally I decided to use the dump to recreate this very > small database

[GENERAL] role missing in dump

2012-03-02 Thread Thomas Prause
Hi, when upgrading from 8.4 to 9.1 (Ubuntu 10.10 to 11.10) I did face some problems (probably due to a non standard data directory. But I don't care about that. Finally I decided to use the dump to recreate this very small database. When starting the application that uses the db I realized th

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Philip Couling Sent: Friday, March 02, 2012 4:47 PM To: david.sahag...@emc.com Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] || versus concat( ), diff behavior On

[GENERAL] Restoring selected records from backup file

2012-03-02 Thread Piyush Lenka
hi, 1. How can we restore selected records from a plain text backup (backup.sql). 2. Is it possible using psql. If yes how Please Help Thanks & Regards Piyush

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread Philip Couling
On 02/03/12 20:58, david.sahag...@emc.com wrote: Can anybody please point me to where this "difference of behavior" is explained/documented ? Thanks, -dvs- -- version = 9.1.3 do $$ declare v_str char(10); begin v_str := 'abc' ; raise info '%', concat(v_str, v_str) ; raise info '%',

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread Ben Chobot
On Mar 2, 2012, at 12:58 PM, wrote: > Can anybody please point me to where this "difference of behavior" is > explained/documented ? > Thanks, > -dvs- > > -- version = 9.1.3 > do $$ > declare > v_str char(10); > begin > v_str := 'abc' ; > raise info '%', concat(v_str, v_str) ; > raise info

[GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread david.sahagian
Can anybody please point me to where this "difference of behavior" is explained/documented ? Thanks, -dvs- -- version = 9.1.3 do $$ declare v_str char(10); begin v_str := 'abc' ; raise info '%', concat(v_str, v_str) ; raise info '%', v_str||v_str ; end $$; INFO: abc abc INFO: ab

Re: [GENERAL] concatenating text and bytea

2012-03-02 Thread Tom Lane
Vincent de Phily writes: > I got recently bitten by this : > # select 'ascii'::text || E'\\xdeadbeef'::bytea, pg_typeof('ascii'::text || > '\xdeadbeef'::bytea), 'ascii'::bytea || E'\\xdeadbeef'::bytea; > ?column? | pg_typeof | ?column? > -+---+---

[GENERAL] concatenating text and bytea

2012-03-02 Thread Vincent de Phily
Hi, I got recently bitten by this : # select 'ascii'::text || E'\\xdeadbeef'::bytea, pg_typeof('ascii'::text || '\xdeadbeef'::bytea), 'ascii'::bytea || E'\\xdeadbeef'::bytea; ?column? | pg_typeof | ?column? -+---+-- ascii\xdeadbee

Re: [GENERAL] Opposite function of hstore each function

2012-03-02 Thread ChoonSoo Park
It works! Thank you, Choon Park On Fri, Mar 2, 2012 at 12:19 PM, Bosco Rama wrote: > ChoonSoo Park wrote: > > Each function returns key/value pairs from hstore type. > > Is there any opposite function that returns hstore type from key/value > rows? > > > > I know hstore (text[], text[]) can con

Re: [GENERAL] Opposite function of hstore each function

2012-03-02 Thread Bosco Rama
ChoonSoo Park wrote: > Each function returns key/value pairs from hstore type. > Is there any opposite function that returns hstore type from key/value rows? > > I know hstore (text[], text[]) can construct it. Is there any other choice? > > I have a table with ID & Description columns and want t

[GENERAL] Opposite function of hstore each function

2012-03-02 Thread ChoonSoo Park
Each function returns key/value pairs from hstore type. Is there any opposite function that returns hstore type from key/value rows? I know hstore (text[], text[]) can construct it. Is there any other choice? I have a table with ID & Description columns and want to return hstore type (ID1=>Desc1

Re: [GENERAL] what Linux to run

2012-03-02 Thread Volodymyr Kostyrko
Ivan Voras wrote: On 28/02/2012 17:57, mgo...@isstrucksoftware.net wrote: Our application runs on Windows, however we have been told that we can pick any OS to run our server on. I'm thinking Linux because from everything I've read, it appears to be a better on performance and there are other f

Re: [GENERAL] archive_cleanup_command recovery.conf Standby server error

2012-03-02 Thread Adrian Klaver
On Friday, March 02, 2012 12:28:48 am chinnaobi wrote: > 1. I tried with below command in recovery.conf with the exe pointing to the > location where it is present. > Result: > > 2012-02-29 19:56:49 MYT WARNING: archive_cleanup_command ""D:\Program > Files (x86)\PostgreSQL\9.1\data\pg_archiveclea

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tyler Durden
http://explain.depesz.com/s/f92O *EXPLAIN ANALYSE VERBOSE SELECT "activity_action"."id", "activity_action"."actor_id", "activity_action"."verb", "activity_action"."action_content_type_id", "activity_action"."action_object_id", "activity_action"."target_content_type_id", "activity_action"."target_o

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
On 2 Březen 2012, 14:34, Tyler Durden wrote: > On Fri, Mar 2, 2012 at 12:55 PM, Tomas Vondra wrote: > >> On 2 Březen 2012, 13:45, Tyler Durden wrote: >> >> >> > Yes, but if I remove *U0."user_id" = 1 *will use the index: >> >> Which PostgreSQL version is that? Post EXPLAIN ANALYZE output for all >

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tyler Durden
On Fri, Mar 2, 2012 at 12:55 PM, Tomas Vondra wrote: > On 2 Březen 2012, 13:45, Tyler Durden wrote: > >> > > Yes, but if I remove *U0."user_id" = 1 *will use the index: > > Which PostgreSQL version is that? Post EXPLAIN ANALYZE output for all > three queries, not just EXPLAIN. And use explain.dep

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
On 2 Březen 2012, 13:45, Tyler Durden wrote: >> > Yes, but if I remove *U0."user_id" = 1 *will use the index: Which PostgreSQL version is that? Post EXPLAIN ANALYZE output for all three queries, not just EXPLAIN. And use explain.depesz.com if possible, it's much more readable. kind regards Tomas

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tyler Durden
Hi, On Fri, Mar 2, 2012 at 12:23 PM, Tomas Vondra wrote: > Hi, > > On 2 Březen 2012, 13:12, Tyler Durden wrote: > > Hi, > > I can't figure out why query planner doesn't use the proper index, anyone > > can help me? > > > > This query properly uses indexes: > > > > mydb=# EXPLAIN SELECT U0."objec

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
Hi, On 2 Březen 2012, 13:12, Tyler Durden wrote: > Hi, > I can't figure out why query planner doesn't use the proper index, anyone > can help me? > > This query properly uses indexes: > > mydb=# EXPLAIN SELECT U0."object_id" FROM "activity_follow" U0 WHERE > (U0."content_type_id" = 3 AND U0."user_

[GENERAL] Problems with non use of indexes

2012-03-02 Thread Tyler Durden
Hi, I can't figure out why query planner doesn't use the proper index, anyone can help me? This query properly uses indexes: mydb=# EXPLAIN SELECT U0."object_id" FROM "activity_follow" U0 WHERE (U0."content_type_id" = 3 AND U0."user_id" = 1); QUERY PLAN --

Re: [GENERAL] Yearly date comparison?

2012-03-02 Thread Vincent Veyron
Le mardi 28 février 2012 à 20:14 -0800, Nick a écrit : > What is the best way to find an event with a yearly occurrence? > > > start_date DATE, > end_date DATE, > recurring TEXT > ); Hi Nick, Your problem seems similar to that of managing subscriptions? If you can do anything about

Re: [GENERAL] Quoted strings on CLI

2012-03-02 Thread Alexander Reichstadt
Thanks a lot, I use the '' approach, works for my case. Regards Am 02.03.2012 um 10:14 schrieb Pavel Stehule: > Hello > > you cannot use a \ escaping when you have standard_conforming_strings enabled. > > There are four ways: > > first - use a usual way for using quotes - use a doubling sin

Re: [GENERAL] Quoted strings on CLI

2012-03-02 Thread Pavel Stehule
Hello you cannot use a \ escaping when you have standard_conforming_strings enabled. There are four ways: first - use a usual way for using quotes - use a doubling single quotes postgres=# select 'Peter''s toy'; ?column? ─ Peter's toy (1 row) or you can use a own string delimite

[GENERAL] Quoted strings on CLI

2012-03-02 Thread Alexander Reichstadt
Hi, I just migrated from mysql and am running into an issue I found no solution for when researching. Using the web interface I can insert values that contain single-quotes. But using the CLI I found no way to select or insert single quotes: PetWork=# select * from persons where firstname='\'P

Re: [GENERAL] archive_cleanup_command recovery.conf Standby server error

2012-03-02 Thread chinnaobi
1. I tried with below command in recovery.conf with the exe pointing to the location where it is present. Result: 2012-02-29 19:56:49 MYT WARNING: archive_cleanup_command ""D:\Program Files (x86)\PostgreSQL\9.1\data\pg_archivecleanup.exe" -d \\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1 '