Re: [GENERAL] Creating views (Multiple Databases)

2006-02-01 Thread A. Kretschmer
am 01.02.2006, um 23:05:43 -0800 mailte Benjamin Arai folgendes: > Hi, > > Is it possible to create a view from two different database tables? -- Yes, with dblink 08:17 < akretschmer> ??dblink 08:17 < rtfm_please> For information about dblink 08:17 < rtfm_please> see http://developer.postgres

Re: [GENERAL] Creating views (Multiple Databases)

2006-02-01 Thread Michael Glaesemann
On Feb 2, 2006, at 16:05 , Benjamin Arai wrote: Is it possible to create a view from two different database tables? Yes. You can create a view out of any query (i.e., SELECT statement). For example, CREATE VIEW companies__members__view AS SELECT company.company_name, member.given_name, me

[GENERAL] Creating views (Multiple Databases)

2006-02-01 Thread Benjamin Arai
Hi, Is it possible to create a view from two different database tables?  -- Benjamin Arai [EMAIL PROTECTED] http://www.benjaminarai.com

Re: [GENERAL] postmaster startup time

2006-02-01 Thread Tom Lane
"Steve Oualline" <[EMAIL PROTECTED]> writes: > What's the longest time you'd expect between the execution of the=20 > postmaster command and being able to connec? Normal startup is a second or two on any modern hardware. If you have to recover from WAL, though, it could be very long. A rule of t

Re: [GENERAL] Stack Depth

2006-02-01 Thread Bob Pawley
Thanks Michael I'll keep this for future use. I beleive I was using insert into and update when I should have been using update only. Bob - Original Message - From: "Michael Fuhr" <[EMAIL PROTECTED]> To: "Bob Pawley" <[EMAIL PROTECTED]> Cc: "Bricklen Anderson" <[EMAIL PROTECTED]>;

Re: [GENERAL] Stack Depth

2006-02-01 Thread Michael Fuhr
On Wed, Feb 01, 2006 at 05:04:22PM -0800, Bob Pawley wrote: > I do think I have a recursive problem. It's just hard to see at the moment. RAISE is your friend. If you can't figure out where the recursion is coming from then add debugging output to the trigger functions to see what gets called whe

Re: [GENERAL] Stack Depth

2006-02-01 Thread Bob Pawley
Thanks all I do think I have a recursive problem. It's just hard to see at the moment. Bob - Original Message - From: "Michael Fuhr" <[EMAIL PROTECTED]> To: "Bricklen Anderson" <[EMAIL PROTECTED]> Cc: "Bob Pawley" <[EMAIL PROTECTED]>; "Postgresql" Sent: Wednesday, February 01, 200

Re: [GENERAL] Stack Depth

2006-02-01 Thread Michael Fuhr
On Wed, Feb 01, 2006 at 03:48:38PM -0800, Bricklen Anderson wrote: > Bob Pawley wrote: > >I understand the default stack depth is about 2 meg. How do I determine > >what the stack depth should be so that I avoid this error? > > check max_stack_depth in your postgresql.conf file Before mucking wi

Re: [GENERAL] Stack Depth

2006-02-01 Thread Paul Tillotson
Bob Pawley wrote: Hi Folks I have three triggers and associated functions that fire on one insert and moves row ID information to five different tables.. I am getting an error message "stack depth limit exceeded". [snip] You've almost certainly got a recursive trigger in there. The def

[GENERAL] postmaster startup time

2006-02-01 Thread Steve Oualline
Title: postmaster startup time What is the maximum time it takes for postmaster to start? Postmaster takes some time to open it's connections, process any WAL entries, and start accepting connections. What's the longest time you'd expect between the execution of the postmaster command

Re: [GENERAL] Stack Depth

2006-02-01 Thread Bricklen Anderson
Bob Pawley wrote: Hi Folks I have three triggers and associated functions that fire on one insert and moves row ID information to five different tables.. I am getting an error message "stack depth limit exceeded". Is this normal for, what I consider, a small amount of information transfer?

[GENERAL] Stack Depth

2006-02-01 Thread Bob Pawley
Hi Folks   I have three triggers and associated functions that fire on one insert and moves row ID information to five different tables..   I am getting an error message "stack depth limit exceeded".   Is this normal for, what I consider, a small amount of information transfer?   If so, how

Re: [GENERAL] NEW variable values in actions in rules

2006-02-01 Thread Tom Lane
"Ken Winter" <[EMAIL PROTECTED]> writes: > I have a table "person_h" with a not-null column "effective_date_and_time" > that defaults to CURRENT_TIMESTAMP. > I have a view "person" with the following rule defined on it: > CREATE RULE on_insert AS > ON INSERT TO person > DO INSTEAD (

Re: [GENERAL] NEW variable values in actions in rules

2006-02-01 Thread Ken Winter
Tom ~ Your answers (below) to my questions about the values of NEW columns in trigger functions was very clarifying for me (as well as being correct!). Now I'm having similar problems with NEW values in actions that are embedded in rules, and the answers don't seem to be the same. I have a table

[GENERAL] storing XML and querying

2006-02-01 Thread Matthew Terenzio
I'm looking into methods to store XML docs for query and retrieval across all the docs or subsets. I've looked over a couple of options and may end up creating relations with the data. Are there any "Super" solutions that I might be overlooking. Also, this article claims that these functions a

Re: [GENERAL] Postgres 8.1 for Mac

2006-02-01 Thread Vivek Khera
On Jan 31, 2006, at 4:57 PM, Jim C. Nasby wrote: There's also darwinports, which has 8.1.2. but does some idiotic bizarre weird strange install of the binaries into /opt/local/lib/pgsql8/bin/ and symlinks the psql program as psql8 into your normal bin directory. it is just painful to a

Re: [GENERAL] Best way to handle table trigger on update

2006-02-01 Thread Sven Willenberger
On Tue, 2006-01-31 at 13:45 -0600, Justin Pasher wrote: > Postgres 7.4.7 (I know, a little old, but we haven't had a chance to > upgrade) > > I have a table that stores menu items for a side navigation menu for a web > site. Each menu item has a "position" column set that determines where to > put

Re: [GENERAL] Building html documentation

2006-02-01 Thread Bruce Momjian
Jim Rosenberg wrote: > The instructions for building html documentation make the assumption that > docbook-dsssl (with perhaps other pieces) is already installed. As I'm fond > of saying, the assumption is a lethal weapon. > > Could some kind soul post a URL with *COMPLETE* instructions for what t

Re: [GENERAL] Concatenated VARCHAR becomes TEXT in view

2006-02-01 Thread MargaretGillon
>Martijn van Oosterhout wrote on 02/01/2006 11:00:50 AM: > On Wed, Feb 01, 2006 at 08:44:01AM -0800, [EMAIL PROTECTED] wrote: > > I have a view which I use to populate list boxes on several input screens > > in Visual FoxPro for Windows. In the view I concatenate three varchar > > columns to m

Re: [GENERAL] Best way to handle table trigger on update

2006-02-01 Thread Scott Ribe
I do something similar, and I have the front end generate updates to the position column of all rows, executed in a single transaction. Then you can fiddle around with the options and tradeoffs of how to ensure in the db that no update is accepted that violates the constraints... -- Scott Ribe [E

Re: [GENERAL] Concatenated VARCHAR becomes TEXT in view

2006-02-01 Thread Martijn van Oosterhout
On Wed, Feb 01, 2006 at 08:44:01AM -0800, [EMAIL PROTECTED] wrote: > I have a view which I use to populate list boxes on several input screens > in Visual FoxPro for Windows. In the view I concatenate three varchar > columns to make a new column. The concatenation works fine but the > resulting

[GENERAL] Building html documentation

2006-02-01 Thread Jim Rosenberg
The instructions for building html documentation make the assumption that docbook-dsssl (with perhaps other pieces) is already installed. As I'm fond of saying, the assumption is a lethal weapon. Could some kind soul post a URL with *COMPLETE* instructions for what to download and how to install i

Re: [GENERAL] libpq questions

2006-02-01 Thread Martijn van Oosterhout
On Wed, Feb 01, 2006 at 09:47:12AM +1100, James Harper wrote: > Now, given the current where clause, the client isn't going to see any > NULL values, but a change in the where clause might suddenly make the > calculated f field nullable. Maybe this doesn't matter and the client > application should

Re: [GENERAL] pg 8.1.2 ERROR: direct correlated subquery unsupported as initplan

2006-02-01 Thread Ed L.
On Monday January 30 2006 3:05 pm, Tom Lane wrote: > "Ed L." <[EMAIL PROTECTED]> writes: > > Just encountered this error on an 8.1.2 cluster: > > ERROR: direct correlated subquery unsupported as initplan > > Can you provide a test case for this? (No, the query text is > not enough.) Apparently n

Re: [GENERAL] Gotcha's in copying data between servers via file copy

2006-02-01 Thread Bruce Momjian
Frank Church wrote: > > I want to copy the data from one server to another. One is running Postgresql > 7.4.6 and the other 7.4.7. > > Are they any gotchas I should lookout for when making the copy? None. You can shutdown and do a binary copy of the filesystem, or use pg_dump or pg_dumpall. -

[GENERAL] Gotcha's in copying data between servers via file copy

2006-02-01 Thread Frank Church
I want to copy the data from one server to another. One is running Postgresql 7.4.6 and the other 7.4.7. Are they any gotchas I should lookout for when making the copy? ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignor

[GENERAL] Concatenated VARCHAR becomes TEXT in view

2006-02-01 Thread MargaretGillon
I have a view which I use to populate list boxes on several input screens in Visual FoxPro for Windows. In the view I concatenate three varchar columns to make a new column. The concatenation works fine but the resulting column is a text column, which becomes a memo field in Visual FoxPro. Memos d

Re: [GENERAL] Converting Text to Bytea

2006-02-01 Thread TJ O'Donnell
decode(your_string,'escape') will convert text to bytea You can just use this as a sort of type cast, or: 1. Create a new bytea column in your table 2. Update the table, setting the newcolumn = decode(oldcolumn,'escape') 3. Drop the oldcolumn (or not) TJ Date: Wed, 01 Feb 2006 10:04:36 + Fr

Re: [GENERAL] 8.0.3 regexp_replace()...

2006-02-01 Thread Stephan Szabo
On Tue, 31 Jan 2006, rlee0001 wrote: > I am suggesting that the behaviour of SUBSTRING returning NULL when no > matches is found is either a bug in PostgreSQL or a flaw in the SQL > specification. It is not logical. No, but sadly it seems to be what the SQL spec wants for its similar construct.

Re: [GENERAL] 8.0.3 regexp_replace()...

2006-02-01 Thread Tom Lane
"rlee0001" <[EMAIL PROTECTED]> writes: > My problem is with SUBSTRING. When it fails to find a match for the > regexp pattern within the source string it returns NULL. Why?! Because the SQL standard says so. Of course, you're free to wrap the built-in function in your own function that has behavi

Re: [GENERAL] Help in compiling 8.1.2 from source

2006-02-01 Thread Tom Lane
The Doctor <[EMAIL PROTECTED]> writes: > ns1# FATAL: database files are incompatible with server > DETAIL: The database cluster was initialized with HAVE_INT64_TIMESTAMP but > the server was compiled without HAVE_INT64_TIMESTAMP. > HINT: It looks like you need to recompile or initdb. > What

Re: [GENERAL] OID question

2006-02-01 Thread Chris Kratz
Thank you Tom for your concise response. Your explanation is very helpfull. We were aware of the wraparound issues, but this has worked so well for us that we haven't explored changing it yet. Having a unique identifier per row is most usefull in our situation and we didn't think we were anyw

Re: [GENERAL] Passwords when changing users -> roles

2006-02-01 Thread Adam Witney
On 1/2/06 3:04 pm, "Bruce Momjian" wrote: > Adam Witney wrote: >> >> Hi, >> >> I'm upgrading from 7.4.x to 8.1.x and I need to move my usernames over to >> the new roles. I can create the roles ok, but is there a way of transferring >> over the existing passwords, or do I have to create new pas

Re: [GENERAL] Passwords when changing users -> roles

2006-02-01 Thread Bruce Momjian
Adam Witney wrote: > > Hi, > > I'm upgrading from 7.4.x to 8.1.x and I need to move my usernames over to > the new roles. I can create the roles ok, but is there a way of transferring > over the existing passwords, or do I have to create new passwords for each > user/role? pg_dumpall should tran

Re: [GENERAL] help with locked table(s)/transactions(s)

2006-02-01 Thread Mott Leroy
Tom Lane wrote: No, the locks would be held till end of transaction. It is a little odd that you have so many conflicts, though, unless the referenced table is pretty small and/or this loop manages to touch a large fraction of the possible keys. Ah, well, if the locks are held to the end of th

Re: [GENERAL] Help in compiling 8.1.2 from source

2006-02-01 Thread Bruce Momjian
Do you have an old initdb in your path? When are you seeing this error message? During initdb? --- The Doctor wrote: > iHELP!! > > I compile postgresql 8.1.2 > > using: > ./configure \ > --prefix=/usr/local/pgsql \ >

Re: [GENERAL] Help in compiling 8.1.2 from source

2006-02-01 Thread Richard Huxton
The Doctor wrote: iHELP!! I compile postgresql 8.1.2 [snip] and Now I am getting: ns1# FATAL: database files are incompatible with server DETAIL: The database cluster was initialized with HAVE_INT64_TIMESTAMP but the server was compiled without HAVE_INT64_TIMESTAMP. HINT: It looks like y

Re: [GENERAL] OID question

2006-02-01 Thread Tom Lane
Chris Kratz <[EMAIL PROTECTED]> writes: > We aren't sure at this point if the problem we are having has to do with the > fact that we drop and reload the test db quite often and so we are running > into OID wraparound, or if it has to do with the fact that we recently went > to 8.1 on this test

Re: [GENERAL] 8.0.3 regexp_replace()...

2006-02-01 Thread rlee0001
Martijn, (Warning: This post contains somewhat of a long rant followed by a question.) I realize that NULL is the unknown value in SQL and that (most) functions therefore treat it as such. I have no problem with "RETURNS NULL ON NULL INPUT" except when a function returns NULL for no good reason.

Re: [GENERAL] libpq questions

2006-02-01 Thread James Harper
> On Tue, Jan 31, 2006 at 10:23:54PM +1100, James Harper wrote: > > For the libpq interface: > > > > I need to be able to know if a column in a result from a query is > > nullable or not. From reading the documentation it seems that I can > > obtain the following information: > > . scan all the row

Re: [GENERAL] Can't get the field = ANY(array) clause to work...

2006-02-01 Thread nboutelier
I set the array count to start at 1, but still not working. Im using v8. Ive also read that the ANY clause runs rediculously slow. Is there another way to convert an array into a record set without writing a separate function for that? Is it even possible to create a record set variable in a functi

[GENERAL] Help in compiling 8.1.2 from source

2006-02-01 Thread The Doctor
iHELP!! I compile postgresql 8.1.2 using: ./configure \ --prefix=/usr/local/pgsql \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --enable-debug \ --enable-depend \ --enable-cassert \ --enable-thread-safety \ --with-perl \ --with-openssl \ --with-gnu-ld

[GENERAL] Equivalent of a RECORD[] data type used in a function?

2006-02-01 Thread nboutelier
Is it possible to have a function variable hold a recordset? Kind of like this... DECLARE recordset_var RECORD[]; BEGIN recordset_var := (SELECT id FROM myTable); /* loop through a ton of different tables where column IN (recordset_var) */ END; Thanks for any help! -Nick -

[GENERAL] function returns setof column type problems

2006-02-01 Thread mmuurr[AT]gmail.com
hi all, i'm trying to figure out how to get the following test situation to work: creating a function like below fails... => CREATE FUNCTION test_function() RETURNS SETOF table.column%TYPE AS $$ SELECT 1; $$ LANGUAGE SQL; ERROR: syntax error at or near "%" at character 59 LINE 1: ...ate functio

Re: [GENERAL] help with locked table(s)/transactions(s)

2006-02-01 Thread Tom Lane
Mott Leroy <[EMAIL PROTECTED]> writes: > I'm still confused by the behavior however. The locking behaves as if > its some kind of *table* level lock, because while the function is > executing (a long time), a dozen updates and inserts build up waiting > for some lock to be released. If the loop

[GENERAL] Passwords when changing users -> roles

2006-02-01 Thread Adam Witney
Hi, I'm upgrading from 7.4.x to 8.1.x and I need to move my usernames over to the new roles. I can create the roles ok, but is there a way of transferring over the existing passwords, or do I have to create new passwords for each user/role? Thanks for any help adam -- This message has been s

Re: [GENERAL] help with locked table(s)/transactions(s)

2006-02-01 Thread Mott Leroy
Tom Lane wrote: SELECTs don't lock any rows. INSERTs don't create any lockable rows in themselves (other backends can't even see the rows yet). If that's all that your transaction is doing, then I think the only explanation is that the INSERTs are in a table that has foreign keys (correct?) an

[GENERAL] OID question

2006-02-01 Thread Chris Kratz
Hello all, We have a live server running on PG 8.0.3 which we backup on a regular bases by doing a pg_dumpall --oids. We have a test server currently running 8.1.1 where we reload that dumpall using psql. Now we have a history tracking system in the db which via triggers and rules keeps track

Re: [GENERAL] verifying database integrity - fsck for pg?

2006-02-01 Thread Guido Neitzer
On 31.01.2006, at 17:38 Uhr, Rich Doughty wrote: I'm not too fussed about a row-by-row comparison between the source and the copy. It's rather a case of a tool to check the datafiles' integrity (such as fsck, myisamchk, svnadmin verify etc). If the fact that pg_dumpall returned successfully

Re: [GENERAL] PostgreSQL 8.1 without readline and zlib

2006-02-01 Thread Richard Huxton
gfnobrega wrote: Hi, list! Exist some negative performance impact in compiling postgresql without libs readline and zlib? I was compiling in a HP PA-RISC with HP AnsiC compiler. http://www.postgresql.org/docs/8.1/static/install-procedure.html --without-readline Prevents use of the Readl

Re: [GENERAL] PostgreSQL 8.1 without readline and zlib

2006-02-01 Thread Bruce Momjian
gfnobrega wrote: > Hi, list! > > > > Exist some negative performance impact in compiling postgresql without libs > readline and zlib? I was compiling in a HP PA-RISC with HP AnsiC compiler. No performance impact in having or not having these features. -- Bruce Momjian

[GENERAL] PostgreSQL 8.1 without readline and zlib

2006-02-01 Thread gfnobrega
Hi, list!   Exist some negative performance impact in compiling postgresql without libs readline and zlib? I was compiling in a HP PA-RISC with HP AnsiC compiler.   Thanks!   Gustavo Franklin Nóbrega [EMAIL PROTECTED] Infraestrutura e Banco de Dados Planae Tecnologia da Informação (+

[GENERAL] Converting Text to Bytea

2006-02-01 Thread Howard Cole
Hi, Can anyone tell me how to convert a text column to a bytea column? Thanks. Howard Cole www.selestial.com ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining

Re: [GENERAL] triggers, rules and alter table

2006-02-01 Thread Richard Huxton
Sergey Karin wrote: Hi, List! I'm using pg 8.1.0 this version allows to create triggers on INSERT, DELETE and UPDATE and also allows to create rules on SELECT, UPDATE, INSERT and DELETE. But I want to do some actions on ALTER TABLE ... ADD COLUMN and ALTER TABLE ... DROP COLUMN events. How I ca

Re: [GENERAL] postmaster crash

2006-02-01 Thread Richard Huxton
Steve Oualline wrote: We have an interesting problem here. We have a server at a customer's site on which the database will not come up. Because of the nature of the product we make, we don't turn on Postgresql logs, so no log data is avaliable. That's the biggest problem you've got right th

Re: [GENERAL] triggers and SELECT

2006-02-01 Thread Tino Wildenhain
Sergey Karin schrieb: Hi, List! Are there any plans to realize triggers on SELECT in new versions of PG? What should they do? You can always use a rule for this... ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] triggers and SELECT

2006-02-01 Thread Sergey Karin
Hi, List! Are there any plans to realize triggers on SELECT in new versions of PG? Sergey Karin

[GENERAL] triggers, rules and alter table

2006-02-01 Thread Sergey Karin
Hi, List! I'm using pg 8.1.0 this version allows to create triggers on INSERT, DELETE and UPDATE and also allows to create rules on SELECT, UPDATE, INSERT and DELETE. But I want to do some actions on ALTER TABLE ... ADD COLUMN and ALTER TABLE ... DROP COLUMN events. How I can handle that events i