Re: [GENERAL] pl/sql resources for pl/pgsql?

2009-06-19 Thread Gurjeet Singh
On Sat, Jun 20, 2009 at 10:52 AM, Jasen Betts wrote: > On 2009-06-16, gvimrc wrote: > > I'm fairly new to PostgreSQL and completely new to using pl/pgsql > > though I've used MySQL's procedural language a little. > > I heard pl/pgsql is similar to Oracle's pl/sql so would it be possible, > > giv

Re: [GENERAL] How to use PQfn() in libpq library?

2009-06-19 Thread Bruce YUAN
Oh. Many thanks! Bruce 2009/6/20 Alvaro Herrera > Bruce YUAN escribió: > > Hi Tom, > > > > Which interface will replace this? And where can get it's reference? > > Try reading beyond the comma in the quoted paragraph: > > > >This interface is somewhat obsolete, as one can achieve similar > >

Re: [GENERAL] pl/sql resources for pl/pgsql?

2009-06-19 Thread Jasen Betts
On 2009-06-16, gvimrc wrote: > I'm fairly new to PostgreSQL and completely new to using pl/pgsql > though I've used MySQL's procedural language a little. > I heard pl/pgsql is similar to Oracle's pl/sql so would it be possible, > given that pl/pgsql literature is a bit thin on the ground, to use

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Uwe C. Schroeder
On Friday 19 June 2009, Scott Marlowe wrote: > On Fri, Jun 19, 2009 at 8:43 PM, Miguel > > Miranda wrote: > > Well, i just didnt explain in detail, what i have is just the 16897 > > directory where i was storing the database, i tried just copying the > > files but it didnt work, > > should it be p

Re: [GENERAL] Dynamic table

2009-06-19 Thread Jasen Betts
On 2009-06-17, A B wrote: >> Your problem is currently sounding very much like an exam question; you >> seem to be arbitrarily making decisions without showing any real data. >> When you deal with real problems in the real world you're normally >> making compromises when you model things and hence

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread Craig Ringer
On Fri, 2009-06-19 at 10:49 -0600, Scott Marlowe wrote: > On Thu, Jun 18, 2009 at 7:30 PM, Andrew > Maclean wrote: > > One is running McAfee and the other is running Symantec Endpoint. It > > does not matter whether the firewalls are on or off. > > Note that many packages for windows that do netwo

Re: [GENERAL] connecting to a remote pq always require a password

2009-06-19 Thread Jasen Betts
On 2009-06-18, David Shen wrote: > Hi, > > I am trying to use the libpq to connect to my postgresql 8.3 server. > If I use "dbname = mydb", the connection made successfully because I > am using a socket connection. But if I use "host = 127.0.0.1 dbname = > mydb", the error message is "no password

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Scott Marlowe
On Fri, Jun 19, 2009 at 8:43 PM, Miguel Miranda wrote: > Well, i just didnt explain in detail, what i have is just the 16897 > directory where i was storing the database, i tried just copying the files > but it didnt work, > should it be posible to import this database is any way? Nope, you need t

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Madison Kelly
Miguel Miranda wrote: Well, i just didnt explain in detail, what i have is just the 16897 directory where i was storing the database, i tried just copying the files but it didnt work, should it be posible to import this database is any way? the Os is Freebsd 6.2 and PG version is 8.1.3 thank y

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Miguel Miranda
Well, i just didnt explain in detail, what i have is just the 16897 directory where i was storing the database, i tried just copying the files but it didnt work, should it be posible to import this database is any way? the Os is Freebsd 6.2 and PG version is 8.1.3 thank you. On Fri, Jun 19, 2009

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Madison Kelly
Miguel Miranda wrote: Hi, the worst have ocurred, my server died (cpu), so i reinstalled another server with the same postgres version. I have the old data directory from the old server, how can i restore my databases from this directory to the new one? I dont have a backup (pg_dump,etc), just t

Re: [GENERAL] Disaster recovery (server died)

2009-06-19 Thread Alan Hodgson
On Friday 19 June 2009, Miguel Miranda wrote: > Hi, the worst have ocurred, my server died (cpu), so i reinstalled > another server with the same postgres version. > I have the old data directory from the old server, how can i restore my > databases from this directory to the new one? > I dont hav

Re: [GENERAL] FYI: Load times for a largish DB in 8.2 vs. 8.3 vs. 8.4

2009-06-19 Thread Todd A. Cook
Tom Lane wrote: "Todd A. Cook" writes: First, the numbers: PG VersionLoad time pg_database_size autovac -- 8.2.13179 min 92,807,992,820on 8.3.7 180 min 84,048,744,044on (de

[GENERAL] Disaster recovery (server died)

2009-06-19 Thread Miguel Miranda
Hi, the worst have ocurred, my server died (cpu), so i reinstalled another server with the same postgres version. I have the old data directory from the old server, how can i restore my databases from this directory to the new one? I dont have a backup (pg_dump,etc), just the main previus live data

Re: [GENERAL] Invalid statement name (null) in line ## - what am I doing wrong ?

2009-06-19 Thread leif
Hi again, Will do. Thanks again, Leif - "Albe Laurenz" wrote: > leif wrote: > >Thank you for precise answer. And yes, I have (at least) 2 > > connections, all named. So I am even not using the 'default' > > connection prepared statement as you point out. > > > >I have lo

[GENERAL] looping over a small record set over and over in a function

2009-06-19 Thread Ivan Sergio Borgonovo
I've a record set on which I have to loop several times. The function should return the same record set + one more computed field. Something that in could look like: foreach(row) { // compute stuff if(...) { } // place stuff in field[N+1] of the row } if(some condition) { // } foreach(r

Re: [GENERAL] FYI: Load times for a largish DB in 8.2 vs. 8.3 vs. 8.4

2009-06-19 Thread Tom Lane
Stefan Kaltenbrunner writes: > Tom Lane wrote: >> If you have time to repeat the experiments, it would be interesting to >> see what happens with consistent default_statistics_target across 8.3 >> and 8.4. > given that this was likely a single-thread restore and therefor wal > logged I wonder if

Re: [GENERAL] FYI: Load times for a largish DB in 8.2 vs. 8.3 vs. 8.4

2009-06-19 Thread Stefan Kaltenbrunner
Tom Lane wrote: "Todd A. Cook" writes: First, the numbers: PG VersionLoad time pg_database_size autovac -- 8.2.13179 min 92,807,992,820on 8.3.7 180 min 84,048,744,044on (de

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread justin
Pavel Stehule wrote: 2009/6/19 Leif B. Kristensen : nobody needs Windows. But Postgres has only one reputation. Problems on windows are PostgreSQL's problem too. And there are some native windows firms that starts develop with Postgres. And this people expecting stability. So if we su

Re: [GENERAL] How to use PQfn() in libpq library?

2009-06-19 Thread Alvaro Herrera
Bruce YUAN escribió: > Hi Tom, > > Which interface will replace this? And where can get it's reference? Try reading beyond the comma in the quoted paragraph: > >This interface is somewhat obsolete, as one can achieve similar > >performance and greater functionality by setting up a prepar

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread justin
Craig Ringer wrote: On Fri, 2009-06-19 at 01:03 -0400, Tom Lane wrote: I see lots of questions here that seem to be related to (a) virus scanner interference and (b) installation/reinstallation. Lots of the reinstall issues seem to be with people who don't really understand NT users, AC

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread Scott Marlowe
On Thu, Jun 18, 2009 at 7:30 PM, Andrew Maclean wrote: > One is running McAfee and the other is running Symantec Endpoint. It > does not matter whether the firewalls are on or off. Note that many packages for windows that do networking and virus scanning installed "wedge" dlls that are always part

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread Pavel Stehule
2009/6/19 Leif B. Kristensen : > On Friday 19. June 2009, Andrew Maclean wrote: >>I would NEVER run a production server in windows! >> >>These are just laptops/workstations that are used for development e.g, >> when network connections are not available or when travelling. > > Both my workstation a

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-19 Thread Leif B. Kristensen
On Friday 19. June 2009, Andrew Maclean wrote: >I would NEVER run a production server in windows! > >These are just laptops/workstations that are used for development e.g, > when network connections are not available or when travelling. Both my workstation and laptop have run Linux since 2003, and

Re: [GENERAL] How to use PQfn() in libpq library?

2009-06-19 Thread Bruce YUAN
Hi Tom, Which interface will replace this? And where can get it's reference? Best regards, Bruce 2009/6/19 Tom Lane > Bruce YUAN writes: > > How to use PQfn() in libpq library? > > Look into src/interfaces/libpq/fe-lobj.c for several examples. > However, please note the comment in the documenta

Re: [GENERAL] Invalid statement name (null) in line ## - what am I doing wrong ?

2009-06-19 Thread Albe Laurenz
leif wrote: >Thank you for precise answer. And yes, I have (at least) 2 > connections, all named. So I am even not using the 'default' > connection prepared statement as you point out. > >I have looked a little further into the output of ecpg as > well as adding the "AT " to my statemen

Re: [GENERAL] How to use PQfn() in libpq library?

2009-06-19 Thread Tom Lane
Bruce YUAN writes: > How to use PQfn() in libpq library? Look into src/interfaces/libpq/fe-lobj.c for several examples. However, please note the comment in the documentation: This interface is somewhat obsolete, as one can achieve similar performance and greater functionality by setting

[GENERAL] How to use PQfn() in libpq library?

2009-06-19 Thread Bruce YUAN
Hi All, How to use PQfn() in libpq library? #include PGresult *PQfn(PGconn* conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs); Who can share a detailed example source code? Which server functions can

Re: [GENERAL] Invalid statement name (null) in line ## - what am I doing wrong ?

2009-06-19 Thread leif
Hi Albe, Thank you for precise answer. And yes, I have (at least) 2 connections, all named. So I am even not using the 'default' connection prepared statement as you point out. I have looked a little further into the output of ecpg as well as adding the "AT " to my statements. Adding

Re: [GENERAL] Invalid statement name (null) in line ## - what am I doing wrong ?

2009-06-19 Thread Albe Laurenz
l...@crysberg.dk wrote: >I have a problem when upgrading from 8.2.4 to 8.3/8.4 using ecpg with a > prepare statement: > > EXEC SQL PREPARE execquery FROM :stmt; line = __LINE__; > EXEC SQL AT :_thisDbConn DECLARE execcurs CURSOR FOR execquery; line = > __LINE__; > EXEC SQL AT :_thisDbConn OP

Re: [GENERAL] postgres -- monitor and suggestions

2009-06-19 Thread Gerd König
Hello Sim, as Grzegorz already mentioned, you have to gather the info from the logs. Therefore I would suggest the tool pgfouine. There's an option to "visualize" the log of a VACUUM run. You should give it a try... regardsGERD... Sim Zacks schrieb: > Is there a tool that can monitor my post

Re: [GENERAL] Maintaining user roles and permissions in Postgres - general question

2009-06-19 Thread Richard Huxton
Scott Marlowe wrote: On Thu, Jun 18, 2009 at 8:03 PM, Postgres User wrote: Does anyone have a recommendation for maintaining user permissions on a changing database? The lack of an option to grant specific rights to all objects of a given type within a Postgres db obviously I think we're answ

[GENERAL] Issue with WAL recovery in windows

2009-06-19 Thread Nishkarsh
Hello every one, I am running Postgres 8.2 on Windows. I was trying to use WAL for archive and recovery. I followed the instructions giving in following link. http://www.mkyong.com/database/postgresql-point-in-time-recovery-incremental-backup/ http://www.mkyong.com/database/postgresql-point-in-t