Re: [GENERAL] rules: evaluate inputs in advance

2006-05-13 Thread Markus Schiltknecht
Hi Martijn,

On Fri, 2006-05-12 at 18:05 +0200, Martijn van Oosterhout wrote:
> But it can't really. In the example that started this thread, there are
> two seperate rules and after rewriting the executor will be presented
> two seperate queries.

Ah, thank you, that explains the difficulties with rules.

> What you probably want is a function that is given the row and then
> executes the two statements on a per row basis. This has the effect you
> want but gives up the major benefit of rules, wholesale query
> restructuring like views which allows the executor to find better
> plans. The executor can't see inside a trigger so it can't optimise.

Isn't that an argument for keeping rewrite rules instead of using
something trigger like for updatable views? Wouldn't it be feasible to
teach the executor how to handle multiple queries with some
pre-evaluated input?

Regards

Markus



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[GENERAL] pg_dump index/constraint creation order

2006-05-13 Thread Ed L.
While watching a 9-hour 60GB network load from 7.4.6 pg_dump into 
8.1.2, I noticed the order in which indices and constraints are 
created appears to be their creation order.

Would it make more sense to have pg_dump dump indexes grouped by 
the table?  That way, if a table got loaded into cache for one 
index creation, it might still be there for the immediatly 
following index creations on the same table...?

Ed


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] Mac Problem with Tunneling...

2006-05-13 Thread Kris Jurka



On Sat, 13 May 2006, Jerry LeVan wrote:


channel 3: open failed: administratively prohibited: open failed


This is the standard error you'll see when /etc/ssh/sshd_config (or local 
equivalent) has AllowTcpForwarding no.


Kris Jurka


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] Mac Problem with Tunneling...

2006-05-13 Thread Jerry LeVan


On May 13, 2006, at 6:18 PM, Tom Lane wrote:


Jerry LeVan <[EMAIL PROTECTED]> writes:

How ever if I turn it around, and on the mac issue
the command
 ssh -L :linuxbox:5432 -l jerry linuxbox
Then I am not able to connect to the linux box
via psql or any Gui front ends.


[ tries it ... ]  Worksforme, using the stock ssh in OS X 10.4.6.

Maybe you've got the OS X firewall configured to prevent  
connections to

port ?  That doesn't seem to be default, because I didn't have to
adjust the firewall for my experiment.

Another possibility is that the ssh daemon on the linux box is
restricted from opening local connections.  It wouldn't surprise
me if this is disabled by default by SELinux for instance :-(

regards, tom lane


I am still puzzled. I don't think it is a postgresql problem since I
can't forward to other daemons running on the linux box.

I have noticed a error in the message file on the linux box that
is generated when ever I try to connect from the mac.

**
debug1: Connection to port 2224 forwarding to linuxbox port 2224  
requested.

debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 is O_NONBLOCK
debug2: fd 9 is O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
channel 3: open failed: administratively prohibited: open failed
debug1: channel 3: free: direct-tcpip: listening port 2224 for  
linuxbox port 2224, connect from ::1 port 50663, nchannels 4

debug3: channel 3: status: The following connections are open:
  #2 client-session (t4 r0 i0/0 o0/0 fd 6/7)
  #3 direct-tcpip: listening port 2224 for linuxbox port 2224,  
connect from ::1 port 50663 (t3 r-1 i0/0 o0/0 fd 9/9)


debug3: channel 3: close_fds r 9 w 9 e -1
May 13 19:22:05 localhost sshd[5844]: error: connect_to linuxbox:  
unknown host (Name or service not known)

***
It appears that I have to somehow tell the linux box about the Mac

This does not appear to be necessary when talking to the mac from the  
linux box.


Sigh,

Jerry


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] Mac Problem with Tunneling...

2006-05-13 Thread Tom Lane
Jerry LeVan <[EMAIL PROTECTED]> writes:
> How ever if I turn it around, and on the mac issue
> the command
>  ssh -L :linuxbox:5432 -l jerry linuxbox
> Then I am not able to connect to the linux box
> via psql or any Gui front ends.

[ tries it ... ]  Worksforme, using the stock ssh in OS X 10.4.6.

Maybe you've got the OS X firewall configured to prevent connections to
port ?  That doesn't seem to be default, because I didn't have to
adjust the firewall for my experiment.

Another possibility is that the ssh daemon on the linux box is
restricted from opening local connections.  It wouldn't surprise
me if this is disabled by default by SELinux for instance :-(

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[GENERAL] Mac Problem with Tunneling...

2006-05-13 Thread Jerry LeVan

Hi,
On my linux box I can issue the command

ssh -L :macjerry:5432 -l jerry macjerry

This will create a "tunnel" to connect to my
mac named "macjerrry".

I can connect to databases on macjerry via psql
by specifying port  on my linux box and other postgresql
front ends.

How ever if I turn it around, and on the mac issue
the command

ssh -L :linuxbox:5432 -l jerry linuxbox

Then I am not able to connect to the linux box
via psql or any Gui front ends.

I get an error:

[EMAIL PROTECTED] ~]$ channel 3: open failed: administratively  
prohibited: open failed

channel 3: open failed: administratively prohibited: open failed

No errors appear in the server log on the linux box.

I am new to ssh, have I overlooked something?


Jerry

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] INSERT RULE doesn't allow OLD, so how does one work with serial datatypes?

2006-05-13 Thread Martijn van Oosterhout
On Sat, May 13, 2006 at 02:11:14PM -0700, Karen Hill wrote:
> I'm having a bit of mystery in solving a postgresql puzzle.  I have a
> table that when it gets inserted or updated or deleted it is logged
> into a log table.  The log table contains who (current_user) did the
> insert/update/delete the CURRENT_TIMESTAMP.  Everything works great
> except the INSERT because I cannot use OLD and NEW increments the
> serial twice!

You cannot use OLD because there is no old row. And rules are like
macros, so the nextval() gets evaluated twice.

You probably want a trigger...
-- 
Martijn van Oosterhout  http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.


signature.asc
Description: Digital signature


[GENERAL] INSERT RULE doesn't allow OLD, so how does one work with serial datatypes?

2006-05-13 Thread Karen Hill
I'm having a bit of mystery in solving a postgresql puzzle.  I have a
table that when it gets inserted or updated or deleted it is logged
into a log table.  The log table contains who (current_user) did the
insert/update/delete the CURRENT_TIMESTAMP.  Everything works great
except the INSERT because I cannot use OLD and NEW increments the
serial twice!

CREATE TABLE ttest (bpchar, instime abstime, prikey serial PRIMARY
KEY);
CREATE TABLE ttest_log ( value bpchar, user bpchar, instime abstime,
modtime abstime , logprikey int4);

CREATE RULE ri AS ON INSERT TO ttest DO
INSERT INTO ttest_log (NEW.value , current_user, CURRENT_TIMESTAMP,
'infinity', NEW.logprikey);
--on the above NEW.logprikey creates two different primary keys!!  One
pk for the ttest and pk +1 for ttest_log!


CREATE RULE rupd AS ON UPDATE TO ttest DO
INSERT INTO ttest_log (old.value, current_user, old.instime,
CURRENT_TIMESTAMP);

CREATE RULE rdel AS ON DELETE TO ttest DO
INSERT INTO ttest_log (old.value, current_user, old.instime,
CURRENT_TIMESTAMP);


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] GUI Interface

2006-05-13 Thread Russ Brown
On Sat, 2006-05-13 at 17:27 +0100, Dave Page wrote:
> 
> > Why don't  you just drop win32 support and leave the commercial
> market 
> > to us proprietary coders :-)  Seriously, there are now more than
> enough
> > commercial admin tools available to support the PG windows market. 

I can't find the original mail which contained this, but I have to say
this would be a monstrous step backwards.

For me, cross-platform is the future for desktop apps. People want to be
able to run the application they want to run and not be constrained by
the OS they're running on. If I'm working at a client's site and all
they have is one OS, I want to be able to use the tools I'm comfortable
with regardless of my preferred OS.

That's why I use OO, Firefox, Gaim, jedit etc. OS is irrelevant and will
before long become a preference rather than being dictated by the
application you want to run.

Just my opinion. :)

-- 

Russ


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] GUI Interface

2006-05-13 Thread Dave Page



-Original Message-
From: Tony Caduto [mailto:[EMAIL PROTECTED]
Sent: Sat 5/13/2006 2:57 PM
To: Dave Page
Subject: Re: [GENERAL] GUI Interface
 
> It's not that derogatory Dave,
> All that page mentions is the weird quirks on win32, I am sure you know 
> what those are, i.e. windows suddenly lose there size and position info 
> and appear in the upper left corner of the screen in a semi minimized 
> state, there are others.

I would hardly call those cross-platform quirks. More like unreported bugs. If 
you or anyone else can provide more details I'm sure we can look at them.

> Fix the problems and I will remove the thing about the quirks.  The 
> other stuff was mentioned by customers in the testimonials.

Maybe, but it's still on your site, adding to the impression that you are only 
comparing PGLA to pgAdmin.

How about Joshua's idea? Are you up for a creating a true and honest feature 
comparison between the two of us?

> And you do realize you started that whole flame fest yesterday because 
> you had to chime in that 'but does it run on Linux', the guy I responded 
> to had stated he was running on windows, now why would a windows user 
> give one iota if a program runs on linux or not?

Iirc, you said something about managing PG installs on any platform even though 
the OP had said Windows. I think my question was valid - and the answer that 
PGLA now does run under Wine is certainly a plus point for you. You also 
mentioned other technologies that might allow a more native build (Lazarus was 
it?) - I have no idea whether or not you've experimented with such things and 
have a linux build in the pipeline.

My only comment that was semi-intended as a flame was in response to a message 
of yours that I misunderstood, and for which I apologised publically as soon as 
I realised what I had done.

> Why don't  you just drop win32 support and leave the commercial market 
> to us proprietary coders :-)  Seriously, there are now more than enough
> commercial admin tools available to support the PG windows market.

Given the lack of an IDE that I like better than VS on any of our other 
platforms, I can't see that happening :-)

> I would appreciate you not chiming in with 'does it run on linux?'
> If you agree to that I will make the changes on my site(testimonials) 
> you desire.   I don't think the people that wrote those will be happy 
> but oh well.

OK, I won't ask such questions in future - and for what it's worth, I don't 
object to you having testimonials from your customers, just please make them 
less obviously biased against our product - I'm sure you've seen how other ads 
deal with it, speaking of 'leading competitors' etc.

> oh, and I had PGLA working in basic form a week after Andreas's little 
> comment to me, it's just been polished since then :-)

Which speaks well of your tools and your mastery of them. It's hard to say good 
for you without it sounding like I'm taking the p**s, but it is sincere! :-)

Regards, Dave.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] GUI Interface

2006-05-13 Thread Thomas Hallgren

Dan Armbrust wrote:
You live in an interesting world... meanwhile, I'm here in the real 
world, using Eclipse - the best IDE I've ever used to develop java 
applications.  Oh, wait, Eclipse is written in Java?  I didn't think it 
was possible to write good apps in java?  Certainly better than visual 
studio (and yes, I have to use both - eclipse is a far better IDE in my 
opinion).  Oh, and I can run eclipse on my linux desktop as well as my 
windows desktop?  Thats just cool.  Oh, and my next machine?  Definitely 
a Mac.  And it woks there too - just like all of my SWT apps do.


I will admit, it is rather easy to write slow java swing applications 
There are a lot of poor ones out there.   Its a shame that Sun botched 
swing so badly, and have never repaired it properly.  Its not impossible 
to write fast, responsive apps in swing, it just takes skilled 
developers.  And its a pain.


However, now with the emergence of SWT and modern JVM's - there is no 
reason for your java GUI to be any slower than anything else.  The only 
excuse for a slow java app these days is the quality of the code that it 
is built with.  And you can write a bad, slow app in any language.


Cool. At least one that actually knows what he's talking about and have real life 
experience. I'm also using Eclipse and a slew of other Java apps. No complaints whatsoever 
on performance. Not too happy about all C/C++ apps that crash on illegal memory access though...


+1 (or 10) for Java on the desktop.

I will not spend time on a war that cannot be fought in this forum. Just wanted to air my 
opinion this once :-)


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org