Re: [GENERAL] STDERR vs. SYSLOG logging

2007-05-01 Thread David Fetter
On Tue, May 01, 2007 at 09:12:41AM -0600, Kevin Kempter wrote: > Hi List; > > Anyone have any thoughts per which logging method (SYSLOG vs STDERR) > is the better approach ? > > Thanks in advance... I prefer syslog because those logs are better suited for processing by pgfouine and tools like it

[GENERAL] Utility of OIDs in postgres

2007-05-01 Thread Jasbinder Singh Bali
Hi, What would be the benefit of creating tables with OIDs as against one's not with OIDs Giving a unique identifier to each row inserted has some extra efficiency factor involved or what. Thanks, Jas

[GENERAL] Postgres (selection of thesis topic)

2007-05-01 Thread Harpreet Dhaliwal
Hi, I'm kind of new to postgresql and the project that I'm working on currently deals with parsing emails, storing parsed components in postgresql DB and fire triggers on certain inserts that opens socket connection with a unix tools server, initiates tools like whois, traceroute etc and unix tool

Re: [GENERAL] pgsql and Mac OS X

2007-05-01 Thread Michael Glaesemann
On May 1, 2007, at 22:33 , Eddy D. Sanchez wrote: I had problem with mac ports, and I decide install Xcode for libraries and compile postgres from scratch, it works fine, without any problem with libraries. MacPorts requires the Xcode Developer Tools, so that may have been your problem.

Re: [GENERAL] IF function?

2007-05-01 Thread Eddy D. Sanchez
You must use CASE var=val2 THEN [true statement] ELSE [false statement] END ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] pgsql and Mac OS X

2007-05-01 Thread Eddy D. Sanchez
I've got PostgreSQL Client and server on my MacBook, just compiling the last source code without problem, and I work with last PgAdmin. I had problem with mac ports, and I decide install Xcode for libraries and compile postgres from scratch, it works fine, without any problem with libraries

Re: [GENERAL] multidimensional arrays

2007-05-01 Thread Tom Lane
Ketema <[EMAIL PROTECTED]> writes: > Is it possible to access a subarray of a multi dimensional array as a > whole? I think you want an array slice (ie, something with some colons in the subscripts). See the manual: http://www.postgresql.org/docs/8.2/static/arrays.html re

Re: [GENERAL] PostgreSql replication and load balancing ( is Slony-I a solution?)

2007-05-01 Thread Jamie Deppeler
Alexander Staubo wrote: On 5/1/07, Jan Bilek <[EMAIL PROTECTED]> wrote: Is Slony-I capable of load balancing and how to set it up? We searched the web and some people mentioned that Slony-I could do load balancing, but haven't found how to make Slony-I to do it. You might want to check pgclus

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Rich Shepard
On Tue, 1 May 2007, Dann Corbit wrote: For postal addressing, this is a really good reference site: http://www.columbia.edu/kermit/postal.html Thank you. Frank did/does an outstanding job with Kermit, and that's a very useful language for serial communications among data collecting devices a

[GENERAL] multidimensional arrays

2007-05-01 Thread Ketema
Is it possible to access a subarray of a multi dimensional array as a whole? example: '{ { {1,2,3}, {11,22,33}, {111,222,333} }, { {4,5,6}, {44,55,66}, {444,555,666} }, { {7,8,9}, {77,88,99}, {777,888,999}

Re: [GENERAL] PG Books

2007-05-01 Thread Paul Lambert
Guillaume Lelarge wrote: Paul Lambert a écrit : I've come across a couple of books on PG that appear interesting and was wondering if others have read them and what their thoughts are. (Excuse me if this topic has already been covered previously) Practical PostgreSQL - Command Prompt PostgreS

Re: [GENERAL] PG Books

2007-05-01 Thread Paul Lambert
Listmail wrote: loaded by a single application and used by our customers with MS Access, From by previous job where we had an Access based backoffice application, you might want to learn enough to be ready to switch to something better (ie postgres) when you feel the need. I think yo

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Dann Corbit
For postal addressing, this is a really good reference site: http://www.columbia.edu/kermit/postal.html ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] IF function?

2007-05-01 Thread novnov
I see...well, that's excellent. Thanks to all who responded. Reece Hart wrote: > > On Tue, 2007-05-01 at 07:38 -0700, novnov wrote: >> I didn't express myself clearly. Is there an IIF type function one can >> use >> inline in a view? >> >> SELECT UserName, IIF(mybooleanfield = true, "It's tru

Re: [GENERAL] PostgreSql replication and load balancing ( is Slony-I a solution?)

2007-05-01 Thread Jan Bilek
On 5/1/07, Jan Bilek <[EMAIL PROTECTED]> wrote: Is Slony-I capable of load balancing and how to set it up? We searched the web and some people mentioned that Slony-I could do load balancing, but haven't found how to make Slony-I to do it. Slony does not do load balancing. Personally, I recomme

Re: [GENERAL] IF function?

2007-05-01 Thread Reece Hart
On Tue, 2007-05-01 at 07:38 -0700, novnov wrote: > I didn't express myself clearly. Is there an IIF type function one can > use > inline in a view? > > SELECT UserName, IIF(mybooleanfield = true, "It's true", "It's not > true") as > SayIt FROM tblUser I think people understood you. The part tha

Re: [GENERAL] STDERR vs. SYSLOG logging

2007-05-01 Thread Jeff Davis
On Tue, 2007-05-01 at 09:12 -0600, Kevin Kempter wrote: > Hi List; > > Anyone have any thoughts per which logging method (SYSLOG vs STDERR) is the > better approach ? > One isn't better or worse than the other. Where are you able to see the logs more easily? STDERR can be redirected to log file

Re: [GENERAL] HP/Pgsql/DBD::Pg issue

2007-05-01 Thread Ed L.
On Tuesday 01 May 2007 2:46 pm, Ed L. wrote: > It is indeed a local connection using PGHOST=`hostname`.  That > name maps to one of the external NIC IPs, not to the normal > 127.0.0.1 loopback address.  For context, I've seen this a > number of times over the past couple years, from pgsql 7.3.x > t

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Tom Lane
Alexander Kuprijanov <[EMAIL PROTECTED]> writes: > % pg_dump -d test_a --table=b -F c -v -f b.backup That syntax doesn't actually work in any reasonably modern version of pg_dump ... what are you really typing? (-d is not a switch for specifying the database name.) But at any rate, I still can't

Re: [GENERAL] HP/Pgsql/DBD::Pg issue

2007-05-01 Thread Ed L.
On Tuesday 01 May 2007 2:23 pm, Tom Lane wrote: > Well, it's going wrong here: > > socket(AF_INET, SOCK_STREAM, 0) .. = 4 > setsockopt(4, 0x6, TCP_NODELAY, 0x9fffe210, 4) ... = 0 > fcntl(4, F_SETFL, 65536) . = 0 > fcntl(4, F_SETFD, 1)

Re: [GENERAL] HP/Pgsql/DBD::Pg issue

2007-05-01 Thread Tom Lane
"Ed L." <[EMAIL PROTECTED]> writes: > Attached is a small tar.gz file containing a short perl DBI > connection script that repeatedly demonstrates this problem. > There are also two log files containing tusc output (an HP > syscall trace utility), one for the 32-bit run (which works) and > ano

Re: [GENERAL] PostgreSql replication and load balancing ( is Slony-I a solution?)

2007-05-01 Thread Alexander Staubo
On 5/1/07, Jan Bilek <[EMAIL PROTECTED]> wrote: Is Slony-I capable of load balancing and how to set it up? We searched the web and some people mentioned that Slony-I could do load balancing, but haven't found how to make Slony-I to do it. Slony does not do load balancing. Personally, I recommen

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Andrew - Supernews
On 2007-04-30, "John D. Burger" <[EMAIL PROTECTED]> wrote: > Andrew - Supernews wrote: > >>> Anyone have any ideas on how to handle a work queue? >> >> Advisory locks (userlocks in pre-8.2). > > Can someone explain why these are a better fit than whatever locks > SELECT FOR UPDATE acquires? They

Re: [GENERAL] Questions about TSearch2 and PG 8.2

2007-05-01 Thread Robert Treat
On Monday 30 April 2007 13:20, Markus Wollny wrote: > Hello! > > I'm in the process of upgrading our PostgreSQL 8.1 databases to PostgreSQL > 8.2.4. I have stumbled over a minor issue with the upgrade and some helpful > suggestions here: > http://people.planetpostgresql.org/xzilla/index.php?/archiv

Re: [GENERAL] HP/Pgsql/DBD::Pg issue

2007-05-01 Thread Ed L.
On Thursday 26 April 2007 9:42 am, Tom Lane wrote: > "Ed L." <[EMAIL PROTECTED]> writes: > > After a reboot (and usually after an OS patch) on our HP-UX > > 11.23 64-bit Itanium DB servers, our libpq/DBD::Pg libraries > > cease to work. Instead, they give the standard message you > > get when the

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Dann Corbit
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Rich Shepard > Sent: Tuesday, May 01, 2007 10:42 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] CHECK() Constraint on Column Using Lookup Table > >I've seen the syntax for

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Alexander Kuprijanov
On Tuesday 01 May 2007 20:02:55 Tom Lane wrote: > Alexander Kuprijanov <[EMAIL PROTECTED]> writes: > > On Tuesday 01 May 2007 18:43:37 Tom Lane wrote: > >> Works for me. Perhaps your table name is mixed-case and you didn't > >> quote it correctly? Have you tried 'pg_restore -l' to verify what > >

Re: [GENERAL] Dynamically Allocated System Resources

2007-05-01 Thread Andrej Ricnik-Bay
On 5/2/07, Brad Nicholson <[EMAIL PROTECTED]> wrote: Running PG8.1 - will it recognize CPU and memory that are added dynamically to the server when the postmaster is running? I thought that was a job for the underlying OS? Cheers, Andrej ---(end of broadcast)--

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] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Michael Glaesemann
On May 1, 2007, at 12:41 , Rich Shepard wrote: I've seen the syntax for using a lookup table in a CHECK() constraint, but I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs. I'm not sure I follow. Generally if one has a column the value of which belongs to a lim

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Rich Shepard
On Tue, 1 May 2007, Joshua D. Drake wrote: You could use a function, or a foreign key. Josh, The foreign key approach will do nicely. Thanks, Rich -- Richard B. Shepard, Ph.D. |The Environmental Permitting Applied Ecosystem Services, Inc.| Accelerator(T

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread A. Kretschmer
am Tue, dem 01.05.2007, um 10:41:44 -0700 mailte Rich Shepard folgendes: > I've seen the syntax for using a lookup table in a CHECK() constraint, but > I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs. > > Specifically, I want to reference a table of ISO 2-letter cod

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Richard Broersma Jr
--- Rich Shepard <[EMAIL PROTECTED]> wrote: >I've seen the syntax for using a lookup table in a CHECK() constraint, but > I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs. > >Specifically, I want to reference a table of ISO 2-letter codes for US > states and Can

Re: [GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Joshua D. Drake
Rich Shepard wrote: I've seen the syntax for using a lookup table in a CHECK() constraint, but I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs. Specifically, I want to reference a table of ISO 2-letter codes for US states and Canadian provinces/territories in a ta

[GENERAL] Dynamically Allocated System Resources

2007-05-01 Thread Brad Nicholson
Running PG8.1 - will it recognize CPU and memory that are added dynamically to the server when the postmaster is running? -- Brad Nicholson 416-673-4106 Database Administrator, Afilias Canada Corp. ---(end of broadcast)--- TIP 1: if posting/readin

[GENERAL] CHECK() Constraint on Column Using Lookup Table

2007-05-01 Thread Rich Shepard
I've seen the syntax for using a lookup table in a CHECK() constraint, but I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs. Specifically, I want to reference a table of ISO 2-letter codes for US states and Canadian provinces/territories in a table with name and addr

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Merlin Moncure
On 5/1/07, Alban Hertroys <[EMAIL PROTECTED]> wrote: Whether that improves your performance pretty much depends on the queue sizes, the frequency of processing and the load processing causes... Heh, I just realize we have a work queue table here as well, I'd like to know the result. the optimiz

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Alban Hertroys
Merlin Moncure wrote: > take another look at my example. there are two things happening that > have to be logically combined into one operation. one is checking the > last_value column of two sequences and the other is the nextval(). > the advisory lock protects against this: > > session a: worke

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Tom Lane
Alexander Kuprijanov <[EMAIL PROTECTED]> writes: > On Tuesday 01 May 2007 18:43:37 Tom Lane wrote: >> Works for me. Perhaps your table name is mixed-case and you didn't >> quote it correctly? Have you tried 'pg_restore -l' to verify what >> is in the dump file? > no, tablenames not mixed, all s

Re: [GENERAL] IF function?

2007-05-01 Thread Erik Jones
On May 1, 2007, at 12:57 AM, David Fetter wrote: On Mon, Apr 30, 2007 at 10:51:36PM -0700, novnov wrote: Does postgresql have a built in IF function that allows one to eval a condition and return one or another value? Like: IIF(mybooleanfield = true, "It's true", "It's not true") It has CAS

[GENERAL] PostgreSql replication and load balancing ( is Slony-I a solution?)

2007-05-01 Thread Jan Bilek
Hello, We're building database system with replication. Slony-I seems to be a quite good solution for the replication, but beside the replication (master-to-multiple slaves), we need load balancing aswell - multiple users will access the database at the same time=multiple queries. Is Slony-I ca

[GENERAL] STDERR vs. SYSLOG logging

2007-05-01 Thread Kevin Kempter
Hi List; Anyone have any thoughts per which logging method (SYSLOG vs STDERR) is the better approach ? Thanks in advance... ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] pgsql and Mac OS X

2007-05-01 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > Not having ARD3 myself, anyone happen to know which version of > PostgreSQL Apple's shipping with version 3? My ARD2 installation is > running 7.3.3. The Mini I bought last summer seems to have 7.3.10 installed on it. Don't know where to look to

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Merlin Moncure
On 5/1/07, Alban Hertroys <[EMAIL PROTECTED]> wrote: Merlin Moncure wrote: > ok, here's an example. I was thinking that my sequence idea might not > be safe because of race conditions revolving around querying the > sequence table. Here is how I might use advisory locks eliminate the I've seen

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Alexander Kuprijanov
On Tuesday 01 May 2007 18:43:37 Tom Lane wrote: > Alexander Kuprijanov <[EMAIL PROTECTED]> writes: > > but pg_restore dont want make its work... > > > > % pg_restore --dbname=BaseB --no-owner --table=TableA -v > > ./idstation.backup pg_restore: connecting to dat

Re: [GENERAL] pgsql and Mac OS X

2007-05-01 Thread Michael Glaesemann
On May 1, 2007, at 3:19 , Magnus Hagander wrote: Not being a Mac user myself, I do seem to recall having read somewhere that they changed this at some point. That early versions had it in 5432, but it was changed to 5433 in newer ones. What a guy :) From the Apple developer site: http://devel

Re: [GENERAL] IF function?

2007-05-01 Thread Raymond O'Donnell
On 01/05/2007 15:38, novnov wrote: I didn't express myself clearly. Is there an IIF type function one can use inline in a view? SELECT UserName, IIF(mybooleanfield = true, "It's true", "It's not true") as SayIt FROM tblUser That's what CASE is for: select case when mybooleanfield the

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Tom Lane
Alexander Kuprijanov <[EMAIL PROTECTED]> writes: > but pg_restore dont want make its work... > > % pg_restore --dbname=BaseB --no-owner --table=TableA -v ./idstation.backup > pg_restore: connecting to database for restore > pg_restore: implied data-only restore

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Alban Hertroys
Merlin Moncure wrote: > ok, here's an example. I was thinking that my sequence idea might not > be safe because of race conditions revolving around querying the > sequence table. Here is how I might use advisory locks eliminate the I've seen your name pop up regularly on this list (or are you fr

[GENERAL] Re: [HACKERS] SOS, help me please, one problem towards the postgresql developement on windows

2007-05-01 Thread Andrew Dunstan
[removing -hackers, as this question really doesn't seem to belong there] shieldy wrote: thankyou very much. but the method, you said, is adding a alias name, so it can not work. and as i need to add many functions likes this, so the best way is to compile the whole postgresql. eventhough, i d

Re: [GENERAL] IF function?

2007-05-01 Thread novnov
David Fetter wrote: > > On Mon, Apr 30, 2007 at 10:51:36PM -0700, novnov wrote: >> >> Does postgresql have a built in IF function that allows one to eval a >> condition and return one or another value? Like: >> >> IIF(mybooleanfield = true, "It's true", "It's not true") > > It has CASE, as in

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Merlin Moncure
On 4/30/07, John D. Burger <[EMAIL PROTECTED]> wrote: Can someone explain why [advisory locks] are a better fit than whatever locks SELECT FOR UPDATE acquires? ok, here's an example. I was thinking that my sequence idea might not be safe because of race conditions revolving around querying the

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Alexander Kuprijanov
On Tuesday 01 May 2007 14:41:38 Richard Huxton wrote: > Alexander Kuprijanov wrote: > > I do: > > == > > pg_dump -d BaseA --port=54321 --host=localhost --table=TableA --data-only > > -F c -v | pg_restore -d > > BaseB --data-only --no-owner --table=TableA --single-transaction -v > >

Re: [GENERAL] Processing a work queue

2007-05-01 Thread Merlin Moncure
On 4/30/07, John D. Burger <[EMAIL PROTECTED]> wrote: Andrew - Supernews wrote: >> Anyone have any ideas on how to handle a work queue? > > Advisory locks (userlocks in pre-8.2). Can someone explain why these are a better fit than whatever locks SELECT FOR UPDATE acquires? They are fast, and

Re: [GENERAL] PG Books

2007-05-01 Thread Rich Shepard
On Tue, 1 May 2007, Paul Lambert wrote: I've come across a couple of books on PG that appear interesting and was wondering if others have read them and what their thoughts are. (Excuse me if this topic has already been covered previously) Practical PostgreSQL - Command Prompt PostgreSQL - Bruce

Re: [GENERAL] [HACKERS] SOS, help me please, one problem towards the postgresql developement on windows

2007-05-01 Thread Martijn van Oosterhout
On Tue, May 01, 2007 at 08:18:16PM +0800, shieldy wrote: > but the method, you said, is adding a alias name, so it can not work. > and as i need to add many functions likes this, so the best way is to > compile the whole postgresql. eventhough, i did, it didnot work, so i am > puzzled, can add a fu

Re: [GENERAL] dump-restore only one table

2007-05-01 Thread Richard Huxton
Alexander Kuprijanov wrote: I do: == pg_dump -d BaseA --port=54321 --host=localhost --table=TableA --data-only -F c -v | pg_restore -d BaseB --data-only --no-owner --table=TableA --single-transaction -v == But wasn't updated why?? I'm not sure you can pipe the

[GENERAL] dump-restore only one table

2007-05-01 Thread Alexander Kuprijanov
Hello I have a stooped trable... I have equal bases and , and next table on each of them CREATE TABLE ( idstation int4 NOT NULL DEFAULT serial, ru_name varchar, en_name varchar, address varchar, <...other fields...> CONSTRAINT idstation_pkey PRIMARY KEY (idstation), CONSTRAIN

Re: [GENERAL] PG Books

2007-05-01 Thread Listmail
loaded by a single application and used by our customers with MS Access, From by previous job where we had an Access based backoffice application, you might want to learn enough to be ready to switch to something better (ie postgres) when you feel the need. Access is a booby trap setup

Re: [GENERAL] [HACKERS] SOS, help me please, one problem towards the postgresql developement on windows

2007-05-01 Thread Martijn van Oosterhout
On Mon, Apr 30, 2007 at 11:05:35AM +0800, shieldy wrote: > thankyou for your reply. > I added it to the backend, because the internal ones such as box_intersect() > function is keeped at there. so in my opinion, I just need to add a function > to the files, and then compile it. then we can use it a

Re: [GENERAL] Selecting from a function(x,y) returning a row-type(sum, prod)

2007-05-01 Thread Alban Hertroys
Tom Lane wrote: > "A. Kretschmer" <[EMAIL PROTECTED]> writes: >> am Mon, dem 30.04.2007, um 15:45:18 +0200 mailte Heiko Klein folgendes: >>> How can I do the following: >>> >>> select * from myvals, sum_n_product(myvals.x, myvals.y); > >> select x, y, sum_n_product(x,y) from myvals; > regression

Re: [GENERAL] pgsql and Mac OS X

2007-05-01 Thread Magnus Hagander
Tom Lane wrote: > Michael Glaesemann <[EMAIL PROTECTED]> writes: >> On Apr 30, 2007, at 16:39 , Tom Lane wrote: >>> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't >>> think >>> they intend it for general use --- it deliberately uses a nonstandard >>> port to avoid conflicting

Re: [GENERAL] PG Books

2007-05-01 Thread Guillaume Lelarge
Paul Lambert a écrit : I've come across a couple of books on PG that appear interesting and was wondering if others have read them and what their thoughts are. (Excuse me if this topic has already been covered previously) Practical PostgreSQL - Command Prompt PostgreSQL - Bruce Momjian [...]

[GENERAL] PG Books

2007-05-01 Thread Paul Lambert
I've come across a couple of books on PG that appear interesting and was wondering if others have read them and what their thoughts are. (Excuse me if this topic has already been covered previously) Practical PostgreSQL - Command Prompt PostgreSQL - Bruce Momjian I know Bruce and the CP folks