Re: [GENERAL] How to create a function with multiple RefCursor OUT parameters

2008-05-16 Thread Albe Laurenz
Please don't top post! Chuck Bai wrote: >>> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT >>> o_user refcursor, OUT o_name refcursor) >>> RETURNS record AS >>> $BODY$ >>> BEGIN >>> tcount := tcount + 1; >>> OPEN o_user FOR SELECT * FROM user_table; >>> OPEN o_n

Re: [GENERAL] Howto return values from a function

2008-05-16 Thread A B
> How you generate the results is up to you. when you have them you > either use RETURN NEXT or RETURN QUERY to return them to the caller. Now I get the reply ERROR: set-valued function called in context that cannot accept a set CONTEXT: PL/pgSQL function "actionlist" line 11 at return next an

Re: [GENERAL] problem with serial data type and access

2008-05-16 Thread Ottavio Campana
Adrian Klaver ha scritto: The fact is that the serial data type is in pratice an integer, and when I also try to connect with pgadminIII I see an integer data type and not a serial. I think that since it sees an integer, it does not understand that it is a serial, and access does not recognize it

[GENERAL] recommended way of separating data from indexes

2008-05-16 Thread Anton Melser
Hi, I looked for quite a while but must have been looking in the wrong place... I have a 6 disk (x146GB) system running Centos 5.1 - RAID 1 (2 disks) and RAID 1+0 (4 disks). This seemed to be the recommended way of doing it but I may have been looking in the wrong place. The system is replicated us

[GENERAL] Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"

2008-05-16 Thread Ivan Sergio Borgonovo
My target is to take a snapshot of a slice of some tables and put the result in a log, regardless of writes made after I started to take the snapshot. something like: create or replace function snapshot(out stats int) as $$ begin -- prepare stuff from t1, t2, t3 -- save it in other tables retur

Re: [GENERAL] PostgreSQL 8.3.x Win32-Releases - always without psqlODBC?

2008-05-16 Thread gorsa
thanks! my earlier installations had problems because stackbuilder could not connect thru my censornet proxy server. connecting my test server to a non-proxied internet connection solved the problem and i downloaded the needed softwares. richard -- Sent via pgsql-general mailing list (pgsql-gene

[GENERAL] psql proxy

2008-05-16 Thread Linsong GUO
I want build a psql proxy which could deal with the connection request from localhost to psql server which on other machine by type in psql -h localhost -U bob network. what function should I use to capture these information in my proxy code. I try to print the buf but there is nothing there afte

Re: [GENERAL] triggers: dynamic references to fields in NEW and OLD?

2008-05-16 Thread Vance Maverick
Thanks, this does work. Unfortunately it requires the trigger function to iterate through all the possible column names explicitly. (I have about 10, and the number might grow in the future.) Vance -Original Message- From: Klint Gore [mailto:[EMAIL PROTECTED] Sent: Thursday, May 15

Re: [GENERAL] Howto return values from a function

2008-05-16 Thread Ian Barwick
2008/5/16 A B <[EMAIL PROTECTED]>: >> How you generate the results is up to you. when you have them you >> either use RETURN NEXT or RETURN QUERY to return them to the caller. > > Now I get the reply > > ERROR: set-valued function called in context that cannot accept a set > CONTEXT: PL/pgSQL fun

Re: [GENERAL] Howto return values from a function

2008-05-16 Thread Pavel Stehule
Hello use SELECT * FROM actionlist(...); Regards Pavel Stehule 2008/5/16 A B <[EMAIL PROTECTED]>: >> How you generate the results is up to you. when you have them you >> either use RETURN NEXT or RETURN QUERY to return them to the caller. > > Now I get the reply > > ERROR: set-valued function c

Re: [GENERAL] Howto return values from a function

2008-05-16 Thread Richard Huxton
A B wrote: How you generate the results is up to you. when you have them you either use RETURN NEXT or RETURN QUERY to return them to the caller. Now I get the reply ERROR: set-valued function called in context that cannot accept a set CONTEXT: PL/pgSQL function "actionlist" line 11 at retur

Re: [GENERAL] Howto return values from a function

2008-05-16 Thread A B
Great! :D That did the trick! Thank you so very much! 2008/5/16 Richard Huxton <[EMAIL PROTECTED]>: > A B wrote: >>> >>> How you generate the results is up to you. when you have them you >>> either use RETURN NEXT or RETURN QUERY to return them to the caller. >> >> Now I get the reply >> >> ERROR:

Re: [GENERAL] recommended way of separating data from indexes

2008-05-16 Thread Richard Huxton
Anton Melser wrote: Hi, I looked for quite a while but must have been looking in the wrong place... I have a 6 disk (x146GB) system running Centos 5.1 - RAID 1 (2 disks) and RAID 1+0 (4 disks). This seemed to be the recommended way of doing it but I may have been looking in the wrong place. The s

Re: [GENERAL] recommended way of separating data from indexes

2008-05-16 Thread Anton Melser
Hi, >> I have a 6 disk (x146GB) system running Centos 5.1 - RAID 1 (2 disks) >> and RAID 1+0 (4 disks). This seemed to be the recommended way of doing >> it but I may have been looking in the wrong place. The system is >> replicated using log shipping, so we have the archive command >> activated.

Re: [GENERAL] psql proxy

2008-05-16 Thread Martijn van Oosterhout
On Fri, May 16, 2008 at 01:53:30PM +1000, Linsong GUO wrote: > I want build a psql proxy which could deal with the connection request from > localhost to psql server which on other machine by type in psql -h localhost > -U bob network. Simple solution: use ssh tunneling Without any security: use

Re: [GENERAL] recommended way of separating data from indexes

2008-05-16 Thread Richard Huxton
Anton Melser wrote: It's a website, with probably around 98% read to 2% write, and the writes only to a few tables. The machine is only doing this one DB, with the odd email being sent by postfix (20 p/d, so nothing) and for the moment we aren't doing any real logging apart from postgres inte

[GENERAL] extent within given distance

2008-05-16 Thread User Map
hi, Is there any way to calculate the extent(geom) on basis of the given distance from a point, such as the point is in the middle. I have tried the Distance(geom,geom)<50, for calculating extent, but it is very slow in processing. My data SRID is 27700, and so the units are meters, i want to

Re: [GENERAL] psql proxy

2008-05-16 Thread Linsong GUO
in the terminal I input psql -h localhost -U bob network the problem is I do not know how to capture the user name and password information in my proxy code. after read function it is seems nothing in the buf could you suggest some stand proxy example for me thanks for your help On Fri, May 16

Re: [GENERAL] SSL auth problem

2008-05-16 Thread Albe Laurenz
Please, always CC: the list in your replies! Vitaliyi wrote: > > - Did you put the same thing in root.crt on both client and server? > > yes > > > - Does root.crt contain a self signed certificate? > > yes > > > - Does root.crt contain the certificate that was used to > sign server.crt and po

Re: [GENERAL] SSL auth problem

2008-05-16 Thread Vitaliyi
>> don't know where it looking for "root.crl", but it is in directory >> with root.crt and server.key, server.crt > > That should be harmless... removed root.crl. the same effect > Let me reexamine your original mail: > >> generating another key on server: > [...] >> signing on CA: >> openssl req

[GENERAL] Installing debugger

2008-05-16 Thread Robert Fitzpatrick
I have built posgresql 8.3.1 on a FreeBSD 6.1 via the ports system WITH_DEBUG=true and also on a Windows machine with the debugger selected. I see the plugin_debugger.dll under the lib/plugins folder on the Windows machine as well. But when I look for the procs, they are not there template1=#

Re: [GENERAL] How to create a function with multiple RefCursor OUT parameters

2008-05-16 Thread Merlin Moncure
On Fri, May 16, 2008 at 2:17 AM, Albe Laurenz <[EMAIL PROTECTED]> wrote: > Chuck Bai wrote: > CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, > OUT o_user refcursor, OUT o_name refcursor) RETURNS record AS > $BODY$ > BEGIN >o_user := 'o_user'; >o_name := 'o_name'; >tco

Re: [GENERAL] SSL auth problem

2008-05-16 Thread Albe Laurenz
Vitaliyi wrote: > another error appeared: > > psql: SSL error: sslv3 alert bad certificate > > so I started from beginning: > on CA: > openssl genrsa -out our.key 2048 > > creating self-signed serificate: > openssl req -new -key our.key -out our.req > openssl req -x509 -in our.req -text -key our

Re: [GENERAL] Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"

2008-05-16 Thread Andrew Sullivan
On Fri, May 16, 2008 at 09:06:11AM +0200, Ivan Sergio Borgonovo wrote: > Is > BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE > what I'm looking for? Yes. A -- Andrew Sullivan [EMAIL PROTECTED] +1 503 667 4564 x104 http://www.commandprompt.com/ -- Sent via pgsql-general mailing list (pgsql-gen

Re: [GENERAL] Installing debugger

2008-05-16 Thread Dave Page
On Fri, May 16, 2008 at 1:32 PM, Robert Fitzpatrick <[EMAIL PROTECTED]> wrote: > I have built posgresql 8.3.1 on a FreeBSD 6.1 via the ports system > WITH_DEBUG=true and also on a Windows machine with the debugger > selected. I see the plugin_debugger.dll under the lib/plugins folder on > the Windo

Re: [GENERAL] problem with serial data type and access

2008-05-16 Thread Adrian Klaver
On Thursday 15 May 2008 11:44 pm, Ottavio Campana wrote: > Adrian Klaver ha scritto: > >> The fact is that the serial data type is in pratice an integer, and when > >> I also try to connect with pgadminIII I see an integer data type and not > >> a serial. I think that since it sees an integer, it d

Re: [GENERAL] problem with serial data type and access

2008-05-16 Thread Richard Broersma
On Thu, May 15, 2008 at 6:54 AM, Ottavio Campana <[EMAIL PROTECTED]> wrote: > I'm dealing with this scenario: access 97 is connected through odbc to a > postgresql server. All tables are saved in postgresql and access is used > only to generated the program interface. > > Everything works fines, bu

[GENERAL] move database from the default tablespace to a new one?

2008-05-16 Thread Anton Melser
Hi all, Is this possible? I have a db that has been living in the default tablespace, and I am trying to separate out the transaction logs (and log archiving) and the data. It seems that tablespaces are the way to go... but the database exists and I need to separate them out. Any pointers? Cheers A

Re: [GENERAL] move database from the default tablespace to a new one?

2008-05-16 Thread Guillaume Lelarge
Anton Melser a écrit : Is this possible? I have a db that has been living in the default tablespace, and I am trying to separate out the transaction logs (and log archiving) and the data. It seems that tablespaces are the way to go... but the database exists and I need to separate them out. Any p

[GENERAL] IN query operator and NULL values

2008-05-16 Thread Denis Gasparin
Hi all. I have a problem with the IN operator in PostgreSQL 8.2.7. Here it is an example that reproduce the problem: test=# create table test(a integer ,b integer); CREATE TABLE test=# insert into test values(1,1); INSERT 6838415 1 test=# insert into test values(2,2); INSERT 6838416 1 test=# i

[GENERAL] table creation/modified timestamp

2008-05-16 Thread Kevin Neufeld
A wish-list feature for me is for postgresql to keep a record of a table creation date and modified date. This could be added to the '\dt+' shortcut. I have well over 100 tables and I find I'm always asking myself when certain tables were created. I realize I could always look at the relfil

Re: [GENERAL] Installing debugger

2008-05-16 Thread Robert Fitzpatrick
On Fri, 2008-05-16 at 14:27 +0100, Dave Page wrote: > There is a README with the plugin which tells you how to modify > postgresql.conf to preload the libraries at server start (which you > must do). Once you've done that, just run the pldbgapi.sql script > that's also included to load the api fun

Re: [GENERAL] IN query operator and NULL values

2008-05-16 Thread Alban Hertroys
On May 16, 2008, at 5:40 PM, Denis Gasparin wrote: Hi all. I have a problem with the IN operator in PostgreSQL 8.2.7. Here it is an example that reproduce the problem: test=# select * from test where b in(1,null); a | b ---+--- 1 | 1 In the last resultset, i was expecting two records the o

Re: [GENERAL] IN query operator and NULL values

2008-05-16 Thread Alban Hertroys
On May 16, 2008, at 6:54 PM, Alban Hertroys wrote: development=> select b, coalesce( (b in (1, null))::text, 'NULL') from test; b | coalesce ---+-- 1 | true 2 | NULL | NULL (3 rows) Just remembered a nice option from psql that doesn't quite clutter my example as much: deve

Re: [GENERAL] IN query operator and NULL values

2008-05-16 Thread Andy Anderson
The non-compliance fix is described here: http://www.postgresql.org/docs/8.3/interactive/functions- comparison.html says: To check whether a value is or is not null, use the constructs expression IS NULL expression IS NOT NULL or the equivalent, but nonstandard, constructs Note: If th

[GENERAL] transaction logging

2008-05-16 Thread Michael P. Soulier
I'm interested in enabling transaction logging, so that I can audit those logs on a system having issues. Is there already such a log in postgres 7.4? If not, is there such a feature and how do I enable it? I looked in the docs and saw many logging options but nothing for transactions. Tha

[GENERAL] Using role priviledges for pg_dump

2008-05-16 Thread Bill Moran
Given: CREATE ROLE joe WITH LOGIN; CREATE ROLE dumpable; ALTER GROUP dumpable ADD USER joe; If I have a database called db1 to which the role dumpable has enough permissions to do a full pg_dump, but he user joe does not, how can joe do a pg_dump? Is it possible? -- Bill Moran Collaborative F

[GENERAL] SSL auth problem

2008-05-16 Thread Vitaliyi
> It does not cause an error, but omit -text. done > Did you make sure that postgresql.key has permissions 0600? of course. otherwise it shows warning >> files on postgresql server: >> server.key (priv and pub keys) > > Did you make sure that server.key has permissions 0600? yes >

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-16 Thread D. Dante Lorenso
Tom Lane wrote: "D. Dante Lorenso" <[EMAIL PROTECTED]> writes: So, that not being the problem, any ideas? Is it an 8.2.4 thing? I can't reproduce any such problem in 8.2 branch tip, and a desultory scan of the CVS history back to 8.2.4 doesn't turn up any obviously related patches. Please pr

Re: [GENERAL] transaction logging

2008-05-16 Thread Scott Marlowe
On Fri, May 16, 2008 at 1:06 PM, Michael P. Soulier <[EMAIL PROTECTED]> wrote: > I'm interested in enabling transaction logging, so that I can audit those > logs on a system having issues. > > Is there already such a log in postgres 7.4? If not, is there such a feature > and how do I enable it? > >

Re: [GENERAL] psql proxy

2008-05-16 Thread Gerald Quimpo
On Friday 16 May 2008 23:34:56 Linsong GUO wrote: > in the terminal I input psql -h localhost -U bob network > > the problem is I do not know how to capture the user name and password > information in my proxy code. > > after read function it is seems nothing in the buf > > could you suggest some s

Re: [GENERAL] triggers: dynamic references to fields in NEW and OLD?

2008-05-16 Thread Vance Maverick
Thanks! Your solution clearly works, but it requires the shared function to enumerate all possible column names. In my real case, there are 8-10 distinct names, so that's a bit uglybut it works. Vance -Original Message- If you just need which table triggered the function then |T

[GENERAL] Setting up phppgadmin under https/ssl (Apache)

2008-05-16 Thread [EMAIL PROTECTED]
Hi... This is as much an apache question as anything else, but I think it's appropriate here. I've been using phppgadmin on my local machine. Now I've installed it on a remote server running Ubuntu lts 8.04. I figured I'd try and put it under ssl/https under Apache (mod_ssl). I've created a tes

[GENERAL] Pg_dump version mismatch

2008-05-16 Thread Toni Tortosa
Hello, I'm a newbie in this list. I'm working with a Debian 4.0 linux server, and I've installed postgresql 8.2.6. I didn't update to 8.2.7 When I try to do a pg_dump to backup my databases, It shows this error: pg_dump: server version: 8.2.7; pg_dump version: 8.2.6 pg_dump: aborting b

[GENERAL] Pg_dump version mismatch

2008-05-16 Thread Toni Tortosa
Hello, I'm a newbie in this list. I'm working with a Debian 4.0 linux server, and I've installed postgresql 8.2.6. I didn't update to 8.2.7 When I try to do a pg_dump to backup my databases, It shows this error: pg_dump: server version: 8.2.7; pg_dump version: 8.2.6 pg_dump: aborting because

[GENERAL] Select unique set of record, distinct on, please help!!!

2008-05-16 Thread worker
Dear all, I am still new to the PostGres DB, I 've been using other DB for quite a while, so SQL is OK with me. I am running into problem trying to condense duplicate records in a table into one record. Naturally, I think about 'DISTINCT ON' in select, but I just couldn't figure out the proper

[GENERAL] writing a function without installing a language

2008-05-16 Thread ${spencer}
is there a way to write a function without installing a specific language? all i need to do is write a function that can take 3 text's and put them into a list format (eg. "text1, text2 and text3" ) can anyone help? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

[GENERAL] escaping and quoting

2008-05-16 Thread Maarten Deprez
Hello. My dbmail server using postgresql produces a lot of warnings about '\\' in strings. The particular string it is complaining about is escaped by EscapeBytea, and included in single quotes (not E''). Is it all right to set standard_compliant_strings to on? Greetings, Maarten Deprez -- Se

[GENERAL] Pg_dump version mismatch

2008-05-16 Thread Toni Tortosa
Hello, I'm a newbie in this list. I'm working with a Debian 4.0 linux server, and I've installed postgresql 8.2.6. I didn't update to 8.2.7 When I try to do a pg_dump to backup my databases, It shows this error: pg_dump: server version: 8.2.7; pg_dump version: 8.2.6 pg_dump: aborting b

Re: [GENERAL] Problem with transaction isolation level

2008-05-16 Thread Michal Szymanski
>IMHO more information is needed, especially regarding how and when do >you change the call_status value in other parts of your code. For >example, if some other transaction is setting call_status to something >other than FINS and that transaction commits before the second UPDATE >comes out of wait

Re: [GENERAL] triggers: dynamic references to fields in NEW and OLD?

2008-05-16 Thread Kerri Reno
Vance, I missed your earlier post, so I may be misunderstanding the situation, but I think you could do this more easily in plpython, because TD['new'] and TD['old'] are dictionaries, and you can traverse the dictionaries like this: for k, v in TD['new'].items(): if tblfld == k: plpy.no

Re: [GENERAL] writing a function without installing a language

2008-05-16 Thread Adrian Klaver
On Friday 16 May 2008 7:56 am, ${spencer} wrote: > is there a way to write a function without installing a specific > language? all i need to do is write a function that can take 3 text's > and put them into a list format (eg. "text1, text2 and text3" ) > > can anyone help? You can use C or SQL to

Re: [GENERAL] Pg_dump version mismatch

2008-05-16 Thread Tom Lane
Toni Tortosa <[EMAIL PROTECTED]> writes: > I'm working with a Debian 4.0 linux server, and I've installed > postgresql 8.2.6. I didn't update to 8.2.7 > When I try to do a pg_dump to backup my databases, It shows this error: > pg_dump: server version: 8.2.7; pg_dump version: 8.2.6 > pg_dump: abo

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-16 Thread Tom Lane
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I can't reproduce any such problem in 8.2 branch tip, and a desultory >> scan of the CVS history back to 8.2.4 doesn't turn up any obviously >> related patches. Please provide a self-contained test case for what >> you're seeing.

[GENERAL] Function to return both integer and SETOF refcursor

2008-05-16 Thread Chuck Bai
I got the following error when try to create a function to return an integer and SETOF refcursor. I want to get refcursors back along with an Out parameter in one function. There seems to be a conflict on return type. How do I fix it? Thanks. ERROR: function result type must be integer becaus

Re: [GENERAL] Using role priviledges for pg_dump

2008-05-16 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > Given: > CREATE ROLE joe WITH LOGIN; > CREATE ROLE dumpable; > ALTER GROUP dumpable ADD USER joe; > If I have a database called db1 to which the role dumpable has enough > permissions to do a full pg_dump, but he user joe does not, how can > joe do a pg_du

Re: [GENERAL] Function to return both integer and SETOF refcursor

2008-05-16 Thread Tom Lane
Chuck Bai <[EMAIL PROTECTED]> writes: > I got the following error when try to create a function to return an > integer and SETOF refcursor. You can't. Perhaps it'd be enough to return the same integer value in each row of the output? regards, tom lane -- Sent via pgsql

Re: [GENERAL] Select unique set of record, distinct on, please help!!!

2008-05-16 Thread Scott Marlowe
On Fri, May 16, 2008 at 10:13 AM, worker <[EMAIL PROTECTED]> wrote: > Dear all, > I am still new to the PostGres DB, I 've been using other DB for > quite a while, so SQL is OK with me. I am running into problem trying > to condense duplicate records in a table into one record. Naturally, I > t

Re: [GENERAL] How to create a function with multiple RefCursor OUT parameters

2008-05-16 Thread Francisco Figueiredo Jr.
On Fri, May 16, 2008 at 10:06 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote: > On Fri, May 16, 2008 at 2:17 AM, Albe Laurenz <[EMAIL PROTECTED]> wrote: >> Chuck Bai wrote: Hi, Chuck! What's the Npgsql code you are using to call this function? Thanks in advance. -- Regards, Francisco Figueire