[GENERAL] system command in dblink?

2011-06-14 Thread AI Rumman
Is it possible to execute system commands in dblink connections? I need to execute \i /tmp/test.sh in a remote connection from my psql client prompt. I connected with the remote db using dblink_connect. select dblink_connect('conn_1', 'dbname=newdb'); Any help please.

Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

2011-06-14 Thread Vikram A
Dear Ringer, My application work in a LAN. It will not with across internet. Number users also less than 25. Only certain information to be cipher. Also I do not want such a complicated public and private key as PGP defines. As you said, I would like to go for simple[Symmetric] method with our

Re: [GENERAL] determine client os

2011-06-14 Thread Sim Zacks
On 06/14/2011 08:19 AM, Tom Lane wrote: Sim Zackss...@compulab.co.il writes: All the suggestions given are for the server OS :-( My purpose is to be able to return a correct file path to the client without it specifying the OS. File path? Seems to me that even if you knew the client OS,

[GENERAL] No implicit index created when adding primary key with ALTER TABLE

2011-06-14 Thread Stefan Keller
Hi I observed some strange behaviour when adding a primary key with ALTER TABLE: Given CREATE TABLE mytable1 (id serial, name text); I filled it with data then did a CREATE TABLE mytable2 AS SELECT * FROM mytable1; ALTER TABLE mytable2 ADD PRIMARY KEY(id); The last command reports - as

Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

2011-06-14 Thread Alban Hertroys
On 14 Jun 2011, at 5:51, Vikram A wrote: Dear Mr. Craig Ringer, Thank you for your response. I would like to crypt certain sensitive information in my applications such as Student register number, their marks, results etc. For this reason i done a study for doing encryption. Where I found

Re: [GENERAL] determine client os

2011-06-14 Thread Alban Hertroys
On 14 Jun 2011, at 8:35, Sim Zacks wrote: It is much simpler then that. My data includes file references. One table has the filename with a path placeholder and another table contains the windows and linux versions of the full path. This is for an intranet and we _always_ have the same

Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

2011-06-14 Thread Craig Ringer
On 14/06/11 14:29, Vikram A wrote: My application work in a LAN. It will not with across internet. Number users also less than 25. Only certain information to be cipher. Also I do not want such a complicated public and private key as PGP defines. As you said, I would like to go for simple[

Re: [GENERAL] determine client os

2011-06-14 Thread Craig Ringer
On 14/06/11 14:35, Sim Zacks wrote: It is much simpler then that. My data includes file references. One table has the filename with a path placeholder and another table contains the windows and linux versions of the full path. This is for an intranet and we _always_ have the same drive

[GENERAL] how to install plpython?

2011-06-14 Thread AI Rumman
Hi guys, I need to install plpython language in my db. testdb=# create language plpythonu; ERROR: could not access file $libdir/plpython: No such file or directory -bash-3.2$ pwd /usr/pgsql-9.0/lib -bash-3.2$ ls pl* plpgsql.so testdb=# select * from pg_pltemplate; tmplname | tmpltrusted |

[GENERAL] thoughts on interactive query

2011-06-14 Thread Sim Zacks
I am playing around with making interactive queries and was wondering if anyone had any comments. If your comment is That is a stupid idea, please try to qualify that with something constructive as well. The idea is that sometimes during a process, user input is required. The way we have

Re: [GENERAL] No implicit index created when adding primary key with ALTER TABLE

2011-06-14 Thread Thom Brown
On 14 June 2011 06:39, Stefan Keller sfkel...@gmail.com wrote: Hi I observed some strange behaviour when adding a primary key with ALTER TABLE: Given CREATE TABLE mytable1 (id serial, name text); I filled it with data then did a  CREATE TABLE mytable2 AS SELECT * FROM mytable1;  ALTER

Re: [GENERAL] determine client os

2011-06-14 Thread Karsten Hilbert
On Tue, Jun 14, 2011 at 09:35:52AM +0300, Sim Zacks wrote: Sim Zackss...@compulab.co.il writes: All the suggestions given are for the server OS :-( My purpose is to be able to return a correct file path to the client without it specifying the OS. File path? Seems to me that even if you

Re: [GENERAL] how to install plpython?

2011-06-14 Thread Craig Ringer
On 14/06/11 15:33, AI Rumman wrote: Hi guys, I need to install plpython language in my db. How did you install Pg? See: http://wiki.postgresql.org/wiki/Guide_to_reporting_problems -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] HOW TO install or use pageinspect

2011-06-14 Thread F. BROUARD / SQLpro
Hi there, I have a 9.1 PG Server on Windows XP The pageinspect.dll is in C:\Program Files\PostgreSQL\9.1\lib I am postgresql user in the database (names DB_TEST). But I cannot use the functions like SELECT * FROM heap_page_items(get_raw_page('aTable', 0)) They does not appear in the postgreSQL

[GENERAL] Proposition fetch cursors

2011-06-14 Thread Radosław Smogura
Hello, I have proposition about one missing feature for cursors. Actually there is no support for fetching some data from cursor without moving it (in context of external applications). This could be nice if driver could fetch e.g. 100 rows, buffer it internally and then move cursor at

[GENERAL] duplicate key violate error

2011-06-14 Thread AI Rumman
Hi, I got duplicate key violate error in the db log for the following query: INSERT INTO tab1 ( SELECT '1611576', '1187865' WHERE NOT EXISTS ( SELECT 1 FROM tab1 WHERE id='1611576' AND id2='1187865')) The error occured during production time. But when I manually executed the

Re: [GENERAL] HOW TO install or use pageinspect

2011-06-14 Thread Guillaume Lelarge
Hi, On Tue, 2011-06-14 at 10:06 +0200, F. BROUARD / SQLpro wrote: [...] I have a 9.1 PG Server on Windows XP The pageinspect.dll is in C:\Program Files\PostgreSQL\9.1\lib I am postgresql user in the database (names DB_TEST). But I cannot use the functions like SELECT * FROM

Re: [GENERAL] HOW TO install or use pageinspect

2011-06-14 Thread F. BROUARD / SQLpro
Hi Gleu, OK I run : CREATE EXTENSION pageinspect And it works. Thanks Le 14/06/2011 10:32, Guillaume Lelarge a écrit : Hi, On Tue, 2011-06-14 at 10:06 +0200, F. BROUARD / SQLpro wrote: [...] I have a 9.1 PG Server on Windows XP The pageinspect.dll is in C:\Program

Re: [GENERAL] how to install plpython?

2011-06-14 Thread AI Rumman
Okay. Thanks for the guidance. Could you please tell where I can get the postgresql-python lib files? On Tue, Jun 14, 2011 at 2:01 PM, Craig Ringer cr...@postnewspapers.com.auwrote: On 14/06/11 15:33, AI Rumman wrote: Hi guys, I need to install plpython language in my db. How did you

Re: [GENERAL] how to install plpython?

2011-06-14 Thread Sim Zacks
What OS/distribution are you using? If you compiled postgresql your self did you include python support? Sim On 06/14/2011 12:17 PM, AI Rumman wrote: Okay. Thanks for the guidance. Could you please tell where I can get the postgresql-python lib files? On Tue, Jun 14, 2011 at 2:01 PM, Craig

Re: [GENERAL] determine client os

2011-06-14 Thread Sim Zacks
On 06/14/2011 10:29 AM, Craig Ringer wrote: On 14/06/11 14:35, Sim Zacks wrote: It is much simpler then that. My data includes file references. One table has the filename with a path placeholder and another table contains the windows and linux versions of the full path. This is for an

[GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. -- Mark

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Karsten Hilbert
On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE. Karsten -- GPG key ID E4071346 @ gpg-keyserver.de E167 67FD A291 2BEA 73BD

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread John R Pierce
On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment doesn't support even a transaction? -- john r pierce

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE. Thanks for that. How can I do /this/ select

Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

2011-06-14 Thread Vick Khera
On Mon, Jun 13, 2011 at 11:51 PM, Vikram A vikkiatb...@yahoo.in wrote: I would like to crypt certain sensitive information in my applications such as Student register number, their marks, results etc. For this reason i done a study for doing encryption. Where I found that this PGP will help

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-14 Thread Hanno Schlichting
On Mon, Jun 13, 2011 at 3:27 AM, Merlin Moncure mmonc...@gmail.com wrote: I would not even consider tweaking the internal block sizes until you've determined there is a problem you expect you might solve by doing so. It's not a problem as such, but managing data chunks of 2000 bytes + the

Re: [GENERAL] duplicate key violate error

2011-06-14 Thread Albe Laurenz
AI Rumman wrote: I got duplicate key violate error in the db log for the following query: INSERT INTO tab1 ( SELECT '1611576', '1187865' WHERE NOT EXISTS ( SELECT 1 FROM tab1 WHERE id='1611576' AND id2='1187865')) The error occured during production time. But when I manually executed

Re: [GENERAL] Proposition fetch cursors

2011-06-14 Thread Craig Ringer
On 06/14/2011 04:30 PM, Radosław Smogura wrote: Hello, I have proposition about one missing feature for cursors. Actually there is no support for fetching some data from cursor without moving it (in context of external applications). This could be nice if driver could fetch e.g. 100 rows,

Re: [GENERAL] how to install plpython?

2011-06-14 Thread Craig Ringer
On 06/14/2011 05:17 PM, AI Rumman wrote: Okay. Thanks for the guidance. Could you please tell where I can get the postgresql-python lib files? Did you *read* the guidance in question? You didn't even bother to answer the one simple question I asked. How do you expect help if you don't supply

Re: [GENERAL] configure error... please help 9.0.4

2011-06-14 Thread akp geek
Thanks all for the responses. $./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl --with-libxml --with-openssl --with-ossp-uuid LDFLAGS=-L/opt/postgres/gis/lib --with-includes=/opt/postgres/software/include/readline/ *I bypassed the uuid error. Now getting this .. I have

Re: [GENERAL] determine client os

2011-06-14 Thread Craig Ringer
On 06/14/2011 05:54 PM, Sim Zacks wrote: I have a system settings table which defines mount points. I have a directories table which defines the relative path (from the mount point) for each type of document. OK, so your clients already have all the information they need to assemble the

Re: [GENERAL] Proposition fetch cursors

2011-06-14 Thread Radosław Smogura
On Tue, 14 Jun 2011 20:49:48 +0800, Craig Ringer wrote: On 06/14/2011 04:30 PM, Radosław Smogura wrote: Hello, I have proposition about one missing feature for cursors. Actually there is no support for fetching some data from cursor without moving it (in context of external applications).

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 6:48 AM, Hanno Schlichting ha...@hannosch.eu wrote: On Mon, Jun 13, 2011 at 3:27 AM, Merlin Moncure mmonc...@gmail.com wrote: I would not even consider tweaking the internal block sizes until you've determined there is a problem you expect you might solve by doing so.

Re: [GENERAL] configure error... please help 9.0.4

2011-06-14 Thread Adrian Klaver
On Tuesday, June 14, 2011 5:51:59 am akp geek wrote: Thanks all for the responses. $./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl --with-libxml --with-openssl --with-ossp-uuid LDFLAGS=-L/opt/postgres/gis/lib --with-includes=/opt/postgres/software/include/readline/

Re: [GENERAL] how to install plpython?

2011-06-14 Thread Adrian Klaver
On Tuesday, June 14, 2011 2:17:32 am AI Rumman wrote: Okay. Thanks for the guidance. Could you please tell where I can get the postgresql-python lib files? The short answer is it depends, hence Craigs request for information on how it was installed. The various packages handle it in

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Tom Lane
John R Pierce pie...@hogranch.com writes: On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment doesn't support

[GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread Erwin Moller
Hi, I was surprised by the following behavior of Postgres (8.1). Consider the following table and constraint: = CREATE TABLE tblissue( issueid SERIAL PRIMARY KEY, title TEXT, comment TEXT, createtimestamp TIMESTAMP DEFAULT (current_timestamp),

Re: [GENERAL] duplicate key violate error

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 3:30 AM, AI Rumman rumman...@gmail.com wrote: Hi, I got duplicate key violate error in the db log for the following query: INSERT INTO tab1 ( SELECT '1611576', '1187865' WHERE NOT EXISTS ( SELECT 1 FROM tab1         WHERE id='1611576' AND id2='1187865'    )    ) The

Re: [GENERAL] thoughts on interactive query

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 2:39 AM, Sim Zacks s...@compulab.co.il wrote: I am playing around with making interactive queries and was wondering if anyone had any comments. If your comment is That is a stupid idea, please try to qualify that with something constructive as well. The idea is that

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread Tom Lane
Erwin Moller erwinmol...@xs4all.nl writes: Then: delete from tblissue where issueid=1; DELETE 1 Postgresql now deletes all rows that had a 1 for parentissueid. (5 in my testcase). That was correct, and as I intended, but why does Postgres answer DELETE 1 instead of DELETE 6? It's

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Steve Crawford
On 06/14/2011 05:13 AM, Mark Morgan Lloyd wrote: Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE.

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Tom Lane wrote: John R Pierce pie...@hogranch.com writes: On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread er...@darwine.nl
On 6/14/2011 5:05 PM, Tom Lane wrote: Erwin Mollererwinmol...@xs4all.nl writes: Then: delete from tblissue where issueid=1; DELETE 1 Postgresql now deletes all rows that had a 1 for parentissueid. (5 in my testcase). That was correct, and as I intended, but why does Postgres answer DELETE 1

[GENERAL] Executing \i of psql command using libpq library

2011-06-14 Thread Edmundo Robles L.
Hi! How can i get the same behavior of psql -c \\i './a_lot_of_sentences' bd user, using the libpq library??? i tried Pqexec(pgconn,\\i './a_lot_of_sentences') but didn't work. :( -- SENSA Control Digital. Ing. Edmundo Robles Lopez. Analista Programador. -- Sent via pgsql-general

Re: [GENERAL] Executing \i of psql command using libpq library

2011-06-14 Thread Tom Lane
Edmundo Robles L. erob...@sensacd.com.mx writes: How can i get the same behavior of psql -c \\i './a_lot_of_sentences' bd user, using the libpq library??? libpq does not contain any such behavior, so you can't. regards, tom lane -- Sent via pgsql-general mailing list

Re: [GENERAL] system command in dblink?

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 1:17 AM, AI Rumman rumman...@gmail.com wrote: Is it possible to execute system commands in dblink connections? I need to execute \i /tmp/test.sh in a remote connection from my psql client prompt. I connected with the remote db using dblink_connect. select

[GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread BangarRaju Vadapalli
Hi Everybody, We are using PostGRE 8.4 version and experiencing random backend crashes. We have enabled logging and are able to see some logging happening in pg_log directory but not of much use. Here are the logs. 2011-06-14 18:06:04 IST WARNING: terminating connection because of

Re: [GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 9:26 AM, BangarRaju Vadapalli bangarraju.vadapa...@infor.com wrote: Hi Everybody,   We are using PostGRE 8.4 version and experiencing random backend crashes. We have enabled logging and are able to see some logging happening in pg_log directory but not of much

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Steve Crawford wrote: On 06/14/2011 05:13 AM, Mark Morgan Lloyd wrote: Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread David Johnston
alter table tblissue add constraint tblissue_parentissueid_fkey_casc_del FOREIGN KEY (parentissueid) REFERENCES tblissue(issueid) ON DELETE CASCADE; = Then: delete from tblissue where issueid=1; DELETE 1 Postgresql now deletes all rows that

[GENERAL] Functional dependencies

2011-06-14 Thread Alpha Beta
Hi list, (newbie with databases) I was looking out in net about how can we determine or find all functional dependencies in a relational database, but didn't find. So can please anyone here tell me if functional dependecies for each table of a relational database can be found explicitly or we

Re: [GENERAL] Functional dependencies

2011-06-14 Thread Darren Duncan
Alpha Beta wrote: Hi list, (newbie with databases) I was looking out in net about how can we determine or find all functional dependencies in a relational database, but didn't find. So can please anyone here tell me if functional dependecies for each table of a relational database can be

[GENERAL] trouble building user defined agg function with plpython

2011-06-14 Thread Rick Harding
I'm trying to test out a user defined aggregation function. The problem I'm getting is that the state is never passed to the function after the first call. I'm wondering if this is an issue with having my function defined as a pypython function or something. Each call I get an UnboundLocalError

Re: [GENERAL] system command in dblink?

2011-06-14 Thread mike stanton
dblink_connect. select dblink_connect('conn_1', 'dbname=newdb'); Any help please. __ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 6208 (20110614) __ ESET NOD32 Antivirus ha comprobado este mensaje. http://www.eset.com

Re: [GENERAL] trouble building user defined agg function with plpython

2011-06-14 Thread Tom Lane
Rick Harding rhard...@mitechie.com writes: CREATE OR REPLACE FUNCTION mysum(curr integer, vals group_data) RETURNS integer AS $$ try: curr = curr + vals['weight'] except UnboundLocalError: plpy.notice(UNBOUND) curr = 0 return curr $$ LANGUAGE

Re: [GENERAL] No implicit index created when adding primary key with ALTER TABLE

2011-06-14 Thread Stefan Keller
Hi Thom 2011/6/14 Thom Brown t...@linux.com: Shouldn't you be looking for mytable2_pkey? Yes; but that was my typo. I tried it several times on two tables. My explanation is that the message (saying that an index was implicitly created) is simply wrong. Yours, S. -- Sent via pgsql-general

Re: [GENERAL] No implicit index created when adding primary key with ALTER TABLE

2011-06-14 Thread Tom Lane
Stefan Keller sfkel...@gmail.com writes: My explanation is that the message (saying that an index was implicitly created) is simply wrong. The correct explanation is that you're misinterpreting whatever output you're looking at. Every unique or pkey constraint has an underlying index --- the

Re: [GENERAL] No implicit index created when adding primary key with ALTER TABLE

2011-06-14 Thread Adrian Klaver
On Tuesday, June 14, 2011 3:31:12 pm Stefan Keller wrote: Hi Thom 2011/6/14 Thom Brown t...@linux.com: Shouldn't you be looking for mytable2_pkey? Yes; but that was my typo. I tried it several times on two tables. My explanation is that the message (saying that an index was implicitly

Re: [GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread Craig Ringer
On 06/14/2011 10:26 PM, BangarRaju Vadapalli wrote: Hi Everybody, We are using PostGRE 8.4 version and experiencing random backend crashes. We have enabled logging and are able to see some logging happening in pg_log directory but not of much use. Here are the logs. Thankyou for collecting

Re: [GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread Craig Ringer
On 15/06/2011 7:50 AM, Craig Ringer wrote: There's no reason it can't be compiled for PostgreSQL 8.4, though I never tested that. It shouldn't take long so I'll give it a go and get back to you. Okies. I've built a version for 8.4. You can download it (32-bit only) from:

Re: [GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread Craig Ringer
On 15/06/2011 7:50 AM, Craig Ringer wrote: I searched online and found crash dump handler idea has been proposed and patch for that has already been released if I am not wrong. It is integrated into PostgreSQL 9.0 as a core part of the server. Correction - it's in 9.1 not 9.0 . Whoops, I

[GENERAL] LPI-Japan to start PostgreSQL certfication

2011-06-14 Thread Tatsuo Ishii
Hi, LPI-Japan, a non-profit distributor of LPIC(Linux Professional Institute Certification) in Japan will start OSS-DB exam from July 1st, 2011. LPI-Japan is known as one of the largest distributor of LPIC in the world(according to LPI-Japan they have distributed 164k LPIC so far).

Re: [GENERAL] Why security-definer functions are executable by public by default?

2011-06-14 Thread Bruce Momjian
Tom Lane wrote: hubert depesz lubaczewski dep...@depesz.com writes: was pointed to the fact that security definer functions have the same default privileges as normal functions in the same language - i.e. if the language is trusted - public has the right to execute them. maybe i'm

Re: [GENERAL] Executing \i of psql command using libpq library

2011-06-14 Thread Josh Kupershmidt
On Tue, Jun 14, 2011 at 11:51 AM, Tom Lane t...@sss.pgh.pa.us wrote: Edmundo Robles L. erob...@sensacd.com.mx writes: How can i get the same behavior of psql -c \\i './a_lot_of_sentences' bd user, using the libpq library??? libpq does not contain any such behavior, so you can't. You can

[GENERAL] Cursors

2011-06-14 Thread Andy Chambers
Hi, What happens to cursors when new data is added to a table after you start iterating over its rows? For example, given the following loop... for rule in select tc.sid, tc.s, td.rule, td.returns from tcell tc inner join tcelldef td on (tc.p = td.p)