Re: [GENERAL] How to compile a 32 bit version of postgres on a x64 machine.

2009-03-28 Thread Douglas McNaught
On Thu, Mar 26, 2009 at 6:43 AM, Tim Uckun wrote: > It looks like most avenues for high availability with postgres are not > available if one of the machines is a 64 bit machine and the other a 32. > > Somebody on this list suggested I install a 32 bit version of postgres on my > x64 machine.  Wha

Re: [GENERAL] Error in ALTER DATABASE command

2008-09-23 Thread Douglas McNaught
On Tue, Sep 23, 2008 at 11:49 AM, William Garrison <[EMAIL PROTECTED]> wrote: > In Postgresql 8.2.9 on Windows, you cannot rename a database if the name > contains mixed case. > 3) Open a query window, or use PSQL to issue the following command > ALTER DATABASE MixedCase RENAME TO anything_else;

Re: [GENERAL] offtopic, about subject prefix

2008-09-20 Thread Douglas McNaught
On Fri, Sep 19, 2008 at 3:01 PM, Michelle Konzack <[EMAIL PROTECTED]> wrote: > Am 2008-09-03 13:33:05, schrieb Fernando Moreno: >> Hello, I'm new to this mailing list, and I have a couple of questions: >> >> Is it really necessary to add the [GENERAL] prefix? > > No it is not since the PostgreQL Li

Re: [GENERAL] Install Postgres on a SAN volume?

2008-09-08 Thread Douglas McNaught
On Mon, Sep 8, 2008 at 6:18 PM, William Garrison <[EMAIL PROTECTED]> wrote: > 2) We could install PostgreSQL onto the C: drive and then configure the data > folder to be > on the SAN volume (Z:) You want this. If you're going to take snapshots, you need all the data files AND the transaction log

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 3:35 PM, John T. Dow <[EMAIL PROTECTED]> wrote: > However, it would really be nice if the WAL files could be used to make the > restored data more current, even if not everything can be restored. Are we > certain that useful information can't be gleaned from them to apply

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 12:35 PM, John T. Dow <[EMAIL PROTECTED]> wrote: > You can't blame me for being confused. Here's from section 23.3 of the 8.2 > manual. > > "At all times, PostgreSQL maintains a write ahead log (WAL) in the pg_xlog/ > subdirectory of the cluster's > data directory. The log

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 10:57 AM, John T. Dow <[EMAIL PROTECTED]> wrote: > BACKGROUND INFO BEGINS > > Recently I had some questions about doing backups and received very helpful > replies. I have now put together a BAT file to do a routine backup, using > pg_dumpall with the -g option to get the

Re: [GENERAL] hibernate nativequery and uuid

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 5:57 PM, Andrew <[EMAIL PROTECTED]> wrote: > The only relevant thing I have been able to find relating to it is > http://archives.postgresql.org/pgsql-bugs/2007-12/msg00061.php which > suggests adding a ::uuid cast to the parameter. > > However, when doing that, hibernate t

Re: [GENERAL] CAST(integer_field AS character) truncates trailing zeros

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 4:17 PM, Richard Broersma <[EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 1:03 PM, Warren Bell <[EMAIL PROTECTED]> wrote: >> I am trying to cast an int to a character. The int is the number 1000 it >> gets cast down to "1" and not "1000". How do I cast from int to chara

Re: [GENERAL] CAST(integer_field AS character) truncates trailing zeros

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 4:03 PM, Warren Bell <[EMAIL PROTECTED]> wrote: > I am trying to cast an int to a character. The int is the number 1000 it > gets cast down to "1" and not "1000". How do I cast from int to character > without loosing the trailing zeros? Please supply the exact syntax that y

Re: [GENERAL] mac install question

2008-07-23 Thread Douglas McNaught
On Wed, Jul 23, 2008 at 2:19 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Well I got it from a link on postgresql.org. Of course it does say that it > is a beta installer. > http://www.postgresql.org/download/macosx Well, hopefully the maintainer reads this mailing list then. :) -Doug -

Re: [GENERAL] mac install question

2008-07-23 Thread Douglas McNaught
On Wed, Jul 23, 2008 at 1:58 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Please excuse my lack of mac knowledge. I installed postgresql 8.3 using the > mac os x 1 click installer onto my brand new powerbook. The install appeared > to go very smooth. If I go to Postgresql under Applica

Re: [GENERAL] Whassup with this? (Create table xxx like yyy fails)

2008-07-19 Thread Douglas McNaught
On Sat, Jul 19, 2008 at 9:02 PM, Karl Denninger <[EMAIL PROTECTED]> wrote: > childrensjustice=# create table petition_bail like petition_white; > ERROR: syntax error at or near "like" > LINE 1: create table petition_bail like petition_white; It's not super-easy to see from the docs, but I think y

Re: [GENERAL] Writing a user defined function

2008-07-18 Thread Douglas McNaught
On Fri, Jul 18, 2008 at 12:07 PM, Suresh_ <[EMAIL PROTECTED]> wrote: > > Hello, > I am trying to code a simple udf in postgres. How do I write sql commands > into pl/sql ? The foll. code doesnt work. > > CREATE OR REPLACE FUNCTION udf() > RETURNS integer AS $$ > BEGIN > for i in 1..2000 loop > fo

Re: [GENERAL] Reducing memory usage of insert into select operations?

2008-07-18 Thread Douglas McNaught
On Fri, Jul 18, 2008 at 12:18 AM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Douglas McNaught writes: > > >> It does seem that reducing work_mem might help you, but others on this > > I reduced it from 256MB to 64MB. It seems it is helping. You should also loo

Re: [GENERAL] Reducing memory usage of insert into select operations?

2008-07-17 Thread Douglas McNaught
On Thu, Jul 17, 2008 at 9:27 PM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Douglas McNaught writes: > >> Is this a 32-bit installation or 64-bit? 3GB of shared_buffers is way >> too big for a 32-bit setup. > > > 64-bit. > The machine has 12GB of RAM so shar

Re: [GENERAL] Reducing memory usage of insert into select operations?

2008-07-17 Thread Douglas McNaught
On Thu, Jul 17, 2008 at 7:21 PM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Redhat 4 > postgresql 8.3.3 > Memory: 12GB > > While doing a couple of operations of the type > insert into select from > > The OS triggered the out of memory killer (oom-killer). Is this a 32-bit installation or 64-bi

Re: [GENERAL] [HACKERS] postmaster.pid not visible

2008-07-17 Thread Douglas McNaught
On Thu, Jul 17, 2008 at 2:43 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > I was wondering if the postmaster was running in some other data > directory than the OP thought. I've never heard of anything just > randomly removing a .pid file from a data directory; and it would > be extremely dangerous if

Re: [GENERAL] deleting the master but not the detail

2008-07-17 Thread Douglas McNaught
On Thu, Jul 17, 2008 at 12:11 PM, Ismael <[EMAIL PROTECTED]> wrote: > > hi > I have one of those master-detail relationships here and I need to be able > to delete the master but leave the details untouched Then remove the referential integrity constraint, since it's obviously incompatible wi

Re: [GENERAL] Confusion about ident sameuser

2008-07-02 Thread Douglas McNaught
On Wed, Jul 2, 2008 at 9:55 PM, Gurjeet Singh <[EMAIL PROTECTED]> wrote: > As you can see, if I use the machine's interface or unix sockets, it either > asks for password or lets me in. But when I use localhost, it correctly uses > 127.0 line for authentication, but does not let me in!!! > > I

Re: [GENERAL] compiling, performance of PostGreSQL 8.3 on 64-bit processors

2008-06-27 Thread Douglas McNaught
On Fri, Jun 27, 2008 at 11:52 AM, Benjamin Weaver <[EMAIL PROTECTED]> wrote: > Sorry, guys, for wasting bandwidth on this! You guys gave just the answer I > wanted to hear. Sounds like there aren't any problems. > > Not knowing about such things, I was scared by the following quote. Perhaps > bi

Re: [GENERAL] compiling, performance of PostGreSQL 8.3 on 64-bit processors

2008-06-26 Thread Douglas McNaught
On Thu, Jun 26, 2008 at 7:12 PM, Adam Rich <[EMAIL PROTECTED]> wrote: > >> 1. I have heard of problems arising from compiling PostGreSQL (8.3) on >> 64-bit >> processors. What sort of problems am I likely to encounter and how >> should I fix >> them? We are will run Linux Redhat 5 on a Dell PE29

Re: [GENERAL] Importing undelimited files (Flat Files or Fixed-Length records)

2008-06-19 Thread Douglas McNaught
On Thu, Jun 19, 2008 at 6:54 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: > I've got to load some large fixed-legnth ASCII records into PG and I was > wondering how this is done. The Copy command looks like it works only with > delimited files, and I would hate to have to convert these files to > INSE

Re: [GENERAL] HA best pratices with postgreSQL

2008-06-18 Thread Douglas McNaught
On Wed, Jun 18, 2008 at 8:44 PM, Albretch Mueller <[EMAIL PROTECTED]> wrote: > ~ > I am developing a J2EE application that needs for users to only read > DB tables. All queries are select ones, no updates, no inserts, no > deletes for web users, so I keep this ro DB tables in certain > partitions

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

2008-05-18 Thread Douglas McNaught
On Sun, May 18, 2008 at 8:04 AM, Ivan Sergio Borgonovo <[EMAIL PROTECTED]> wrote: > What is the effect of having nested functions all declared > SERIALIZABLE? > > What if just the outermost is declared SERIALIZABLE? SERIALIZABLE applies to the entire transaction, not to individual function calls.

Re: [GENERAL] rounding problems

2008-05-13 Thread Douglas McNaught
2008/5/13 Justin <[EMAIL PROTECTED]>: > Your saying in Excel, Multiplication is not Commutativity??? that sends > shudders down my back The word you want in this case is "associative". Since floating point math is not exact, sometimes the associativity (and other) properties of some operati

Re: [GENERAL] Conditional on Select List

2008-05-13 Thread Douglas McNaught
On Tue, May 13, 2008 at 11:52 AM, Fernando <[EMAIL PROTECTED]> wrote: > > Is it possible to do this? > > SELECT IF(COUNT(colname) > 0, TRUE, FALSE) AS colname FROM table; You should be able to use CASE for this. -Doug -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

Re: [GENERAL] plpgsql functions and the planner

2008-04-27 Thread Douglas McNaught
On Sun, Apr 27, 2008 at 2:06 AM, Matthew Dennis <[EMAIL PROTECTED]> wrote: > Do SQL statements inside of plpgsql functions get planned upon every > execution, only when the function is first executed/defined, or something > else entirely? They are planned on first execution and the plan is cached

Re: [GENERAL] pgcrypto and dblink

2008-04-10 Thread Douglas McNaught
On Thu, Apr 10, 2008 at 3:46 PM, Roberts, Jon <[EMAIL PROTECTED]> wrote: > I am moving from Windows to Solaris and I need pgcrypto and dblink. > Where are these? I don't see anything in the configure that suggests it > is even an option. They're not handled by 'configure'. They are in the 'con

Re: [GENERAL] how to use postgre sql from inside process

2008-04-10 Thread Douglas McNaught
On Thu, Apr 10, 2008 at 11:25 AM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Thu, Apr 10, 2008 at 5:45 AM, CMOS <[EMAIL PROTECTED]> wrote: > > hi, > > i would like to get services of postgresql from inside the process (to > > use it as a library and linking to it), i.e not having a separate

Re: [GENERAL] slow pgsql tables - need to vacuum?

2008-04-07 Thread Douglas McNaught
On Mon, Apr 7, 2008 at 9:51 AM, Dan99 <[EMAIL PROTECTED]> wrote: > Unfortunately, I did not design this database (or the website for that > matter) and am only maintaining it. As a result of the inexperience > of the website designer, there are no indexes in any of the tables and > it would b

Re: [GENERAL] slow pgsql tables - need to vacuum?

2008-04-05 Thread Douglas McNaught
On Thu, Apr 3, 2008 at 2:34 PM, Dan99 <[EMAIL PROTECTED]> wrote: > Hi, > > I am having some troubles with a select group of tables in a database > which are acting unacceptably slow. For example a table with > approximately < 10,000 rows took about 3,500ms to extract a single row > using the f

Re: [GENERAL] dblink ,dblink_exec not participating in a Transaction??

2008-04-01 Thread Douglas McNaught
On Tue, Apr 1, 2008 at 7:56 PM, carty mc <[EMAIL PROTECTED]> wrote: > In this case the updates that were made using dblink_exec are not getting > rolled back in Database B. And they won't be. dblink isn't transactional in that way. Your best bet is to put all the data into one database and use

Re: [GENERAL] Postgres connection error

2008-03-22 Thread Douglas McNaught
On 3/18/08, Vernon Van Zandt <[EMAIL PROTECTED]> wrote: > Greetings, > > I keep getting the following error when attempting to establish a > connection (from Perl): > > install_driver(Pg) failed: DBD::Pg object version undef does not match > bootstrap parameter 2.2.2 at /usr/lib/perl/5.8/DynaLo

Re: [GENERAL] Problems with 8.3

2008-03-08 Thread Douglas McNaught
On 3/8/08, Alex Turner <[EMAIL PROTECTED]> wrote: > No I'm not. Where would a core file be if there was going to be one? They should appear in the data directory (e.g. /var/lib/pgsql/data). > I'm not sure how I can tell if the ulimit applies to the running > postmaster > > I am the postgres u

Re: [GENERAL] Problems with 8.3

2008-03-08 Thread Douglas McNaught
On 3/8/08, Alex Turner <[EMAIL PROTECTED]> wrote: > Well - I know that my stored proc is segfaulting based on a strace of > postgresql. Don't know how that affects trac which isn't using that > stored proc... the mystery continues. Either way I didn't get a > corefile, and ulimit -a show I hav

Re: [GENERAL] Problems with 8.3

2008-03-06 Thread Douglas McNaught
On 3/6/08, Alex Turner <[EMAIL PROTECTED]> wrote: > Ok - lookint at the pg log, it appears that the server process is seg > faulting :(. This might conceivably be my fault. I have 3 stored > procedures written in C, but they've been on the server for months, > and unless I didn't deploy them c

Re: [GENERAL] Problems with 8.3

2008-03-06 Thread Douglas McNaught
On 3/6/08, Alex Turner <[EMAIL PROTECTED]> wrote: > I'm getting the back end closing connections early for some reason. > Here is an exception report from my servlet. This first started > happening with my instance of Trac, but now it's happening to my Java > apps too. I hope someone can shed

Re: [GENERAL] Import file into bytea field in SQL/plpgsql?

2008-03-05 Thread Douglas McNaught
On 3/5/08, Erwin Brandstetter <[EMAIL PROTECTED]> wrote: > The whole concept behind large objects is a bit off. Since we have > TOAST tables, it is of limited use to store large objects away in a > system table. It would be useful to have (additional) functions like: >lo_import(text) RETURNS

Re: [GENERAL] Build 8.3 with OpenSSL on CentOS 5.x?

2008-03-04 Thread Douglas McNaught
On 3/4/08, Devrim GÜNDÜZ <[EMAIL PROTECTED]> wrote: > Hi, > > > On Tue, 2008-03-04 at 00:34 -0500, Tom Lane wrote: > > Karl Denninger <[EMAIL PROTECTED]> writes: > > > Anyone know where the magic incantation is to find the crypto > > libraries? > > > > If the RPM layout is the same as Fedora

Re: [GENERAL] Understanding ps -ef "command" column

2008-02-22 Thread Douglas McNaught
On 2/22/08, David Jaquay <[EMAIL PROTECTED]> wrote: > Yeah, kinda guessed that. > > So there's no way (that you know of) to, say, cast my JDBC connection object > to something Postgresql'y and peer into its internals? The docs and the source code for the PG JDBC driver are freely available. Worst

Re: [GENERAL] Understanding ps -ef "command" column

2008-02-22 Thread Douglas McNaught
On 2/22/08, David Jaquay <[EMAIL PROTECTED]> wrote: > When I do a ps -ef, in the command column, I see: > > postgres: postgres dbname 10.170.1.60(57413) idle > > I get all of this, except the "57413". What does this mean, and more > importantly, how can I tie that number back to a connection that

Re: [GENERAL] Vacuous errors in pg_dump ... | pg_restore pipeline

2008-02-20 Thread Douglas McNaught
On 2/20/08, Kynn Jones <[EMAIL PROTECTED]> wrote: > Alternatively, is there a better way to streamline the duplication of a > database? How about: CREATE DATABASE newdb TEMPLATE olddb; (don't remember the exact syntax, but it'll be in the docs for CREATE DATABASE). I think the 'createdb' progr

Re: [GENERAL] DB design: How to store object properties?

2008-02-17 Thread Douglas McNaught
On 2/17/08, Maxim Khitrov <[EMAIL PROTECTED]> wrote: > The simplest design would be to create two tables, one for nodes > another for edges, and create a column for every possible property. > This, however, is huge waste of space, since there will not be a > single node or edge that will make use o

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Douglas McNaught
On 2/15/08, Phoenix Kiula <[EMAIL PROTECTED]> wrote: > LOG: could not receive data from client: Connection reset by peer > LOG: unexpected EOF on client connection > LOG: could not receive data from client: Connection reset by peer > LOG: unexpected EOF on client connection This means you

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Douglas McNaught
On 2/15/08, Harald Fuchs <[EMAIL PROTECTED]> wrote: > But you have to ensure that you build PostgreSQL on your desktop > machine in exactly the same way as the RPM got built > (integer_datetimes etc). It'd probably be much easier to just install the -contrib RPM. :) -- -Doug ---

Re: [GENERAL] Trying to understand encoding.

2008-02-15 Thread Douglas McNaught
On 2/15/08, Tomás Di Doménico <[EMAIL PROTECTED]> wrote: > Now I have the data into the UTF8 DB, and using graphical clients > everything seems to be great. The thing is, when I query the data via > psql, with \encoding UTF8 I get weird data ("NeuquÃ(c)n" for "Neuquén"). > However, with \encod

Re: [GENERAL] PG quitting sporadically!!

2008-02-14 Thread Douglas McNaught
> > Be aware that when 8.2.3 was released, 8.2 had only been out for two > > months. There's another 11 months worth of accumulated bug fixes in > > 8.2.6, including some that can cause the server to slow or crash. It's > > not a difficult upgrade (no changes to the database) and you shoul

Re: [GENERAL] Log file permissions?

2008-01-31 Thread Douglas McNaught
On 1/31/08, Glyn Astill <[EMAIL PROTECTED]> wrote: > I've noticed that by default postgres writes its log files read/write > only by the postgres user. > > I have a nagios user I want to be able to analyse the logs. > > Is there a way to make postgres output them so they can be read by a > group? O

Re: [GENERAL] close connection

2008-01-28 Thread Douglas McNaught
On 1/28/08, Dominique Bessette - Halsema <[EMAIL PROTECTED]> wrote: > > > > I dont really understand the question but here's an xml example of what is > getting posted to postgres, and i'm trying to figure out how to do a > connection.close() type of thing in it. > > Postgres doesn't have a built-

Re: [GENERAL] Finding bad bye in "invalid byte sequence" error

2007-12-14 Thread Douglas McNaught
On 12/13/07, robert <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm trying to hack my inserts script from mssql to work with postgres > 8.1.9 - I can upgrade if need be. I'm getting this error: > > psql -h localhost atdev < fuk2.sql > ERROR: invalid byte sequence for encoding "UTF8": 0xe1204f > HINT:

Re: [GENERAL] Would it be OK if I put db file on a ext2 filesystem?

2007-12-12 Thread Douglas McNaught
On 12/12/07, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Regular database files need metadata journalling (data=writeback mount > option for ext3). This is quite faster than full-blown journalling > which is what you get with default ext3 mount options. WAL files > (pg_xlog) do not need any kind

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Douglas McNaught
On 12/10/07, Ted Byers <[EMAIL PROTECTED]> wrote: > OK. A worry. How is template_postgis constructed? > Is it just a handy reference to template1? Or does it > exist independantly? I don't want to be dropping > template1 only to find that breaking template_postgis. All databases are separate

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Douglas McNaught
On 12/10/07, Ted Byers <[EMAIL PROTECTED]> wrote: > So, how do I determine whether or not template1 really > exists on my server and is a copy of template0 (as I'd > infer from what I see in postgres) rather than > template_postgis, and then modify things so that the > default is the normal templa

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Douglas McNaught
On 12/10/07, Ted Byers <[EMAIL PROTECTED]> wrote: > > Where will I find template1? When I look at the > databases on the server, the only template I see is > called "template_postgis". Most of the extra stuff I > see in all my databases relates to geometry that I > find in this template. When I

Re: [GENERAL] Connection idle broken

2007-11-27 Thread Douglas McNaught
On 11/27/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Nov 27, 2007 12:33 PM, Douglas McNaught <[EMAIL PROTECTED]> wrote: > > Get a better router then. Something between your clients and the > > database server is timing out those connections, and it'

Re: [GENERAL] Connection idle broken

2007-11-27 Thread Douglas McNaught
On 11/27/07, Fernando Xavier <[EMAIL PROTECTED]> wrote: > > > Hi, thanks for reply! > > No, my router don't have configurations for timeout connections.. Get a better router then. Something between your clients and the database server is timing out those connections, and it's most likely that box-

Re: [GENERAL] Connection idle broken

2007-11-27 Thread Douglas McNaught
On 11/27/07, Fernando Xavier <[EMAIL PROTECTED]> wrote: > > Hi, > > I have trouble with my java application. Since i change the network > configuration, the postgresql idle connections broken after 10 minutes. (i > set authentication_timeout = 600 in postgresql.conf). > > My network: > > 192.168.1

Re: [GENERAL] Sharing static data among several databases

2007-11-18 Thread Douglas McNaught
"Robert James" <[EMAIL PROTECTED]> writes: > 1.) Is there a way of separating, isolating, and sharing the shared data that > will still allow FKs to it? The only approach I know of would be to make all your customers use independent schemas in one database, with isolation via appropriate permissi

Re: [GENERAL] postgres 8 on solaris 9

2007-11-16 Thread Douglas McNaught
Thomas Finneid <[EMAIL PROTECTED]> writes: > Hi > > I need to run latest Pg, i.e. 8.x, on a solaris 9 sparc machine, does > anybody know of any prepackaged pg for that or any documentation that > discusses compiling the source on such a machine. The Sun site only > discusses how to do this in sola

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Douglas McNaught
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > On Nov 12, 2007 11:37 AM, Sam Mason <[EMAIL PROTECTED]> wrote: >> And what's the performance hit of using native 64bit code? I'd guess >> similar, moving twice as much data around with each pointer has got to >> affect things. > > That's not been my

Re: [GENERAL] Securing stored procedures and triggers

2007-10-31 Thread Douglas McNaught
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > On 10/31/07, Douglas McNaught <[EMAIL PROTECTED]> wrote: > >> The only bulletproof way to do this currently is to write all your >> stored functions in C and load them as a shared library. > > Well, as I

Re: [GENERAL] Securing stored procedures and triggers

2007-10-31 Thread Douglas McNaught
mgould <[EMAIL PROTECTED]> writes: > We are currently migrating from Sybase's ASA 9/10 to PostGres 8.2.4. > One of the features that is really nice in ASA is the ability to add > the attribute hidden to a Create procedure, Create function and > Create trigger. Essentially what this does is encryp

Re: [GENERAL] configure password

2007-10-31 Thread Douglas McNaught
João Paulo Zavanela <[EMAIL PROTECTED]> writes: > Thanks, but I need configure password to connect to server! > Now the pg_hba.conf is trust, I need change to passwd. > Changing the file to passwd, I don't know how configure password to connect! Set pg_hba.conf to 'trust', connect and use ALTER U

Re: [GENERAL] function and passing the table name to be used with SQL stmnt

2007-10-30 Thread Douglas McNaught
kamiseq <[EMAIL PROTECTED]> writes: > select into _id lastval(); > and is that safe operation, can I rely on lastval() that it will > return value of id that was inserted before? You want to use currval() with the sequence name. > can it happened that other user will insert something betwe

Re: [GENERAL] pg_restore

2007-10-29 Thread Douglas McNaught
Bob Pawley <[EMAIL PROTECTED]> writes: > Following the examples in the docs I've come to this. > > I am attempting to restore the existing sql dump using > psql -d PDW -f aurel.sql > > I am then asked for a password. > > I try every password that the computer knows with no success. > > Funny thing

Re: Re : Re : [GENERAL] pg_dump SERIAL and SEQUENCE

2007-10-18 Thread Douglas McNaught
Laurent ROCHE <[EMAIL PROTECTED]> writes: > Not good because in that case pg_dump will generate code that can not run in > 8.1 ... like : > > ALTER SEQUENCE ... OWNED BY Dumps produced by version X of pg_dump have never been guaranteed to load into earlier versions. -Doug --

Re: [GENERAL] starting a stored procedure+rule AFTER an insert

2007-10-08 Thread Douglas McNaught
"Bima Djaloeis" <[EMAIL PROTECTED]> writes: > I have implemented a stored procedure that writes out the newest DB > entry on insert, and combined it with a rule. > > 1) create function newcache() returns void AS 'newCache', 'newCache' language > c; > 2) create rule newcacherule AS on insert to cac

Re: [GENERAL] Execution plan caching

2007-10-02 Thread Douglas McNaught
"Philippe Lang" <[EMAIL PROTECTED]> writes: > Hi, > > I have recently used the MS SQL Server 2005 database, and found out that > there is no mecanism where an execution plan can be reused between two > successive calls to a view. This is only true with stored procedures. > > Is that also true with

Re: [GENERAL] trying to migrate to a new server.

2007-09-24 Thread Douglas McNaught
David Siebert <[EMAIL PROTECTED]> writes: > I have a very old postgres server that I am trying to move the data off > of. It is running 7.1 and has been trouble free for 6 plus years. > I am trying to move the data base off to a server running 8.1. > I have managed to back up the data using PG_Dum

Re: [GENERAL] Enterprise Wide Deployment

2007-08-17 Thread Douglas McNaught
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Scott Marlowe wrote: >> On 8/14/07, john_sm <[EMAIL PROTECTED]> wrote: >>> Hey guys, for an enterprise wide deployment, what will you suggest and why >>> among - Red Hat Linux, Suse Linux and Ubuntu Linux, also, do you think, we >>> can negotiate the

Re: [GENERAL] PostgreSQL clustering (shared disk)

2007-08-16 Thread Douglas McNaught
Devrim GÜNDÜZ <[EMAIL PROTECTED]> writes: >> What I'm pondering here is that is the cluster able to keep the >> postmasters synchronized at all times so that the database won't get >> corrupted. > > Keep all the $PGDATA in the shared disk. That would minimize data loss > (Of course, there is stil

Re: [GENERAL] SELECT ... FOR UPDATE performance costs? alternatives?

2007-08-16 Thread Douglas McNaught
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes: > I need logic like "atomic test and set" or pop 1 item off the queue > atomically and tell me what that item was. > > In my situation, there are a dozen or so machines polling this queue > periodically looking for work to do. As more polling is occu

Re: [GENERAL] Linux distro

2007-08-01 Thread Douglas McNaught
"Brian Mathis" <[EMAIL PROTECTED]> writes: > Please don't start this. These issues are exactly why one should be > looking at an ENTERPRISE OS for a server. Fedora, ubuntu, etc... are > not enterprise OSes, and any discussion of such issues are certainly > off-topic for this mailing list. An en

Re: [GENERAL] Linux distro

2007-08-01 Thread Douglas McNaught
Joseph S <[EMAIL PROTECTED]> writes: > My small gripes about Ubuntu are: > 1) rpm, for all its faults, is still better than using apt You *must* be joking. In Debian and Ubuntu, I've never had a tenth of the dependency hell that you regularly hit with RPMs (though yum has improved things somew

Re: [GENERAL] Performance Question - Table Row Size

2007-07-12 Thread Douglas McNaught
Mike <[EMAIL PROTECTED]> writes: > I see. Thank you for the elaborate response. I have a clearer idea of > what is going on now. In designing my application I was thinking of > storing pieces of my data as serialized python data structures into a > binary field (no more than 15KB), while a friend

Re: [GENERAL] Dynamically Allocated System Resources

2007-05-01 Thread Douglas McNaught
Brad Nicholson <[EMAIL PROTECTED]> writes: > Running PG8.1 - will it recognize CPU and memory that are added > dynamically to the server when the postmaster is running? Depends somewhat on the OS. If it allows existing processes to be scheduled on newly added CPUs, then existing backends will be

Re: [GENERAL] Upgrading a 32-bit build to a 64-bit build

2007-04-20 Thread Douglas McNaught
"Steven Flatt" <[EMAIL PROTECTED]> writes: > I can't seem to find an answer to this. > > If I upgrade a 32-bit Postgres build to a 64-bit Postgres build > (same version), will the data files be compatible or do I have to do > a dump and restore of the database? They will not be compatible. > I

Re: [GENERAL] using 'ALTER ROLE' in a function

2007-03-22 Thread Douglas McNaught
Lutz Broedel <[EMAIL PROTECTED]> writes: > ERROR: Error »syntax error« at »$1« at character 13 > QUERY: ALTER ROLE $1 WITH ENCRYPTED PASSWORD $2 > > I have tried this in several ways and it seems, ALTER ROLE just does > not accept a parameter instead of name. Does anybody have a solution > fo

Re: [GENERAL] Configuring phpPgAdmin and pg_ctl reload

2007-03-22 Thread Douglas McNaught
John Meyer <[EMAIL PROTECTED]> writes: > Maybe it was just understood, but I was typing in word for word the > entry from pg_hba.conf, but I'll keep that for reference later on. pg_ctl needs either the data directory supplied on the command line, or PGDATA set in the environment, which reading th

Re: [GENERAL] exception handling in plperlu

2007-03-16 Thread Douglas McNaught
"Jasbinder Singh Bali" <[EMAIL PROTECTED]> writes: > just wondeng why doesn't it let me put > my $dbh=DBI->connect("dbi:Pg:dbname=dbunmask; host=192.168.0.120; port=5432;", > "", ""); > in eval > > says > Global symbol "$dbh" requires explicit package name at line used> The my() variable goes ou

Re: [GENERAL] Automating access grants

2007-03-15 Thread Douglas McNaught
I would still recommend making it available as a web service rather than giving direct access; besides the security/load issues, it lets you change the representation of the data without necessarily affecting customers (of course, you can do this also at the DB level with views). The web service i

Re: [GENERAL] Automating access grants

2007-03-15 Thread Douglas McNaught
"Kynn Jones" <[EMAIL PROTECTED]> writes: > We have an in-house Postgres database that we would like to make > publicly accessible via a password-less login (user: anonymous). (We > already have a web front-end for this database, but we have had a lot > of requests to allow programmatic access in

Re: [GENERAL] DBD::Pg/perl question, kind of...

2007-03-12 Thread Douglas McNaught
Neal Clark <[EMAIL PROTECTED]> writes: > comments? Looks like the right idea. If you have a lot of rows to process, you'll benefit by fetching in batches, e.g. my $sth = $dbh->prepare(qq{FETCH FORWARD 1000 FROM my_cur}); # iterate through the result set here -Doug ---

Re: [GENERAL] DBD::Pg/perl question, kind of...

2007-03-12 Thread Douglas McNaught
"Albe Laurenz" <[EMAIL PROTECTED]> writes: > So there is no automatic way of handling it. > > You will probably have to consider it in your code and use > SELECT-Statements > with a LIMIT clause. Either that, or explicitly DECLARE a CURSOR and use FETCH from that cursor in batches. You can do th

Re: [GENERAL] psql client quits after 1st command

2007-03-02 Thread Douglas McNaught
Vincenzo Romano <[EMAIL PROTECTED]> writes: > Hi all. > > Under Linux I'm trying to communicate to an instance of the psql client > running in the background through a couple of named pipes. > I'd like to do something like this: > > $ mkfifo /tmp/pg_ipipe /tmp/pg_opipe > $ psql -d testdb -U testus

Re: [GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread Douglas McNaught
novnov <[EMAIL PROTECTED]> writes: > I am trying to connect to a postgres 8.1 installation on a ubuntu box from > windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file > HINT see server log for details. > > The server ip address is 192.168.1.10. The workstation ip address is >

Re: [GENERAL] Trouble w/plperl sproc on red hat 9

2007-02-10 Thread Douglas McNaught
Kenneth Downs <[EMAIL PROTECTED]> writes: > Not sure if this one is fixable, but a user of my GPL'd package was > unable to run our install. > > Eventually we pinned it down to a failed load of a sproc written in > plperl. He says he's running a Red Hat 9 system with Postgres 8.1 and > perl is 5.

Re: [GENERAL] Load balancing across disks

2007-01-28 Thread Douglas McNaught
Paul Lambert <[EMAIL PROTECTED]> writes: > I.e. can I create a data file on D drive which holds tables a, b and > e, and a data file on E drive which holds tables c, d and f. > > If this is possible, could someone point me to some documentation so I > can experiment a little. Read the doc section

Re: [GENERAL] counting query

2007-01-28 Thread Douglas McNaught
"Joris Dobbelsteen" <[EMAIL PROTECTED]> writes: > So perhaps What would have been better without surrogate keys > all-over should have been "My database where I extremely overdid > it with surrogate keys". Fair enough. It's generally true that going to extremes with anything causes problems. :)

Re: [GENERAL] counting query

2007-01-28 Thread Douglas McNaught
"Joris Dobbelsteen" <[EMAIL PROTECTED]> writes: > What would have been better without surrogate keys all-over: > * Easier to write complex queries with much fewer tables to be queried. > * Much faster query performance, as fewer tables need to be referenced. > * Better integrity enforcement with s

Re: [GENERAL] Speaking of upgrades...

2007-01-26 Thread Douglas McNaught
Ron Johnson <[EMAIL PROTECTED]> writes: > How much does the on-disk structure of *existing* tables and indexes > change between x.y versions? > > Between, for example, 8.0 and 8.2? Enough to require a dump/reload in order to upgrade. :) Within major versions (8.2.0, 8.2.1, etc) the files are co

Re: [GENERAL] sequence increment jumps?

2007-01-25 Thread Douglas McNaught
Benjamin Smith <[EMAIL PROTECTED]> writes: > On Thursday 25 January 2007 09:53, Douglas McNaught wrote: >> Nature of the beast.  Sequence increments aren't rolled back on >> transaction abort (for performance and concurrency reasons), so you >> should expect gaps.

Re: [GENERAL] sequence increment jumps?

2007-01-25 Thread Douglas McNaught
"John Smith" <[EMAIL PROTECTED]> writes: > i had insert errors yesterday ("ERROR: invalid input syntax for > integer" "ERROR: column 'columnname' is of type date but expression is > of type integer") but they didn't cause any increment jumps. and when > i insert a record now the sequence increment

Re: [GENERAL] Installing PostgreSQL under Cpanel

2007-01-24 Thread Douglas McNaught
Have you read http://www.postgresql.org/docs/8.2/static/tutorial.html ?? If there are specific parts in there that are unclear or missing I'm sure the developers would be happy to know. -Doug ---(end of broadcast)--- TIP 9: In versions below 8.0,

Re: [GENERAL] Permission problem with create tablespace

2006-10-16 Thread Douglas McNaught
"Andras Simon" <[EMAIL PROTECTED]> writes: > I'm trying to create a new tablespace in a directory that postgres > owns, but PG says it cannot set permissions on this directory. ... > This is on Fedora Core 5 (x86), psql 8.1.4. SELinux, most likely. -Doug ---(end of br

Re: [GENERAL] server closed the connection unexpectedly

2006-10-06 Thread Douglas McNaught
"Mark Greenbank" <[EMAIL PROTECTED]> writes: > 1) I'm assuming that if I update 7.3.2 to 7.3.15 I can leave the data in place > (that is, without doing a dump/restore) -- is this correct? Yes--minor releases don't require dump/restore. > 2) If I up upgrade to 8.x can just copy the data files or

Re: [GENERAL] Installing on Redhat 7.2

2006-08-30 Thread Douglas McNaught
"Dennis Reaves" <[EMAIL PROTECTED]> writes: > Hello all! > > I'm trying to install postgresql and I'm getting the following error; > > error: failed dependencies: > libc.so.6(GLIBC_2.3) is needed by postgresql-8.1.4-3PGDG > libcrypto.so.4 is needed by postgresql-8.1.4-3PGDG

Re: [GENERAL] database files are incompatible with server, after

2006-08-29 Thread Douglas McNaught
CSN <[EMAIL PROTECTED]> writes: > I don't know which to run now! I tried both > '/opt/local/lib/pgsql8/bin/pg_ctl start -D pgdata' and You might want an absolute path for 'pgdata' here--have you tried that? > putting /opt/local/lib/pgsql8/bin before > /usr/local/bin in PATH and still get the sa

Re: [GENERAL] database files are incompatible with server, after

2006-08-29 Thread Douglas McNaught
CSN <[EMAIL PROTECTED]> writes: > I don't think so -- I followed the instructions here: > > http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx > > But looking around, I see there's a pg_ctl in > /usr/local/bin, but 'port contents postgresql8' shows > a pg_ctl

  1   2   3   >