Re: [GENERAL] [ADMIN] Issue in save and retreive file in postgres

2012-06-23 Thread Craig Ringer
On 06/23/2012 02:48 PM, Vishwas Dwivedi wrote: I am using postgreSQL 9.1. My problem is when I retrieve pdf file data from postgreSQL and create a pdf file in temp folder of my application. The file gets created but not able to open it, shows some error. One more thing that in my code I am co

[GENERAL] row_to_json question

2012-06-23 Thread Joe Van Dyk
How can I use row_to_json for a subset of columns in a row? (without creating a new view or using a CTE?) What I want returned: {"email_address":"j...@tanga.com","username":"joevandyk"} Note that there is no "id" column in the result. create table users (id serial primary key, email_address varc

Re: [GENERAL] row_to_json question

2012-06-23 Thread Joe Van Dyk
On Sat, Jun 23, 2012 at 3:03 PM, Joe Van Dyk wrote: > How can I use row_to_json for a subset of columns in a row? (without > creating a new view or using a CTE?) > > What I want returned: > {"email_address":"j...@tanga.com","username":"joevandyk"} > Note that there is no "id" column in the result.

Re: [GENERAL] efficiency of wildcards at both ends

2012-06-23 Thread Jasen Betts
On 2012-06-20, Sam Z J wrote: > --0016e6d999db24c4c704c2ea7a97 > Content-Type: text/plain; charset=ISO-8859-1 > > Hi all > > I'm curious how is wildcards at both ends implemented, e.g. LIKE '%str%' > How efficient is it if that's the only search criteria against a large > table? how much does inde

Re: [GENERAL] Extensions and roles for access administration

2012-06-23 Thread Jasen Betts
On 2012-06-22, Виктор Егоров wrote: > --001636eeeb987f3f6204c31480e9 > Content-Type: text/plain; charset=UTF-8 > > Thanks, this clarifies things for me. > > There's DROP ROLE IF EXISTS, which I'm using. > that seems kind of pointless, as, if the role exists and owns anything it's going to fail.

Re: [GENERAL] Feature discussion: Should syntax errors abort a transaction?

2012-06-23 Thread Jasen Betts
On 2012-06-19, Rafal Pietrak wrote: > And we are talking about interractive psql breaking transaction because > of syntax error - almost always this is a one time typo. I'd prefere it > to be a bit more "sloopy", then deployed SQL application (e.g. > non-interactive session). possibly you could

Re: [GENERAL] error handling

2012-06-23 Thread Jasen Betts
On 2012-06-20, Little, Douglas wrote: > --_000_8585BA53443004458E0BAA6134C5A7FBADD4CD8CEGEXCMB01owwroo_ > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > Hello, > > Greenplum 4.1.2.4 (PG 8.2.3) > We are revising how we implement functions in order to

Re: [GENERAL] row_to_json question

2012-06-23 Thread Raghavendra
Also try: https://bitbucket.org/adunstan/json_91 --Raghav On Sun, Jun 24, 2012 at 3:45 AM, Joe Van Dyk wrote: > On Sat, Jun 23, 2012 at 3:03 PM, Joe Van Dyk wrote: > > How can I use row_to_json for a subset of columns in a row? (without > > creating a new view or using a CTE?) > > > > What I

Re: [GENERAL] Error message "psql: could not connect to server: No such file or directory"

2012-06-23 Thread Craig Ringer
On 06/22/2012 03:19 PM, Stefan Schwarzer wrote: sudo su - _postgres /usr/local/pgsql-9.1/bin/initdb -U postgres -D /usr/local/pgsql-9.1/data --encoding=UTF8 --locale=en_US sudo su - _postgres /usr/local/pgsql-9.1/bin/pg_ctl start -D /usr/local/pgsql-9.1/data Although I don't get an error messa

[GENERAL] Hot standby streaming replication doesn't work

2012-06-23 Thread Tim Uckun
I am following the instructions on the wiki https://wiki.postgresql.org/wiki/Binary_Replication_Tutorial#PITR.2C_Warm_Standby.2C_Hot_Standby.2C_and_Streaming_Replication using the "10 minute" version of the setup. On the master I have postgresql.conf wal_level = hot_standby max_wal_senders = 3 c