Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Michael Fuhr
On Tue, Jan 18, 2005 at 01:24:31AM -0500, Tom Lane wrote: > > Now that you say that, I seem to recall that this has been reported > before. It seems odd that in today's climate the Python interpreter > would not cope well with Windows-style newlines. Maybe there is some > configuration issue wit

Re: [GENERAL] Users and unique identifyers

2005-01-17 Thread Michael Fuhr
On Tue, Jan 18, 2005 at 12:35:01AM -0600, [EMAIL PROTECTED] wrote: > > I need a way to link every user name to a unique ID held in a table in the > database. I've tried several ways of doing this but all of which are not > secure > enough. It's essential that no one be able to view the user nam

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Hong Yuan
Tom Lane wrote: Now that you say that, I seem to recall that this has been reported before. It seems odd that in today's climate the Python interpreter would not cope well with Windows-style newlines. Maybe there is some configuration issue with Python itself? I found a thread on exactly the s

Re: [GENERAL] ext3

2005-01-17 Thread Tino Wildenhain
Am Montag, den 17.01.2005, 17:47 -0800 schrieb Jeff Davis: > On Tue, 2005-01-18 at 07:43 +0700, David Garamond wrote: > > Tzahi Fadida wrote: > > > I recommend you don't use ext3 for any database: > > > http://seclists.org/lists/linux-kernel/2005/Jan/0641.html > > > > > > apparently its still bugg

Re: [GENERAL] ext3

2005-01-17 Thread Tino Wildenhain
Hi, Am Dienstag, den 18.01.2005, 07:43 +0700 schrieb David Garamond: > Tzahi Fadida wrote: > > I recommend you don't use ext3 for any database: > > http://seclists.org/lists/linux-kernel/2005/Jan/0641.html > > > > apparently its still buggy. > > So what is the recommended fs under Linux? I don't

[GENERAL] Users and unique identifyers

2005-01-17 Thread mstory
I need a way to link every user name to a unique ID held in a table in the database. I've tried several ways of doing this but all of which are not secure enough. It's essential that no one be able to view the user names, though the unique identifyers will be viewable to all users on the public

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Tom Lane
Hong Yuan <[EMAIL PROTECTED]> writes: > Following your direction, I did a byte-by-byte comparasion of the dump > files of the two different version. The sole difference is that in the > working version, the line break is represented the unix way as one 0x0a, > while in the non-working version th

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Hong Yuan
Tom Lane wrote: Hong Yuan <[EMAIL PROTECTED]> writes: I suppose there are some invisible characters inserted into the function body by pgAdmin. Seems like it must be. You could try pg_dump'ing both versions of the function and comparing the output files byte-by-byte. Be sure to let the pg

Re: [GENERAL] Logging question

2005-01-17 Thread Madison Kelly
Tom Lane wrote: Madison Kelly <[EMAIL PROTECTED]> writes: Where /is/ the log file? It depends. If you selected syslog logging then it's wherever syslog is configured to put the messages. Otherwise, it's wherever the postmaster's stderr output is being sent. A fairly annoying property of the curr

Re: [GENERAL] Logging question

2005-01-17 Thread Michael Glaesemann
On Jan 18, 2005, at 13:57, Michael Fuhr wrote: On Mon, Jan 17, 2005 at 11:41:34PM -0500, Tom Lane wrote: You forgot that ALTER DATABASE has this same option. It might be that ALTER USER is just as convenient, or even more so, for Madison's problem ... but it *can* be set at the database scope if

Re: [GENERAL] Logging question

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 11:41:34PM -0500, Tom Lane wrote: > > You forgot that ALTER DATABASE has this same option. It might be that > ALTER USER is just as convenient, or even more so, for Madison's problem > ... but it *can* be set at the database scope if needed. Drat, thanks for the reminder.

Re: [GENERAL] Logging question

2005-01-17 Thread Tom Lane
Madison Kelly <[EMAIL PROTECTED]> writes: > Where /is/ the log file? It depends. If you selected syslog logging then it's wherever syslog is configured to put the messages. Otherwise, it's wherever the postmaster's stderr output is being sent. A fairly annoying property of the current RPM packa

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Tom Lane
Hong Yuan <[EMAIL PROTECTED]> writes: > I suppose there are some invisible characters inserted into the function > body by pgAdmin. Seems like it must be. You could try pg_dump'ing both versions of the function and comparing the output files byte-by-byte. Be sure to let the pgAdmin guys know wh

Re: [GENERAL] Logging question

2005-01-17 Thread Madison Kelly
Tom Lane wrote: Michael Fuhr <[EMAIL PROTECTED]> writes: On Mon, Jan 17, 2005 at 09:03:17PM -0500, Madison Kelly wrote: Is there any way I can log and/or display database calls for a specific database? I don't know of a way to enable logging for a specific database, but you can enable logging for

Re: [GENERAL] Logging question

2005-01-17 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > On Mon, Jan 17, 2005 at 09:03:17PM -0500, Madison Kelly wrote: >> Is there any way I can log and/or display database calls for a >> specific database? > I don't know of a way to enable logging for a specific database, > but you can enable logging for a s

Re: [GENERAL] ext3

2005-01-17 Thread Tom Lane
Jeff Davis <[EMAIL PROTECTED]> writes: > In other words, does PostgreSQL assume that the filesystem at least > journals the metadata? Postgres assumes that the filesystem can take care of itself, which we define as not losing or corrupting successfully-fsynced data. The original BSD filesystem de

Re: [GENERAL] Logging question

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 09:13:19PM -0600, Tony Caduto wrote: > This is great info, is there a way to get the log back via a SQL call? > It would be pretty cool if there was a way to have the log go to a table > instead of a file. Not that I'm aware of, but you could write a function to read the

Re: [GENERAL] Logging question

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 10:06:20PM -0500, Paul Tillotson wrote: > I use ethereal (on the client--although it would possibly work on the > server too) in such a case. It's a bit messy but if you just want to > see what SQL statements were being run, then it works. Caveats: sniffers like etherea

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Hong Yuan
Adrian Klaver wrote: On Monday 17 January 2005 01:54 am, Hong Yuan wrote: I entered the multilineversion of this function exactly as written here and it ran properly. This was with version 8.0 of Postgres. You might want to do a /df+ circ in psql to see if your editor is putting a space at the b

Re: [GENERAL] ext3

2005-01-17 Thread William Yu
You may also want to test data=journal for ext3. Most of the time, this is slower but for databases with logging and mail servers, it can be faster. Mage wrote: Hello, Gabor Szima asked us to translate the letter below. "I read that ext3 writeback mode is recommended for PostgreSQL. I ma

Re: [GENERAL] Logging question

2005-01-17 Thread Tony Caduto
Michael, This is great info, is there a way to get the log back via a SQL call? It would be pretty cool if there was a way to have the log go to a table instead of a file. Tony Caduto Michael Fuhr wrote: ALTER USER johndoe SET log_statement TO TRUE; -- 7.x ALTER USER johndoe SET log_statement TO

Re: [GENERAL] Logging question

2005-01-17 Thread Paul Tillotson
Madison Kelly wrote: Hi all, This is probably an easy question but I couldn't my answer in the docs (I probably looked right at it...). Is there any way I can log and/or display database calls for a specific database? I am trying to debug a third party program and I can see that the problem

Re: [GENERAL] Logging question

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 09:03:17PM -0500, Madison Kelly wrote: > Is there any way I can log and/or display database calls for a > specific database? I don't know of a way to enable logging for a specific database, but you can enable logging for a specific user or session. For example, you cou

[GENERAL] Logging question

2005-01-17 Thread Madison Kelly
Hi all, This is probably an easy question but I couldn't my answer in the docs (I probably looked right at it...). Is there any way I can log and/or display database calls for a specific database? I am trying to debug a third party program and I can see that the problem probably has somethi

Re: [GENERAL] ext3

2005-01-17 Thread Jeff Davis
On Tue, 2005-01-18 at 07:43 +0700, David Garamond wrote: > Tzahi Fadida wrote: > > I recommend you don't use ext3 for any database: > > http://seclists.org/lists/linux-kernel/2005/Jan/0641.html > > > > apparently its still buggy. > > So what is the recommended fs under Linux? I don't need the bes

Re: [GENERAL] ext3

2005-01-17 Thread Lonni J Friedman
On Mon, 17 Jan 2005 16:54:45 -0800, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > David Garamond wrote: > > > Tzahi Fadida wrote: > > > >> I recommend you don't use ext3 for any database: > >> http://seclists.org/lists/linux-kernel/2005/Jan/0641.html > >> > >> apparently its still buggy. > > > > >

Re: [GENERAL] ext3

2005-01-17 Thread Frank D. Engel, Jr.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I typically use XFS when given the choice. On Jan 17, 2005, at 7:52 PM, Rich Shepard wrote: On Tue, 18 Jan 2005, David Garamond wrote: So what is the recommended fs under Linux? I don't need the best speed/throughput, but I prefer not to use ext2 due to

Re: [GENERAL] ext3

2005-01-17 Thread Joshua D. Drake
David Garamond wrote: Tzahi Fadida wrote: I recommend you don't use ext3 for any database: http://seclists.org/lists/linux-kernel/2005/Jan/0641.html apparently its still buggy. So what is the recommended fs under Linux? I don't need the best speed/throughput, but I prefer not to use ext2 due to l

Re: [GENERAL] ext3

2005-01-17 Thread Rich Shepard
On Tue, 18 Jan 2005, David Garamond wrote: > So what is the recommended fs under Linux? I don't need the best > speed/throughput, but I prefer not to use ext2 due to long fsck time. I > also tend to avoid reiser3, it has given us many griefs in the past. XFS? dave, I have no large databases h

Re: [GENERAL] ext3

2005-01-17 Thread David Garamond
Tzahi Fadida wrote: I recommend you don't use ext3 for any database: http://seclists.org/lists/linux-kernel/2005/Jan/0641.html apparently its still buggy. So what is the recommended fs under Linux? I don't need the best speed/throughput, but I prefer not to use ext2 due to long fsck time. I also

Re: [GENERAL] pgpool

2005-01-17 Thread Tatsuo Ishii
> So - would it then be worth doing pgpool? You could limit the number of connections to PostgreSQL. -- Tatsuo Ishii > On Sat, 15 Jan 2005 11:12:04 +0900 (JST), Tatsuo Ishii > <[EMAIL PROTECTED]> wrote: > > > John Cunningham wrote: > > > > concerned that if I drop the number of connections to les

[GENERAL] Question on output of VACUUM VERBOSE

2005-01-17 Thread Cornelia Boenigk
Hi all I don't understand what these two lines exactly mean. INFO: free space map: 490 relations, 13541 pages stored; 34480 total pages needed DETAIL: Allocated FSM size: 1000 relations + 2 pages = 178 kB shared memory Thanks in advance Conni ---(end of broadcast)-

Re: [GENERAL] Statically linking against libpq

2005-01-17 Thread Tom Lane
John DeSoi <[EMAIL PROTECTED]> writes: > On Jan 17, 2005, at 2:10 PM, Matthew Metnetsky wrote: >> I'd appreciate any suggestions on getting a statically linked library >> against libpq. I'm currently compiling on a Fedora Core 3 machine with >> gcc-2.95.3 against the postgresql-libs-7.4.6-1.FC3.2

Re: [GENERAL] Statically linking against libpq

2005-01-17 Thread John DeSoi
On Jan 17, 2005, at 2:10 PM, Matthew Metnetsky wrote: I'd appreciate any suggestions on getting a statically linked library against libpq. I'm currently compiling on a Fedora Core 3 machine with gcc-2.95.3 against the postgresql-libs-7.4.6-1.FC3.2 package. This is what I'm using to create a versio

Re: [GENERAL] ext3

2005-01-17 Thread PFC
Gabor Szima asked us to translate the letter below. "I read that ext3 writeback mode is recommended for PostgreSQL. I made some tests. data=ordereddata=writeback -- restoredb: 2m16.790s

Re: [GENERAL] ext3

2005-01-17 Thread Tzahi Fadida
I recommend you don't use ext3 for any database: http://seclists.org/lists/linux-kernel/2005/Jan/0641.html apparently its still buggy. Regards, tzahi. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Mage > Sent: Monday, January 17, 2005 9:

Re: [GENERAL] PostgreSQL 8 on windows very slow

2005-01-17 Thread PFC
Out application with pgsql (but I think the problem is zeoslib) is a little slower than ms-access ! We have good results with MySQL and Firebird (using zeoslib). access ? really ? what is the size of your dataset ? i've seen an access application literally die, belly-up with like 15 minutes

Re: [GENERAL] Statically linking against libpq

2005-01-17 Thread Richard_D_Levine
Did you add the path to where the libpq lives to your LD_LIBRARY_PATH? I haven't tried this, but that may be the problem. Alternatively you can add the path to the link command using -L (I think.) e.g. on my machine export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib or gcc -L/usr/lo

Re: [GENERAL] ext3

2005-01-17 Thread Lonni J Friedman
On Mon, 17 Jan 2005 20:00:46 +0100, Mage <[EMAIL PROTECTED]> wrote: > Hello, > > Gabor Szima asked us to translate the letter below. > > "I read that ext3 writeback mode is recommended for PostgreSQL. I made > some tests. > > data=ordereddata=writeback > ---

Re: [GENERAL] Bypass administrative permissions restriction on windows?

2005-01-17 Thread Magnus Hagander
>I am trying to use Postgres as a embedded db from inside a >Java Desktop >application. I am trying to work our how to do the minimal install >manually and start/stop the database from Java. I have come across the >issue of Postgres not running as a user with administrative >permissions. >The

Re: [GENERAL] pg_restore

2005-01-17 Thread Tom Lane
Cesar Schneider <[EMAIL PROTECTED]> writes: > When I execute pg_restore I get this error: > pg_restore: [archiver] unsupported version (1.13) in file header There is no 1.13; you have a corrupt dump file. Personally I'd bet money that you ran it through a Windows newline conversion (LF to CR/LF).

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Magnus Hagander
We're using the WiX toolset from http://wix.sf.net, along with MingW from http://www.mingw.org. You can find the complete source for the installer on the pgFoundry page at http://pgfoundry.org/projects/pginstaller/ //Magnus >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PRO

Re: [GENERAL] Statically linking against libpq

2005-01-17 Thread Matthew Metnetsky
On Mon, 2005-01-17 at 14:10 -0500, Matthew Metnetsky wrote: > I'll start off by saying that I am a compiling novice, so bear with me > please. > > I have a library which is being plugged into a game server to provide > extra functionality. The library is currently linked against libpq like > so `

[GENERAL] pg_restore

2005-01-17 Thread Cesar Schneider
Hi, I have a dump that was generated with pg_dump in 8.0-beta5 and I'm trying to restore with pg_restore in 8.0-RC3. The pg_dump command was: # pg_dump -Ft -o -b database The pg_restore command was: # pg_restore -Ft -d database When I execute pg_restore I get this error: pg_restore: [archiver] un

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Greg Stark
Bo Lorentsen <[EMAIL PROTECTED]> writes: > I understand that, I just can't see why an index lookup can't be used on "per > row" basis. Well, how would that work? -- greg ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[GENERAL] Statically linking against libpq

2005-01-17 Thread Matthew Metnetsky
I'll start off by saying that I am a compiling novice, so bear with me please. I have a library which is being plugged into a game server to provide extra functionality. The library is currently linked against libpq like so `gcc -shared -lpq`. It compiles and runs great as long as people have li

[GENERAL] ext3

2005-01-17 Thread Mage
Hello, Gabor Szima asked us to translate the letter below. "I read that ext3 writeback mode is recommended for PostgreSQL. I made some tests. data=ordereddata=writeback -- restoredb: 2m

Re: [GENERAL] PostgreSQL 8 on windows very slow

2005-01-17 Thread Jasper Potts
In our testing Postgres came out on top, well MySql was faster if you use the non-transactional table type "MyISAM". If you use the InnoDb table type it comes out slower. All of this is very subjective depending on your querys and data set. Have you run the ANALYZE command on Postgres since you

Re: [GENERAL] PostgreSQL 8 on windows very slow

2005-01-17 Thread lol
Well, for SELECT request pgsql runs well, although it's a little slower than firebird & MySQL. The problem is especially for INSERT request. It's strange there's a lot of disk access, as if it doesn't use the cache or something like that (I'm not a db expert). The application runs on windows 2000

[GENERAL] Bypass administrative permissions restriction on windows?

2005-01-17 Thread Jasper Potts
I am trying to use Postgres as a embedded db from inside a Java Desktop application. I am trying to work our how to do the minimal install manually and start/stop the database from Java. I have come across the issue of Postgres not running as a user with administrative permissions. The solution

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Jasper Potts
I am trying to do something similar with a silent install of postgres embedded in another install. What tools are being used to generate the Postgres MSI installer? is the source for the installer around? This is the first time I have ever tried making an installer so any tips very welcome. I a

Re: [GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Együd Csaba (Freemail)
Thak you Alban, Tom's solution (OVERLAPS) is the best for me. bye, -- Csaba -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alban Hertroys Sent: Monday, January 17, 2005 5:49 PM To: Együd Csaba Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Any fu

Re: [GENERAL] PQexecParams and CURSOR

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 04:44:50PM +0100, Laurent Marzullo wrote: > > > > > > // res = PQexec( conn , "FETCH 1 FROM MY_CURSOR" ); > > > > The above should work if you uncomment it and comment out or remove > > the other two attempts to execute FETCH. > > On my machine (2.6.7-gentoo-r9) and

Re: [GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Együd Csaba
Thank you Tom. -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Monday, January 17, 2005 5:37 PM To: Együd Csaba Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Any function for calculating inersect of intervals? =?iso-8859-2?Q?Egy=FCd_Csaba?= <[EMAIL PROTECTED

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Magnus Hagander
> Oh, and as for uninstalls and silent installations, Inno > Setup also provides that functionality automatically. It can > wrap the installation into a single EXE file, it can do disk > spanning, custom install types, compressed data in the > install file, creation of desktop/start menu short

Re: [GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Alban Hertroys
Alban Hertroys wrote: SELECT * FROM table WHERE (D1, D2) INTERSECTS (D3, D4); Ahem... Let's call that "end of the day dementia" or something... Of course it's called OVERLAPS, not INTERSECTS... ---(end of broadcast)--- TIP 8: explain analyze is your

Re: [GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Alban Hertroys
Együd Csaba wrote: Hi, wondering if exists any functions which aim to calculate intersect of two intervals. E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2) intersects (D3,D4) or not. Try INTERSECTS :P SELECT * FROM table WHERE (D1, D2) INTERSECTS (D3, D4); Related, are ther

Re: [GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Tom Lane
=?iso-8859-2?Q?Egy=FCd_Csaba?= <[EMAIL PROTECTED]> writes: > E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2) > intersects (D3,D4) or not. See the OVERLAPS operator: ( start1, end1 ) OVERLAPS ( start2, end2 ) http://developer.postgresql.org/docs/postgres/functions-dat

[GENERAL] Any function for calculating inersect of intervals?

2005-01-17 Thread Együd Csaba
Hi, wondering if exists any functions which aim to calculate intersect of two intervals. E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2) intersects (D3,D4) or not. I konw that it can be done by comparing the dates (>=,<=), but I'm wonder if I can do it simpler and shorter.

Re: [GENERAL] What is postgresql doing for "statement: commit;begin;"

2005-01-17 Thread Nick Burch
On Mon, 17 Jan 2005, Tom Lane wrote: > Nick Burch <[EMAIL PROTECTED]> writes: > > Quite a lot, I'm seeing lines like: > > 2005-01-17 13:11:15 LOG: duration: 4688.108 ms statement: commit;begin; > > > Is there any way to find out what exactly got executed here? > > A whole lot of deferred-until-

Re: [GENERAL] Use strict with plperl

2005-01-17 Thread Tom Lane
"Mike G." <[EMAIL PROTECTED]> writes: > In 8.0 how does one have a plperl function use strict? > If I add "use strict" within the function body I receive an error message: > "creation of Perl function failed: 'require' trapped by operation mask..." You'd have to use plperlu to be allowed to "use"

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Frank D. Engel, Jr.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Given that I'm using Inno Setup for the project I am doing, I have a comment here. Inno Setup is easier to develop with than are any of the "free" or inexpensive MSI installation tools I've looked at. However, if someone wants to put the extra time

Re: [GENERAL] pgpool

2005-01-17 Thread John Cunningham
So - would it then be worth doing pgpool? On Sat, 15 Jan 2005 11:12:04 +0900 (JST), Tatsuo Ishii <[EMAIL PROTECTED]> wrote: > > John Cunningham wrote: > > > concerned that if I drop the number of connections to less than the > > > number of databases I have, that pgpool would open the limit of >

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Tom Lane
Bo Lorentsen <[EMAIL PROTECTED]> writes: > To me it sounds like an index lookup is a one time a query (not per row) > thing, but I don't understand why. I can't explain it any more clearly than Florian did: http://archives.postgresql.org/pgsql-general/2005-01/msg00769.php

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Frank D. Engel, Jr.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, let's look at this a different way. When you look at a volatile function or variable, let's say CURRENT_TIMESTAMP (which returns the current date and time as of the beginning of the transaction), you see a function or variable whose value chang

Re: [GENERAL] What is postgresql doing for "statement: commit;begin;"

2005-01-17 Thread Tom Lane
Nick Burch <[EMAIL PROTECTED]> writes: > Quite a lot, I'm seeing lines like: > 2005-01-17 13:11:15 LOG: duration: 4688.108 ms statement: commit;begin; > Is there any way to find out what exactly got executed here? A whole lot of deferred-until-transaction-commit operations, evidently. You got a

Re: [GENERAL] PQexecParams and CURSOR

2005-01-17 Thread Tom Lane
"Laurent Marzullo" <[EMAIL PROTECTED]> writes: > Ok so here is the full TEST program I try to run: I think you are running into an issue that was fixed during the 8.0 development cycle. From the CVS logs: 2004-08-01 21:30 tgl Allow DECLARE CURSOR to take parameters from the portal in w

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Bo Lorentsen
Greg Stark wrote: If Postgres used an index it would call odd(), which would return 1 because it's the first time, and then Postgres would go look up the rows where col is 1 and return all of them. That's a very different behaviour from if the index isn't used. If all the records have col=1 then yo

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Bo Lorentsen
Florian G. Pflug wrote: Lets say, you have an query "select * from table where field = function()". Now, according to the sql-spec, you would have to scan each row in "table", call the function "functio()", and compare the result. If the result of the call to "function()" matches the value in "fi

Re: [GENERAL] PQexecParams and CURSOR

2005-01-17 Thread Laurent Marzullo
On Mon, Jan 17, 2005 at 11:28:57AM +0100, Laurent Marzullo wrote: > > // res = PQexec( conn , "FETCH 1 FROM MY_CURSOR" ); > The above should work if you uncomment it and comment out or remove > the other two attempts to execute FETCH. On my machine (2.6.7-gentoo-r9) and postgreSQL (pos

Re: [GENERAL] Index optimization ?

2005-01-17 Thread Bo Lorentsen
Tom Lane wrote: No, you'd still end up with a seqscan, because this WHERE clause offers no chance of matching an index, and we don't do anything special with stable functions beyond trying to match them to index conditions. So, the executer uses the (first) value to find the index to use for ALL

Re: [GENERAL] PQexecParams and CURSOR

2005-01-17 Thread Michael Fuhr
On Mon, Jan 17, 2005 at 11:28:57AM +0100, Laurent Marzullo wrote: > // res = PQexec( conn , "FETCH 1 FROM MY_CURSOR" ); The above should work if you uncomment it and comment out or remove the other two attempts to execute FETCH. > /* > res = PQexecParams(conn, >

[GENERAL] Use strict with plperl

2005-01-17 Thread Mike G.
In 8.0 how does one have a plperl function use strict? If I add "use strict" within the function body I receive an error message: "creation of Perl function failed: 'require' trapped by operation mask..." If I do Create Function X AS Language 'plperl' strict volatile the function will comp

Re: [GENERAL] Array to rowset function

2005-01-17 Thread Mike Rylander
John Hansen posted a C implementaion of the UNNEST function that does this. It is in the archives here: http://archives.postgresql.org/pgsql-hackers/2004-11/msg00158.php and http://archives.postgresql.org/pgsql-hackers/2004-11/msg00327.php . I've been using it for the last few months and it's be

[GENERAL] Array to rowset function

2005-01-17 Thread laurie . burrow
I have a function to convert a single dimension array to a row set CREATE OR REPLACE FUNCTION arraytotable(anyarray) RETURNS SETOF anyelement AS ' DECLARE theData ALIAS FOR $1; count integer; start integer; BEGIN start :=array_lower(theData,1); count :=array_upper(theData,1);

Re: [GENERAL] Multiline plpython procedure

2005-01-17 Thread Adrian Klaver
On Monday 17 January 2005 01:54 am, Hong Yuan wrote: I entered the multilineversion of this function exactly as written here and it ran properly. This was with version 8.0 of Postgres. You might want to do a /df+ circ in psql to see if your editor is putting a space at the beginning of line 2.

[GENERAL] What is postgresql doing for "statement: commit;begin;"

2005-01-17 Thread Nick Burch
Hi All I've turned on slow query reporting via log_min_duration_statement, and I've been looking through the log files. Quite a lot, I'm seeing lines like: 2005-01-17 13:11:15 LOG: duration: 4688.108 ms statement: commit;begin; Is there any way to find out what exactly got executed here? Tha

Re: [GENERAL] Rules on select

2005-01-17 Thread Rick Schumeyer
As a new user, I recently had the same problem. I then realized what the problem is. You want to select from sharp_p1 instead of selecting from sharp. That means you never actually select from sharp. Since nothing was selected, postgres can't do anything useful with the WHERE clause. To put it

[GENERAL] Rules on select

2005-01-17 Thread Mariusz Czułada
Hi, I tried to create rule on a view. It should contain a WHERE clause. Unfortunately it does not work: a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp a_4m-# WHERE part_key = 1 a_4m-# DO a_4m-# INSTEAD SELECT * FROM sharp_p1; ERROR: ON SELECT rule may not use OLD a_4m=# CREATE RU

Re: [GENERAL] ORDER BY in UNION query

2005-01-17 Thread Antony Paul
Thanks Tom it worked. rgds Antony Paul On Mon, 10 Jan 2005 08:39:50 -0500, Tom Lane <[EMAIL PROTECTED]> wrote: > Richard Huxton writes: > > Antony Paul wrote: > >> I need to use ORDER BY clause in a UNION query and the Order BY > >> columns are not included in the SELECT statement. I tried like

[GENERAL] postgres Recover Deleted Data

2005-01-17 Thread Martin Kuria
Hi, I accidentally deleted two records in one of my tables, the problem I had not done a back for the database. I can I restore my records, please advice how I can recover my deleted records, thanks again. +-+ | Martin W. Kuria (Mr.) [EMAIL PROTEC

Re: [GENERAL] ntfs for windows port rc5-2

2005-01-17 Thread Magnus Hagander
> > chose no at that point, and it installs, then errors and completely > > un-installs. > > leaving a dir struct under program files with a single file: > > pgperm.log > > under the directory with the msi files in it there is a > full install > > log, which the list has twice refused to accep

Re: [GENERAL] PQexecParams and CURSOR

2005-01-17 Thread Laurent Marzullo
Hello, Ok so here is the full TEST program I try to run: (It's a cut/paste + modification of program from PostgreSQL doc) Thanks for any further help. Laurent Marzullo === // vim:set ts=4 sts=4 sw=4 expandtab: #include #include #i

Re: [GENERAL] ntfs for windows port rc5-2

2005-01-17 Thread Magnus Hagander
> >>Log in the temp install dir: > >>The Cacls command can be run only on disk drives that use the NTFS > >>file system > >> > >>I'll have to rip half or more of the full log as it seems to be to > >>large for the list to accept > > > > > > I assume you are talking about the initdb.log file? Th

[GENERAL] Multiline plpython procedure

2005-01-17 Thread Hong Yuan
Hi, I am biwildered at how to create a multi-line plpython function in Postgres. When I create the function in one line like this: CREATE or REPLACE FUNCTION circ (float) RETURNS float AS 'from math import pi; return 2*pi*args[0]' LANGUAGE plpythonu; and then use SELECT circ(1) to test it, it r

Re: [GENERAL] Cursor bug?

2005-01-17 Thread Martijn van Oosterhout
On Mon, Jan 17, 2005 at 12:06:56AM -0600, Mike G. wrote: > It doesn't look like it has been added to the documentation yet. The > only reference I could find to it was in the todo list (create > similiar ability for delete statement). > > USING allows you to add join statements to your update sta

Re: [GENERAL] Postgresql 8.0 and Cancel/Kill backend functions

2005-01-17 Thread Magnus Hagander
> > The cancel function is implemented. See > > > http://developer.postgresql.org/docs/postgres/functions-admin.html#FUN > > CT > > IONS-ADMIN-SIGNAL-TABLE. > > > > Kill function was considered too dangerous. > > Pity - I would have loved this for my test harnesses. I need > to drop and recrea

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Magnus Hagander
If you o this, don't expect your installation to work later. There is a reason for the safeguards in the system. //Magnus > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tzahi Fadida > Sent: Monday, January 17, 2005 1:35 AM > To: [EMAIL PROTECTED]

Re: [GENERAL] Problem with win32 installer for PG 8.0

2005-01-17 Thread Magnus Hagander
> Hi, > I installed beta 2 a couple of months ago, and today I > installed RC 5 and it seems there is no way to tell the > installer where to actually install, so I could not re use my > data cluster from the beta 2(with out renaming the directory > to the same name as what the installer would

Re: [GENERAL] Iis there anyway to do this(see in message)

2005-01-17 Thread Tony Caduto
Michael, Thank you for the info, it actually should give me enough detail, though not as convienent as a trace tool would be. People request a trace feature for PL/pgSQL from time to time but I don't think anybody has implemented it yet. I'm sure a patch would be welcome Would love to hel