Re: [GENERAL] Example of a pg_gethostname() function. Feedback?

2011-12-23 Thread Craig Ringer
On 24/12/2011 2:47 AM, bricklen wrote: I had a need recently to get the server hostname of some databases that we were unit-testing and couldn't find a built-in function for it. One of my coworkers put together a C function that seems to work well. Does anyone have any suggestions or improvements

Re: [GENERAL] Initdb fails on openwrt in "creating template1 database"

2011-12-23 Thread Ben Chobot
On Dec 23, 2011, at 1:58 AM, Clemens Eisserer wrote: >>> There are about 800mb free space on /, any idea what could be the problem >>> here? >> >> Could you be running out of file system nodes? > > Don't think so - its a standard ext4 filesystem on a flush drive, > nothing special. > Also I've

[GENERAL] Example of a pg_gethostname() function. Feedback?

2011-12-23 Thread bricklen
I had a need recently to get the server hostname of some databases that we were unit-testing and couldn't find a built-in function for it. One of my coworkers put together a C function that seems to work well. Does anyone have any suggestions or improvements to the code below? Some testing was don

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Peter Eisentraut
On fre, 2011-12-23 at 17:32 +0200, Andrus wrote: > >If you don't want to re-initdb, you could just update the datctype and > >datcollate columns of pg_database for template0. > > Thank you. > where to find sql update statement which does this ? > Is > > update pg_database set datctype ='et_EE.UTF

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Andrus
If you don't want to re-initdb, you could just update the datctype and datcollate columns of pg_database for template0. Thank you. where to find sql update statement which does this ? Is update pg_database set datctype ='et_EE.UTF-8', datcollate ='et_EE.UTF-8' best for this ? template0 is r

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Adrian Klaver
On Friday, December 23, 2011 7:26:08 am Andrus wrote: > >Would seem to be one of two things: > >1) The initdb is being done before the locale is changed. > >or > >2) The installation is overriding the locale, though I find this one less > >possible than 1. > > Thank you. > How to re-configure Post

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Andrus
Would seem to be one of two things: 1) The initdb is being done before the locale is changed. or 2) The installation is overriding the locale, though I find this one less possible than 1. Thank you. How to re-configure Postresql db cluster so that uses Debian default system locale? Andrus.

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Peter Eisentraut
On tor, 2011-12-22 at 18:29 +0200, Andrus wrote: > How to force command > > CREATE DATABASE TEMPLATE = template0 > > to use et_EE.UTF-8 locale by default ? If you don't want to re-initdb, you could just update the datctype and datcollate columns of pg_database for template0. If you want to re

Re: [GENERAL] How to create database with default system locale is set to et_EE.UTF-8

2011-12-23 Thread Adrian Klaver
On Thursday, December 22, 2011 1:22:39 pm Andrus wrote: > > Actually the interesting part would be what locale > > locale > LANG=et_EE.UTF-8 > LC_CTYPE="et_EE.UTF-8" > LC_NUMERIC="et_EE.UTF-8" > LC_TIME="et_EE.UTF-8" > LC_COLLATE="et_EE.UTF-8" > LC_MONETARY="et_EE.UTF-8" > LC_MESSAGES="et_EE.UTF-

Re: [GENERAL] Initdb fails on openwrt in "creating template1 database"

2011-12-23 Thread Tom Lane
Clemens Eisserer writes: > Any idea what could be wrong here? Per-user disk space quota? And I wouldn't be so hasty to dismiss the out-of-inodes theory, either. There are not all that many ways to get an ENOSPC error. regards, tom lane -- Sent via pgsql-general mailing

Re: [GENERAL] Re: Unable to connect to PostgreSQL server : Could not get socket error status

2011-12-23 Thread Adrian Klaver
On Friday, December 23, 2011 1:32:49 am Shankar Palaniappan wrote: > Hi John, > > Thanks for your response. > > I am able to connect to the database through psql command. Please find > the commands that I have tried through PHP and no success for past 3 > days. > Please let me know whether you c

Re: [GENERAL] Initdb fails on openwrt in "creating template1 database"

2011-12-23 Thread Adrian Klaver
On Friday, December 23, 2011 1:58:38 am Clemens Eisserer wrote: > Hi, > Don't think so - its a standard ext4 filesystem on a flush drive, > nothing special. > Also I've added about 128mb of swap space, so that shouldn't be an issue. > > Just tried the same with a 2GB usb drive and got the same re

Re: [GENERAL] Fetch from refcursor and transactions

2011-12-23 Thread Adrian Klaver
On Friday, December 23, 2011 5:13:45 am aasat wrote: > Hi, > > I have question about fetching data from refcursor, why this operation > required to be inside transaction? > > for example > > with transaction > > begin; > select * from foo(); > fetch all from ""; > commit; > > when I try this w

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-23 Thread Pavel Stehule
Hello all just note 9.1 will have a bytea_agg aggregate regards Pavel Stehule 2011/12/2 Marti Raudsepp : > On Fri, Dec 2, 2011 at 16:16, Torsten Zuehlsdorff > wrote: >> But i clearly have a missunderstanding of other chars, like umlauts or utf-8 >> chars. This, for example, should return a 'ö

[GENERAL] postgresql triggers - defining a global resource (java)

2011-12-23 Thread Aman Gupta
The problem statement is mentioned here: http://stackoverflow.com/questions/8615408/postgresql-triggers-defining-a-global-resource-java I am looking for the "best" solution to that problem. Thanks, Aman

[GENERAL] Re: Unable to connect to PostgreSQL server : Could not get socket error status

2011-12-23 Thread Shankar Palaniappan
On Dec 22, 11:12 pm, pie...@hogranch.com (John R Pierce) wrote: > On 12/22/11 1:31 AM, Shankar Palaniappan wrote: > > > I am getting the following error when I try to connect from PHP with > > PostgreSQL server. > > Operating System is HP-UX and I was able to connect through PostgreSQL > > server f

Re: [GENERAL] PostgreSQL DBA in SPAAAAAAAACE

2011-12-23 Thread Gavin Flower
On 21/12/11 04:07, Joe Miller wrote: Thanks so much to everybody who voted. I really can't express my gratitude. I'd love to head to the pub and buy everybody a drink, but I think that might cost more than the flight. Joe On Tue, Dec 20, 2011 at 10:04 AM, Alban Hertroys wrote: On 20 Decembe

[GENERAL] Fetch from refcursor and transactions

2011-12-23 Thread aasat
Hi, I have question about fetching data from refcursor, why this operation required to be inside transaction? for example with transaction begin; select * from foo(); fetch all from ""; commit; when I try this without transaction I get error select * from foo(); fetch all from ""; ERROR:

Re: [GENERAL] Initdb fails on openwrt in "creating template1 database"

2011-12-23 Thread Clemens Eisserer
Hi, >> There are about 800mb free space on /, any idea what could be the problem >> here? > > Could you be running out of file system nodes? Don't think so - its a standard ext4 filesystem on a flush drive, nothing special. Also I've added about 128mb of swap space, so that shouldn't be an issue