Re: [GENERAL] Trying to install ODBC driver on Windows XP notebook

2010-06-22 Thread Gerd Koenig
Hi Phil,


On Tuesday, June 22, 2010 10:19:33 pm Phil Jackson wrote:
 I have latest Postgresql installed on a notebook and now trying to
 install the driver which I have downloaded and run so that it is now
 available in the ODBC Data Source Administrator
 
 This machine has CA security suite, latest version installed and I have
 added a network rule that allows all applications using TCP and UDP on
 Port 4532 to gain access In and Out

Do you really have opened port 4532, or is it a typo ? (should be 5432, of 
course ;-) ).
 
 I have the correct database name and get the following message when I
 try to Test the connection.
 
 Could not connect to the server
 No Connection could be made because the target machine actively refused it.
 (192.168.1.7:5432)

Does your postmaster listen on this address ?
Check your postgresql.conf for parameter listen_addresses
What's the error message in detail ?

regaradsGERD.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Hot Standby switchover

2010-06-22 Thread Shoaib Mir
Hi All,

Just been trying to learn hot-standby and couldn't figure out a solution to
something like this while doing a switchover:

I have three nodes where

A = Master
B = Slave1
C = Slave2

Now Hot-Standby is setup like this...

A -- B
A -- C

Now if I will like to do a switch so as to make B the new master and have my
replication look like this:

B -- C
B -- A

Where are the steps I need for doing so?

Thanks,
-- 
Shoaib Mir
http://shoaibmir.wordpress.com/


Re: [GENERAL] Problem Using RowType Declaration with Table Domains

2010-06-22 Thread Tom Lane
George Weaver gwea...@shaw.ca writes:
 I have the following (very simplified) scenario:

 CREATE DOMAIN orderstatus AS text NOT NULL DEFAULT 'Open';

 CREATE TABLE orders ( orderno serial
  , status orderstatus
  , PRIMARY KEY (orderno));

 CREATE OR REPLACE FUNCTION getOrder(int4)
 RETURNS
 orders
 AS
 $$DECLARE
 orderno_in alias for $1;
 saleorder orders%rowtype;
 ...
 test1=# select * from getorder(3);
 ERROR:  domain orderstatus does not allow null values
 CONTEXT:  PL/pgSQL function getorder line 4 during statement block local 
 variable initialization

 Is there a way around this?

I think you've just hit one of the many reasons why declaring domains
with NOT NULL constraints is a bad idea.  If you are utterly wedded to
doing that, you can assign an initial value to the saleorder variable
that sets saleorder.status to a valid non-null value.  But be prepared
for more pain in the future, and more pain after that.  (Hint: what do
you expect a LEFT JOIN to the orders table to produce?)  NOT NULL domain
constraints may perhaps not have been the SQL committee's worst idea
ever, but they're definitely in the top ten.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] How to flatten a database table

2010-06-22 Thread mai fawzy
Hi All,

I have a table that has the following fields:

   IDMoney  Date   State
   1   20 2010-01-01   done
   2   10 2010-01-02done
   3
   .
   .
   .
   .
   n


I need to select the values from this table to join them 2 another select
statement but the problem that I need to flatten this table first.
 I need the returned values to be as one row. how can this be implemented??


Thanks a lot,
Mai


Re: [GENERAL] High Availability with Postgres

2010-06-22 Thread Devrim GÜNDÜZ
On Mon, 2010-06-21 at 23:08 -0400, Greg Smith wrote:
 
 The hard part of shared storage failover is always solving the shoot 
 the other node in the head problem, to keep a down node from coming 
 back once it's no longer the active one.  In order to do that well,
 you really need to lock the now unavailable node from accessing the
 storage at the hardware level--fencing--with disabling its storage
 port being one way to handle that.  Figure out how you're going to do
 that reliably in a way that's integrated into a proper cluster
 manager, and there's no reason you can't do this with PostgreSQL. 

FWIW, I know a prod instances that has 4 PostgreSQL servers (on 4
different hardware, I mean) running on Red Hat Cluster Suite, and it has
been running more than 2 years w/o any issues. The only issues were
related to RHCS+HP hardware, but as of RHEL 5.5, all issues are
resolved.
-- 
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz


signature.asc
Description: This is a digitally signed message part


Re: [GENERAL] How to flatten a database table

2010-06-22 Thread Thomas Kellerer

mai fawzy, 22.06.2010 10:38:

I have a table that has the following fields:

IDMoney  Date   State
1   20 2010-01-01   done
2   10 2010-01-02done

I need to select the values from this table to join them 2 another
select statement but the problem that I need to flatten this table first.




I need the returned values to be as one row.


Based on which condition?



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] What type of index should I use?

2010-06-22 Thread Dimitri Fontaine
Mike Christensen m...@kitchenpc.com writes:

 I have a varying(200) text column that I need to be able to do lookups
 on very fast (WHERE col = 'foo')

Btree is what to use here. GIN covers cases where you index arrays.

   I estimate the table will hold around 5,000 rows, never any more.

It could be that you're better off without any index, depending on the
size of rows you put in there, and the overall memory usage patterns you
have.

Regards,
-- 
dim

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] High Availability with Postgres

2010-06-22 Thread Dimitri Fontaine
John R Pierce pie...@hogranch.com writes:
 failure modes can
 include things like failing fans (which will be detected, resulting in a
 server shutdown if too many fail), power supply failure (redundant PSUs, but
 I've seen the power combining circuitry fail).   Any of these sorts of
 failures will result in a failover without corrupting the data.

 and of course, intentional planned failovers to do OS maintenance...  you
 patch the standby system, fail over to it and verify its good, then patch
 the other system.

Ah, I see the use case much better now, thank you. And I begin too see
how expensive reaching such a goal is, too. Going from I can lose this
many transactions to No data lost, ever is at that price, though.

Regards,
-- 
dim

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Hot Standby switchover

2010-06-22 Thread Dimitri Fontaine
Hi,

Shoaib Mir shoaib...@gmail.com writes:
 Now Hot-Standby is setup like this...

 A -- B 
 A -- C

 Now if I will like to do a switch so as to make B the new master and have my 
 replication look like this:

 B -- C 
 B -- A

 Where are the steps I need for doing so?

First, you need a common archive somewhere all the 3 servers can read
it, and you need to setup the restore_command so that you can use it.

Now, you can change the primary_conninfo on C so that it connects to
B. I guess that means a restart. Note that you only want to do that once
server B is the new master, so has been triggered as such. That means a
change of TimeLine, though, so it'll break streaming : that's when you
need to read the WALs from the archive, with the restore_command.

Then, to have the old master A a slave of the new master B, you need to
do a full slave setup here, with base backup and all.

I hope we will be able to get cascading support in 9.1 or before so that
it's possible to simplify all this by having a relay server in the
mix, so that you only talk to this one when changing the master. 

Of course enabling the old master as a slave would still need a full
setup from scratch. There has been thoughts on how to bypass the base
backup there on -hackers, rather promising, but I don't know of any work
having been done yet. Guys are getting 9.0 out the door for now :)

Regards,
-- 
dim

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] How to force select to return exactly one row

2010-06-22 Thread Andrus

Martin,


Also I too am confused by empty row. Are you trying to loop through the
results in code and it fails if there are no rows at all?

Or some other equally odd thing? =)

Anyway here is an example UNION that I think would work (but note, this row
will always be included even when your statement returns something, so it
might not work for you).
(YOUR SELECT HERE)
UNION

(SELECT '','',1,1,perfectly_matched_datatype_cols_here); --those first
couple are just examples

Mind you, I think this is nasty and would highly suggest taking another
look at the code that is using this statement to see if you can deal more
gracefully with an empty resultset.


Returned row is used to enter report parameters, search conditions etc. in
dialog forms where exactly one row should be
present always.
Code is simpler if it can assume that single row is always returned: in this
case it can generate only update statement.
Otherwize separate branch should check for insert or update clause. This
makes app code complicated.

I changed appl code to:

1. Execute original select statement.
2. If it returns no rows, add one row:

insert into ko (primarykey) ('primarykeyvalue');

3. Re-execute original select statement.

This requires 3 database calls from application and two times to execute
query.

How to implement this using single db call and execute query only once ?

if it possible to use

CREATE TEMP TABLE temp AS
 original_select ON COMMIT DROP;

IF (SELECT COUNT(*) FROM temp) =0 THEN
 INSERT INTO temp DEFAULT_VALUES;
 ENDIF;

SELECT * FROM temp;

Andrus.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pgpool

2010-06-22 Thread Geoffrey

A couple of questions regarding pgpool:

Is there a problem with using multiple connection pools for the same 
database?  Point being, we might want to give a higher number of 
connections to one group of users then another.  I can see doing this by 
having separate connection pools.  The higher priority users have a 
larger connection pool.


Is there a problem with using connection pooling and traditional 
connections to connect to the same database?


--
Until later, Geoffrey

I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them.
- Thomas Jefferson

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] High Availability with Postgres

2010-06-22 Thread Greg Smith

John R Pierce wrote:
I don't like power cycling servers, so I'd prefer not to use power 
switch based fencing, although I believe my blade box's management 
unit is supported as a power fencing device.


I consider power control fencing to be a secondary resort if you don't 
have hardware where a storage switch fence can be used.  It can be a 
useful implementation for those situations, and not all shared storage 
is attached with a FC switch.


--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
g...@2ndquadrant.com   www.2ndQuadrant.us


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-22 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


 Is there any technical obstacle to anyone creating PL/PHP? I am 
 cruious as to why it doesn't alreay exist.

Obviously we need to improve our documentation. What led you to 
believe it does not exist? As pointed out downthread, it does 
exist (if not maintained).

 I mean, I love my Tcl support, and I know this is part of PG's 
 legacy... but Tcl and no PHP? I figure there's a tech reason for 
 this - the demand must be there! No? 

No, I'd say the demand is most definitely not there. I support a 
great number of clients, and pretty much everyone uses pl/pgsql, 
a great many use pl/perl, and a handful use pl/tcl or pl/python 
or pl/ruby. Nobody uses pl/php.

Some major strikes against it (consider these todo items for 
those who would like to see pl/php live again):

* No trusted/untrusted versions
* Not in core
* Not even in contrib or pgfoundry or github
* It seems to suffer from a lot of configuration issues
* Hard to find:
** First google hit on pl/php is projects.commandprompt.com/public/plphp
** Which simply says: Go here instead: https://redmine.commandprompt.com/
** Which stops you with a login and password page
* The documentation is a mess (dead URLs, mislabelled sections)
* PHP is not as stable, mature, secure, or well designed as Perl/Tcl/Python.
  Which makes Postgres people less likely to consider it.
* They chose backslash '\' as their namespace delimiter. Backslash!

Okay, that last one isn't a major strike, but it's damn annoying (and 
indicative of the poor design of the language :)

- -- 
Greg Sabino Mullane g...@turnstep.com
PGP Key: 0x14964AC8 201006220936
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAkwgv9MACgkQvJuQZxSWSsgULQCfUB7AtsvETYJAI7okRdCvSh3D
d6AAnA+GfxpeUqGrXw0CMhB8mWNH0wSF
=xLp+
-END PGP SIGNATURE-



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] How to force select to return exactly one row

2010-06-22 Thread Dean Rasheed
2010/6/21 Andrus kobrule...@hot.ee:
 if there is no searched primary key row in ko database, select should also
 return empty row.

 To get this result I added right join:

 SELECT somecolumns
 FROM ko
 RIGHT JOIN (SELECT 1) _forceonerow ON true
 LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey
 ...
 LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey
 WHERE ko.primarykey is null or ko.primarykey='someprimarykeyvalue';


The reason this won't return a row if there is no matching PK is that
the WHERE clause is applied after all the joins to filter the overall
result set.

So to get what you want, you would need to re-arrange that to something like:

SELECT original_query.* FROM
( Original query including WHERE clause ) AS original_query
RIGHT JOIN (SELECT 1) AS one_row ON true;

Regards,
Dean

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Trying to install ODBC driver on Windows XP notebook

2010-06-22 Thread Garry Saddington

Phil Jackson wrote:
I have latest Postgresql installed on a notebook and now trying to 
install the driver which I have downloaded and run so that it is now 
available in the ODBC Data Source Administrator


This machine has CA security suite, latest version installed and I have 
added a network rule that allows all applications using TCP and UDP on 
Port 4532 to gain access In and Out


Is port *4532* above a typo?


No Connection could be made because the target machine actively refused it.
(192.168.1.7:5432)


Regards
Garry


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Hot Standby switchover

2010-06-22 Thread Shoaib Mir
On Tue, Jun 22, 2010 at 7:08 PM, Dimitri Fontaine dfonta...@hi-media.comwrote:

 Now, you can change the primary_conninfo on C so that it connects to
 B. I guess that means a restart. Note that you only want to do that once
 server B is the new master, so has been triggered as such. That means a
 change of TimeLine, though, so it'll break streaming : that's when you
 need to read the WALs from the archive, with the restore_command.


So does that mean we don't have to build C from scratch like we will be
doing for A? Is that because B and C were both slaves and reading from the
same archive directory and at same point in time when we did the switchover.



 Then, to have the old master A a slave of the new master B, you need to
 do a full slave setup here, with base backup and all.


This is what I expected but just wanted to confirm. Thanks a lot for the
detailed explanation on all steps.


 I hope we will be able to get cascading support in 9.1 or before so that
 it's possible to simplify all this by having a relay server in the
 mix, so that you only talk to this one when changing the master.


It will be just awesome to have such support as cascading at times is really
helpful. But again comparing to other third party solutions it seems just
very simple to setup for replication and sure does work nice. I cant wait
for 9.1 already :)

Regards,
-- 
Shoaib Mir
http://shoaibmir.wordpress.com/


Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-22 Thread Brett Mc Bride
There's this one: https://www.commandprompt.com/community/plphp/

-Original Message-
From: pgsql-general-ow...@postgresql.org 
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Carlo Stonebanks
Sent: Tuesday, 22 June 2010 1:29 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] No PL/PHP ? Any reason?

Is there any technical obstacle to anyone creating PL/PHP? I am cruious as 
to why it doesn't alreay exist. I mean, I love my Tcl support, and I know 
this is part of PG's legacy... but Tcl and no PHP? I figure there's a tech 
reason for this - the demand must be there! No? 


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] How to Insert and retrieve multilingual (Hindi an Indian language) into PostgreSQL

2010-06-22 Thread venkat
Dear All,


  I want to insert and retrieve multilingual (Hindi) into database.is
PostgreSQL supports
that ?if it is ... please guide me how to enable multilingual in the table.


I am waiting for your great response.

Thanks and Regards,

Venkat


Re: [GENERAL] What type of index should I use?

2010-06-22 Thread Adrian von Bidder
On Tuesday 22 June 2010 10.49:00 Dimitri Fontaine wrote:
I estimate the table will hold around 5,000 rows, never any more.
 
 It could be that you're better off without any index, depending on the
 size of rows you put in there, and the overall memory usage patterns you
 have.

I agree: don't overstimate the effect an index can have and don't 
underestimate the cost of index updates.

Have you tested performance as it is?  Spending time to tune that doesn't 
need tuning is an interesting hobby, but probably nothing more :-)

cheers
-- vbi


-- 
Today is Pungenday, the 27th day of Confusion in the YOLD 3176


signature.asc
Description: This is a digitally signed message part.


Re: [GENERAL] How to Insert and retrieve multilingual (Hindi an Indian language) into PostgreSQL

2010-06-22 Thread Thom Brown
On 22 June 2010 11:48, venkat ven.tammin...@gmail.com wrote:
 Dear All,

   I want to insert and retrieve multilingual (Hindi) into
 database.is PostgreSQL supports that ?if it is ... please guide me how to
 enable multilingual in the table.

     I am waiting for your great response.
 Thanks and Regards,
 Venkat

Do you just mean storing Devanagari text or storing multiple languages
alongside one another?  If the former, I think you'll just need to set
the database encoding to UTF8.

If it's the latter, this may be useful to you:

http://rwec.co.uk/blog/2009/11/atomic-translations-part-1/
http://rwec.co.uk/blog/2009/12/atomic-translations-part-2/

Regards

Thom

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Re: [SQL] How to Insert and retrieve multilingual (Hindi an Indian language) into PostgreSQL

2010-06-22 Thread Pavel Stehule
Hello

 PostgreSQL doesn't support multilangual tables now - etc it isn't
more than one collation per database. But you can store any langual
text when this language is supported by UTF8. Just use UTF8 encoding
for your database.

Regards
Pavel Stehule

see help for initdb and createdb commands




2010/6/22 venkat ven.tammin...@gmail.com:
 Dear All,

   I want to insert and retrieve multilingual (Hindi) into
 database.is PostgreSQL supports that ?if it is ... please guide me how to
 enable multilingual in the table.

     I am waiting for your great response.
 Thanks and Regards,
 Venkat

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Re: How to Insert and retrieve multilingual (Hindi an Indian language) into PostgreSQL

2010-06-22 Thread Stephane Bortzmeyer
On Tue, Jun 22, 2010 at 04:18:48PM +0530,
 venkat ven.tammin...@gmail.com wrote 
 a message of 39 lines which said:

 I want to insert and retrieve multilingual (Hindi) into database.is
 PostgreSQL supports that ?

[Currently, I'm storing arabic texts in a PostgreSQL database.
http://www.afnic.fr/actu/nouvelles/251/the-tunisian-internet-agency-selects-solutions-from-afnic-to-operate-its-x062a-x0648-x0646-x0633-idn-cctld]

Actually, PostgreSQL does not know about languages (except for
services like full-text search): it stores text, period. For a long
time, PostgreSQL was able to store texts in various encodings. The
recommended one is UTF-8, which allows you to store the whole Unicode
character set.

% createdb --encoding=UTF-8 venkat

% psql venkat
venkat= CREATE TABLE Misc (id SERIAL, content TEXT);
NOTICE:  CREATE TABLE will create implicit sequence misc_id_seq for serial 
column misc.id
CREATE TABLE
venkat= INSERT INTO Misc (content) VALUES ('Texte en français');
INSERT 0 1


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-22 Thread Alvaro Herrera
Excerpts from Greg Sabino Mullane's message of mar jun 22 13:51:35 UTC 2010:

  I mean, I love my Tcl support, and I know this is part of PG's 
  legacy... but Tcl and no PHP? I figure there's a tech reason for 
  this - the demand must be there! No? 
 
 No, I'd say the demand is most definitely not there. I support a 
 great number of clients, and pretty much everyone uses pl/pgsql, 
 a great many use pl/perl, and a handful use pl/tcl or pl/python 
 or pl/ruby. Nobody uses pl/php.

Hey, Robert Treat uses it -- he even gives talks about it, I hear!

 Some major strikes against it (consider these todo items for 
 those who would like to see pl/php live again):
 
 * No trusted/untrusted versions

Not true, actually.

 * Not in core

Yeah.  It has been proposed and shot down several times by -core and
others.  The reason given is that you'd have to build PHP twice (or
something like that) -- there's a configure chicken-and-egg problem, or
something.  It is a fairly bad reason, but it's what we got.

 * Not even in contrib or pgfoundry or github

pgfoundry is such a paradise, yes, I'm sure everyone agrees.  As for
github, I don't think it existed back when PL/php started.  It's
currently hosted in Command Prompt's Redmine site.

Maybe we should have a pgfoundry web-only site that directed the
prospective user to the Redmine site ...

 * The documentation is a mess (dead URLs, mislabelled sections)

No surprise :-(  I hasn't been touched since moving from Trac.

 * PHP is not as stable, mature, secure, or well designed as Perl/Tcl/Python.
   Which makes Postgres people less likely to consider it.

Absolutely true.

-- 
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-22 Thread Joshua D. Drake
On Tue, 2010-06-22 at 13:51 +, Greg Sabino Mullane wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: RIPEMD160
 
 
  Is there any technical obstacle to anyone creating PL/PHP? I am 
  cruious as to why it doesn't alreay exist.
 
 Obviously we need to improve our documentation. What led you to 
 believe it does not exist? As pointed out downthread, it does 
 exist (if not maintained).

It is maintained. We address items as they come in. Is it currently
being developed for new features? No.

 
  I mean, I love my Tcl support, and I know this is part of PG's 
  legacy... but Tcl and no PHP? I figure there's a tech reason for 
  this - the demand must be there! No? 
 
 No, I'd say the demand is most definitely not there. I support a 
 great number of clients, and pretty much everyone uses pl/pgsql, 
 a great many use pl/perl, and a handful use pl/tcl or pl/python 
 or pl/ruby. Nobody uses pl/php.

People do use it but it certainly doesn't have the usage of pl/python or
pl/perl.

 
 Some major strikes against it (consider these todo items for 
 those who would like to see pl/php live again):
 
 * No trusted/untrusted versions

This is false. There are both.

 * Not in core

True. Check the archives there were long discussions as to why it won't
work. Basically the build path of PHP isn't really compatible with the
build path of PostgreSQL.

 * Not even in contrib or pgfoundry or github

No. No reason to be.

 * It seems to suffer from a lot of configuration issues
 * Hard to find:
 ** First google hit on pl/php is projects.commandprompt.com/public/plphp
 ** Which simply says: Go here instead: https://redmine.commandprompt.com/

No it doesn't (but I am not sure when this was fixed).

 * The documentation is a mess (dead URLs, mislabelled sections)

Yeah we probably need to update it from the migration from Trac.

 * PHP is not as stable, mature, secure, or well designed as Perl/Tcl/Python.

No it is just more popular, more widely used and has a larger community.

(Oh: And remember, I am a python guy)

Joshua D. Drake



-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
Consulting, Training, Support, Custom Development, Engineering


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] A thought about other open source projects

2010-06-22 Thread Chris Browne
bnich...@ca.afilias.info (Brad Nicholson) writes:
 Scott Marlowe wrote:
 As with phrases like, the quickest way to grill a unicorn steak,
 that it can be stated in a few words does not make in possible.

 Exactly.  The big issue here is that nobody's saying what kind of app
 they want to write.

 Or what sort of performance requirements are tied to that app.

And that's only one form of quality of service, too.

- Sometimes you need fast...

- Mighty frequently, fast enough is good enough.

- Sometimes you need excruciating correctness (to the point of needing
  2PC!).

- Sometimes you need to not need to respond to all errors.  (e.g. - in
  an embedded application, there may never be a way for an
  administrator to get at instances of the system - consider an
  appliance like a router)

- Very frequently, making sure the system isn't too fragile is an
  important aspect of QoS.  [1]

- I've really liked the recent comments about the philosophy behind
  NoSQL, where it is suggested to be postmodern in the sense that:

- SQL traditionally has been about storing facts of some solidity, 
  and, in contrast...

- The postmodernist approach to philosophy, and, to a great extent,
  NoSQL systems involves an acceptance of:
  - The absence of objective truth
  - Queries return opinions, not facts

  In effect, this involves a more-or-less philosophical shift that is,
  all the same, an expression of quality of service.

- The vigorously expressed unfriendliness of the MythTV folk is somewhat
  curious, and I'm not quite sure how to classify it.  I don't think it's
  any of the above.

[1]  http://www.databasejournal.com/features/db2/article.php/3888026

[2]  http://www.xaprb.com/blog/2010/06/12/postmodern-databases/
-- 
select 'cbbrowne' || '@' || 'cbbrowne.com';
http://cbbrowne.com/info/internet.html
MS  apparently now  has a  team dedicated  to tracking  problems with
Linux  and publicizing them.   I guess  eventually they'll  figure out
this back fires... ;) -- William Burrow aa...@delete.fan.nb.ca

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-22 Thread Deven

Hi all,

I am using Postgresql Database for our system storage and I am running
Autovacuuming Deamon on my entire database. But on of the table set in my
database never undergoes the Autovacuuming. I always need to do the manual
vacuuming on that table.

Can anyone kindly tell me the solution for the same problem.Do I need to do
any configurations to come out of this problem?

Waiting for reply...

Thanks and Regards,
Devendra Mule.
Covacsis Technologies Pvt. Ltd.
IIT, Mumbai.
-- 
View this message in context: 
http://old.nabble.com/Facing-Problem-in-Autovacuuming-Deamon-tp28959155p28959155.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-22 Thread Scott Marlowe
On Tue, Jun 22, 2010 at 5:50 AM, Deven deven...@covacsis.com wrote:

 Hi all,

 I am using Postgresql Database for our system storage and I am running
 Autovacuuming Deamon on my entire database. But on of the table set in my
 database never undergoes the Autovacuuming. I always need to do the manual
 vacuuming on that table.

The autovacuum daemon has thresholds for when it should vacuum a
table.  Is it possible your table just doesn't have enough updates to
make autovacuum kick in?

What version pgsql are you running?  What are your autovacuum_*
settings?  What does pg_stat_user_tables have to say about last
vacuum, autovacuum, n_dead_tup, etc?

 Can anyone kindly tell me the solution for the same problem.Do I need to do
 any configurations to come out of this problem?

Normally autovac should just fire off a thread when needed

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] libpython - cannot open shared object file

2010-06-22 Thread Tom Wilcox

Hi,

Can anyone help me get up and running on Ubuntu 64-bit Server (lucid) OS 
with PostgreSQL 64-bit and Python 2.6?


(Please note that this is all running in a VirtualBox VM however I am 
not convinced that is relevant here)


I have a load of functions written in plpythonu and I can't run anything 
until they are able to run. Please help.. I have been through set up 
using the Ubuntu Software Manager (postgresql, postgresql-8.4, plpython 
for postgresql-8.4,..), I have tried using sudo apt-get install 
postgresql-8.4, I have downloaded and installed using the 64-bit linux 
binary from postgresql.com.


In all cases, I have started the server from su postgres in bash.. it 
happily runs and pgadmin3 can connect.  I successfully create my 
plpythonu and pgsql functions then I attempt to use them in a simple 
SELECT statement (see below) and the resulting error occurs:


--

DROP LANGUAGE IF EXISTS plpythonu CASCADE;
CREATE LANGUAGE plpythonu;

CREATE OR REPLACE FUNCTION min_float(a float, b float) RETURNS float AS $$
return min(a,b);
$$ LANGUAGE plpythonu;

SELECT min_float(1,2);

--

ERROR:  could not load library 
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: libpython2.3.so.1.0: 
cannot open shared object file: No such file or directory




I don't know enough to know where to start with this..

I have python2.6 installed. The following find command results:

r...@ubuntu64-bertha:/opt/PostgreSQL/8.4/lib# find /* -name libpython*
find: '/media/windows-share/System Volume Information': Operation not 
permitted

/opt/PostgreSQL/8.4/lib/postgresql/libpython2.6.so.1
/usr/lib/gnome-vfs-2.0/modules/libpythonmethod.so
/usr/lib/gnome-vfs-2.0/modules/libpythonmethod-2.6.so 
http://libpythonmethod-2.6.so

/usr/lib/python2.6/config/libpython2.6.so http://libpython2.6.so
/usr/lib/libpython2.6.so.1
/usr/lib/libpython2.6.so.1.0
/usr/lib/gedit-2/plugin-loaders/libpythonloader.so
/usr/share/doc/libpython2.6
/usr/share/lintian/overrides/libpython2.6
/var/lib/dpkg/info/libpython2.6.symbols
/var/lib/dpkg/info/libpython2.6.shlibs
/var/lib/dpkg/info/libpython2.6.md5sums
/var/lib/dpkg/info/libpython2.6.postrm
/var/lib/dpkg/info/libpython2.6.postinst
/var/lib/dpkg/info/libpython2.6.list

I tried creating a symbolic link that points to the libpython2.6 like so:

r...@ubuntu64-bertha:/opt/PostgreSQL/8.4/lib# ln -s 
./postgresql/libpython2.6.so.1 libpython2.3.so.1.0


but then it gave me this error instead:

ERROR: could not load library 
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: 
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: undefined symbol: 
Py_InitModule4

SQL state: 58P01

So I presume it was expecting a different python version..(I have now 
removed that symbolic link so I am back to my original error).


I am losing this battle badly and I am desperately running out of time. 
Please can anyone help me or suggest anything I can try to sort this out 
and get plpython running my functions in postgresql on this linux OS.


Please help me!

Tom

On 16/06/2010 15:02, Tom Wilcox wrote:

Interesting:

This works:

postg...@ubuntu64-bertha:~$ createlang -d cse plpythonu
Password:
postg...@ubuntu64-bertha:~$

But this doesn't:

postg...@ubuntu64-bertha:~$ psql -c CREATE LANGUAGE plpythonu
Password:
ERROR:  could not load library 
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: libpython2.3.so.1.0: 
cannot open shared object file: No such file or directory


Any suggestions? Feels like I'm not with the correct env vars in psql 
but TBH Im getting somewhat dazed and confused from staring at this 
too long..


T


On 16 June 2010 14:58, Tom Wilcox hungry...@gmail.com 
mailto:hungry...@gmail.com wrote:


Hi,

I have got PostgreSQL 8.4 up and running on my Ubuntu Server
64-bit OS, but I am having difficulty with the PL/Python functions
from my database. In particular, I am running this:

---
drop language plpythonu cascade;
create language plpythonu;

-- Utility
CREATE OR REPLACE FUNCTION min_float(a float, b float) RETURNS
float AS $$
return min(a,b);
$$ LANGUAGE plpythonu;

SELECT min_float(1,2);

---

And receiving this error message:

---
NOTICE:  drop cascades to function min_float(double
precision,double precision)


ERROR:  could not load library
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so:
libpython2.3.so.1.0: cannot open shared object file: No such file
or directory

** Error **

ERROR: could not load library
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so:
libpython2.3.so.1.0: cannot open shared object file: No such file
or directory
SQL state: 58P01
---

The strange thing is that I have successfully created plpythonu
language and 

Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-22 Thread Alvaro Herrera
Excerpts from Joshua D. Drake's message of mar jun 22 12:16:11 -0400 2010:
 On Tue, 2010-06-22 at 13:51 +, Greg Sabino Mullane wrote:

  * Hard to find:
  ** First google hit on pl/php is projects.commandprompt.com/public/plphp
  ** Which simply says: Go here instead: https://redmine.commandprompt.com/
 
 No it doesn't (but I am not sure when this was fixed).

I fixed it when I saw Greg's note.

-- 
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] libpython - cannot open shared object file

2010-06-22 Thread Adrian Klaver

On 06/22/2010 09:52 AM, Tom Wilcox wrote:

Hi,

Can anyone help me get up and running on Ubuntu 64-bit Server (lucid) OS
with PostgreSQL 64-bit and Python 2.6?

(Please note that this is all running in a VirtualBox VM however I am
not convinced that is relevant here)

I have a load of functions written in plpythonu and I can't run anything
until they are able to run. Please help.. I have been through set up
using the Ubuntu Software Manager (postgresql, postgresql-8.4, plpython
for postgresql-8.4,..), I have tried using sudo apt-get install
postgresql-8.4, I have downloaded and installed using the 64-bit linux
binary from postgresql.com.

In all cases, I have started the server from su postgres in bash.. it
happily runs and pgadmin3 can connect. I successfully create my
plpythonu and pgsql functions then I attempt to use them in a simple
SELECT statement (see below) and the resulting error occurs:

--

DROP LANGUAGE IF EXISTS plpythonu CASCADE;
CREATE LANGUAGE plpythonu;

CREATE OR REPLACE FUNCTION min_float(a float, b float) RETURNS float AS $$
return min(a,b);
$$ LANGUAGE plpythonu;

SELECT min_float(1,2);

--

ERROR: could not load library
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: libpython2.3.so.1.0:
cannot open shared object file: No such file or directory



I don't know enough to know where to start with this..

I have python2.6 installed. The following find command results:

r...@ubuntu64-bertha:/opt/PostgreSQL/8.4/lib# find /* -name libpython*
find: '/media/windows-share/System Volume Information': Operation not
permitted
/opt/PostgreSQL/8.4/lib/postgresql/libpython2.6.so.1
/usr/lib/gnome-vfs-2.0/modules/libpythonmethod.so
/usr/lib/gnome-vfs-2.0/modules/libpythonmethod-2.6.so
http://libpythonmethod-2.6.so
/usr/lib/python2.6/config/libpython2.6.so http://libpython2.6.so
/usr/lib/libpython2.6.so.1
/usr/lib/libpython2.6.so.1.0
/usr/lib/gedit-2/plugin-loaders/libpythonloader.so
/usr/share/doc/libpython2.6
/usr/share/lintian/overrides/libpython2.6
/var/lib/dpkg/info/libpython2.6.symbols
/var/lib/dpkg/info/libpython2.6.shlibs
/var/lib/dpkg/info/libpython2.6.md5sums
/var/lib/dpkg/info/libpython2.6.postrm
/var/lib/dpkg/info/libpython2.6.postinst
/var/lib/dpkg/info/libpython2.6.list

I tried creating a symbolic link that points to the libpython2.6 like so:

r...@ubuntu64-bertha:/opt/PostgreSQL/8.4/lib# ln -s
./postgresql/libpython2.6.so.1 libpython2.3.so.1.0

but then it gave me this error instead:

ERROR: could not load library
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so:
/opt/PostgreSQL/8.4/lib/postgresql/plpython.so: undefined symbol:
Py_InitModule4
SQL state: 58P01

So I presume it was expecting a different python version..(I have now
removed that symbolic link so I am back to my original error).

I am losing this battle badly and I am desperately running out of time.
Please can anyone help me or suggest anything I can try to sort this out
and get plpython running my functions in postgresql on this linux OS.

Please help me!

Tom



To start narrowing this down.
What installation of Postgres are you running now(you mention several)?
It seems pl/python is compiled against Python 2.3. Have you been running 
Python 2.3?



--
Adrian Klaver
adrian.kla...@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-22 Thread Joao Ferreira
Hello,

On Tue, 2010-06-22 at 04:50 -0700, Deven wrote:
 Hi all,
 
 I am using Postgresql Database for our system storage and I am running
 Autovacuuming Deamon on my entire database. But on of the table set in my
 database never undergoes the Autovacuuming. I always need to do the manual
 vacuuming on that table.

the way autovacuum behaves on each table will depend very much on the
INSERT/UPDATE profile in that specific table

so it's not necessarilly a problem if a given table never gets vacuumed;
may be it does not need;

can you be more specific on 

a) why do you say that that specific table does not get autovacuumed ?
what makes you say that ?
b) is your filesystem experiencing bloat (bloat means: postgres seems to
start eating up disk space like crazy after some days/weeks/months) ? is
it ?
c) do the logs say things regarding max_fsm_pages ?
d) what version of postgres is it ?
e) have a closer look at the autovacuum_* configuration directives...

Cheers
JOao

 
 Can anyone kindly tell me the solution for the same problem.Do I need to do
 any configurations to come out of this problem?
 
 Waiting for reply...
 
 Thanks and Regards,
 Devendra Mule.
 Covacsis Technologies Pvt. Ltd.
 IIT, Mumbai.
 -- 
 View this message in context: 
 http://old.nabble.com/Facing-Problem-in-Autovacuuming-Deamon-tp28959155p28959155.html
 Sent from the PostgreSQL - general mailing list archive at Nabble.com.
 
 


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-22 Thread Joao Ferreira gmail
Hello,

On Tue, 2010-06-22 at 04:50 -0700, Deven wrote:
 Hi all,
 
 I am using Postgresql Database for our system storage and I am running
 Autovacuuming Deamon on my entire database. But on of the table set in
my
 database never undergoes the Autovacuuming. I always need to do the
manual
 vacuuming on that table.

autovacuum can be tricky... the way autovacuum behaves on each table
will depend very much on the INSERT/UPDATE profile in that specific
table

so it's not necessarilly a problem if a given table never gets vacuumed;
may be it does not need;

can you be more specific on 

a) why do you say that that specific table does not get autovacuumed ?
what makes you say that ?

b) is your filesystem experiencing bloat (bloat means: postgres seems to
start eating up disk space like crazy after some days/weeks/months) ? is
it ?

c) do the logs say things regarding max_fsm_pages ?

d) what version of postgres is it ?

e) have a closer look at the autovacuum_* configuration directives...

not an expert here... but these are important topics regarding
autovacuum...

Cheers
Joao

 
 Can anyone kindly tell me the solution for the same problem.Do I need
to do
 any configurations to come out of this problem?
 
 Waiting for reply...



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] what happens to postmaster?

2010-06-22 Thread zach cruise
...when i am importing a table (from oracle, or updating it), and a
user queries that same table?

is it ok to be concerned about corruption etc.

using 8.1.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] what happens to postmaster?

2010-06-22 Thread Dann Corbit
 -Original Message-
 From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
 ow...@postgresql.org] On Behalf Of zach cruise
 Sent: Tuesday, June 22, 2010 11:09 AM
 To: pgsql-general@postgresql.org
 Subject: [GENERAL] what happens to postmaster?
 
 ...when i am importing a table (from oracle, or updating it), and a
 user queries that same table?
 
 is it ok to be concerned about corruption etc.
 
 using 8.1.

This is a relational database.  All those things are handled automatically.  
The whole idea of a multi-user DBMS like PostgreSQL is that you can have 
concurrent access.

PostgreSQL uses MVCC.  Here is an article that explains how it works.  If you 
read it perhaps you will feel more comfortable:
http://en.wikipedia.org/wiki/Multiversion_concurrency_control


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] what happens to postmaster?

2010-06-22 Thread Bill Moran
In response to zach cruise zachc1...@gmail.com:

 ...when i am importing a table (from oracle, or updating it), and a
 user queries that same table?

I depends on a lot of information you haven't provided ... Is the
update inside a transaction?  Have you locked the table?

The real answer is: whatever you want to happen.  Depending on how you
set up the import, you have control over how others can interact with
the table while the import is running.

Some examples:
* Grab an access exclusive lock on the table, nobody else will be able
  to access it until you're done.
* Grab an exclusive lock on the table, others will be able to read, but not
  write to it until you're done.

Some documentation to read up on:
http://www.postgresql.org/docs/8.4/static/explicit-locking.html

 is it ok to be concerned about corruption etc.

You should always be concerned about those things.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] High Availability with Postgres

2010-06-22 Thread John R Pierce

On 06/22/10 1:58 AM, Dimitri Fontaine wrote:

John R Piercepie...@hogranch.com  writes:
   

failure modes can
include things like failing fans (which will be detected, resulting in a
server shutdown if too many fail), power supply failure (redundant PSUs, but
I've seen the power combining circuitry fail).   Any of these sorts of
failures will result in a failover without corrupting the data.

and of course, intentional planned failovers to do OS maintenance...  you
patch the standby system, fail over to it and verify its good, then patch
the other system.
 

Ah, I see the use case much better now, thank you. And I begin too see
how expensive reaching such a goal is, too. Going from I can lose this
many transactions to No data lost, ever is at that price, though.
   


yeah.  generally when money is involved in the transactions, you gotta 
stick to the 'no committed data lost ever'.  there's plenty of other use 
cases for that too.




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] SQL error: could not connect to database

2010-06-22 Thread Juba, Salahaldin I.
I am trying to connect to  database using ECPG  called 'database' - please  see 
the code below-.  When I am excuting the code I am getting this message 

Fatal error
SQL error: could not connect to database database on line 22
Fatal error
SQL error: connection NULL does not exist on line 23
 

How can I make the ECPG access my database. I have already configured my 
database to trust all local connections and I can log in to postgresql without 
password prompt using the psql tool. where did I make a mistake and what are 
the configuration I need to do

I am using libecpg 6 and postgresql 8.4.4

Best,


#include iostream

using namespace  std;

EXEC SQL whenever sqlwarning sqlprint;
EXEC SQL whenever sqlerror do GiveUp();

void GiveUp()
{
fprintf(stderr, Fatal error\n);
sqlprint();
}
int main()
{

EXEC SQL BEGIN DECLARE SECTION;
char id [] = database;
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :id;
EXEC SQL CREATE USER tom WITH PASSWORD 'myPassword';
EXEC SQL DISCONNECT ALL;

return 0;
}

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] how to create an admin user for restore database.

2010-06-22 Thread Sam Wun
Hi,

With PG 8.4, I can't find a documentation to show me how to create a
super user or admin user for the PGSQL.

I have crated a user called liferayadmin and a database liferay.

then executed the following command:

GRANT ALL PRIVILEGES ON DATABASE liferay to liferayadmin;

When I launched pgadmin in windows and login as user liferayadmin,
from the tools menu, the restore command is disabled.
I think the user liferayadmin does not have the privilege to restore database.

How can I enable a user with restore permission?

Your help is very much appreciated

Thanks
Sam

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] libpython - cannot open shared object file

2010-06-22 Thread Tom Lane
Adrian Klaver adrian.kla...@gmail.com writes:
 On 06/22/2010 09:52 AM, Tom Wilcox wrote:
 ERROR: could not load library
 /opt/PostgreSQL/8.4/lib/postgresql/plpython.so: libpython2.3.so.1.0:
 cannot open shared object file: No such file or directory

 I have python2.6 installed.

 It seems pl/python is compiled against Python 2.3. Have you been running 
 Python 2.3?

Yeah.  You need to either install python 2.3, or rebuild postgresql
against python 2.6.  Shortcuts like making symlinks are not likely to
work.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] how to create an admin user for restore database.

2010-06-22 Thread Adrian Klaver
On Tuesday 22 June 2010 6:50:28 pm Sam Wun wrote:
 Hi,

 With PG 8.4, I can't find a documentation to show me how to create a
 super user or admin user for the PGSQL.

 I have crated a user called liferayadmin and a database liferay.

 then executed the following command:

 GRANT ALL PRIVILEGES ON DATABASE liferay to liferayadmin;

 When I launched pgadmin in windows and login as user liferayadmin,
 from the tools menu, the restore command is disabled.
 I think the user liferayadmin does not have the privilege to restore
 database.

 How can I enable a user with restore permission?

 Your help is very much appreciated

 Thanks
 Sam

You do say how you installed Postgres. Generally by the default there is a 
super 
user created with name of postgres. Also generally by default there is a local 
connection set up with an authentication of trust. You should be able to log in 
as postgres and have the necessary permissions.

-- 
Adrian Klaver
adrian.kla...@gmail.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] how to create an admin user for restore database.

2010-06-22 Thread Sam Wun
With user liferayadmin on db liferay, I got the following errors:

03:14:50,558 WARN  [DBUtil:474] ERROR: permission denied for relation
quartz_locks: insert into QUARTZ_LOCKS values('TRIGGER_ACCESS');
03:14:50,567 WARN  [DBUtil:474] ERROR: permission denied for relation
quartz_locks: insert into QUARTZ_LOCKS values('JOB_ACCESS');
03:14:50,582 WARN  [DBUtil:474] ERROR: permission denied for relation
quartz_locks: insert into QUARTZ_LOCKS values('CALENDAR_ACCESS');
03:14:50,593 WARN  [DBUtil:474] ERROR: permission denied for relation
quartz_locks: insert into QUARTZ_LOCKS values('STATE_ACCESS');
03:14:50,608 WARN  [DBUtil:474] ERROR: permission denied for relation
quartz_locks: insert into QUARTZ_LOCKS values('MISFIRE_ACCESS');

...

How can I assigne admin permission to liferayadmin user?

Thanks
sam


On Wed, Jun 23, 2010 at 12:24 PM, Adrian Klaver adrian.kla...@gmail.com wrote:
 On Tuesday 22 June 2010 6:50:28 pm Sam Wun wrote:
 Hi,

 With PG 8.4, I can't find a documentation to show me how to create a
 super user or admin user for the PGSQL.

 I have crated a user called liferayadmin and a database liferay.

 then executed the following command:

 GRANT ALL PRIVILEGES ON DATABASE liferay to liferayadmin;

 When I launched pgadmin in windows and login as user liferayadmin,
 from the tools menu, the restore command is disabled.
 I think the user liferayadmin does not have the privilege to restore
 database.

 How can I enable a user with restore permission?

 Your help is very much appreciated

 Thanks
 Sam

 You do say how you installed Postgres. Generally by the default there is a 
 super
 user created with name of postgres. Also generally by default there is a local
 connection set up with an authentication of trust. You should be able to log 
 in
 as postgres and have the necessary permissions.

 --
 Adrian Klaver
 adrian.kla...@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] java.lang.NegativeArraySizeException from ReceiveTupleV3(PGStream.java:349) ...

2010-06-22 Thread S K
Our application has been in production for a couple of years. Recent
investigation into a problem revealed the following error started a few
months back.  I restarted the application, but the error appears after a few
days and the thread dies.

Any ideas on how to debug this issue is appreciated.

- Ravi

[21/06/2010 13:49:27] WARN org.hibernate.util.JDBCExceptionReporter - SQL
Error: 0, SQLState: null
[21/06/2010 13:49:27] ERROR org.hibernate.util.JDBCExceptionReporter - An
SQLException was provoked by the following failure:
java.lang.NegativeArraySizeException
[21/06/2010 13:49:27] ERROR com.aw.cac.nms.poller.ConfigurationService -
Thread terminated with exception: pool-1-thread-1
org.hibernate.exception.GenericJDBCException: could not execute query
at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2147)
at
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at
org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at
org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
at
com.aw.cac.nms.mgmt.uw.UwDeviceManager.getDevices(UwDeviceManager.java:223)
at
$DeviceManager_1294c519b0c.getDevices($DeviceManager_1294c519b0c.java)
at
$DeviceManager_1294c519b0d.getDevices($DeviceManager_1294c519b0d.java)
at
com.aw.cac.nms.poller.reachability.ConfigurationServiceImpl$ManagedAddressLoader.getAddresses(ConfigurationServiceImpl.java:194)
at
com.aw.cac.nms.poller.reachability.ConfigurationServiceImpl.reload(ConfigurationServiceImpl.java:93)

 at 
com.aw.cac.nms.poller.reachability.ConfigurationServiceImpl$1.run(ConfigurationServiceImpl.java:84)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: An SQLException was provoked by the
following failure: java.lang.NegativeArraySizeException
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
at
com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(NewPooledConnection.java:369)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:93)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1668)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
... 21 more
Caused by: java.lang.NegativeArraySizeException
at org.postgresql.core.PGStream.ReceiveTupleV3(PGStream.java:349)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1306)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
... 26 more


[GENERAL] best way to check pgdump

2010-06-22 Thread Janet Jacobsen
Hi.  What is the best way to check a pgdump
without doing a restore?

Thanks,
Janet


[GENERAL] calling vacuum from a script

2010-06-22 Thread Janet Jacobsen
Hi.  Is it possible to vacuum a table (vacuum full analyze)
from a script.  Currently I run the Postgres client and then
run vacuum, but I'd like to automate the vacuum by calling
it from a (Perl) script.

Thanks,
Janet


Re: [GENERAL] calling vacuum from a script

2010-06-22 Thread David Dick

On 23/06/10 13:44, Janet Jacobsen wrote:

Hi.  Is it possible to vacuum a table (vacuum full analyze)
from a script.  Currently I run the Postgres client and then
run vacuum, but I'd like to automate the vacuum by calling
it from a (Perl) script.


see attached for example.


vacuum.pl
Description: Perl program

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] calling vacuum from a script

2010-06-22 Thread Devrim GÜNDÜZ
On Tue, 2010-06-22 at 20:44 -0700, Janet Jacobsen wrote:
   Is it possible to vacuum a table (vacuum full analyze)
 from a script. 

Use vacuumdb command.

(Why are you using VACUUM FULL? It has been considered harmful, at least
for a regular maintenance job.)
-- 
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz


signature.asc
Description: This is a digitally signed message part


Re: [GENERAL] calling vacuum from a script

2010-06-22 Thread John R Pierce

On 06/22/10 8:44 PM, Janet Jacobsen wrote:

Hi.  Is it possible to vacuum a table (vacuum full analyze)
from a script.  Currently I run the Postgres client and then
run vacuum, but I'd like to automate the vacuum by calling
it from a (Perl) script.


postgres since 8.1 has had autovacuum, autovacuum automatically 
analyzes, too.   You shouldn't need to vacuum in a script.



in answer to your specific question, yes.   perl can connect to postgres 
quite easily, using DBI w/ DBD-PgSQL, then you can just execute a query 
like VACUUM ANALYZE tablename;



If your tables have become badly fragmented, CLUSTER on the most used 
index (usually the primary key) works much better than VACUUM FULL, 
although do note, it uses a global table lock, so you can't be accessing 
the table at the same time.




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general