[GENERAL] Visual Studio 2005 .Net -> Npgsql -> Postgresql

2005-05-27 Thread Philippe Lang
Hi,

I'v been playing with Visual Studio 2005 beta 2 recently. I'm evaluating
it as a RAD tool for developing GUI front-ends to Postgresql.

RAD means for me something similar to Delphi: you configure a database
connexion, drop a few objects on a form, controls, you bind the controls
to the datasource, and finished. No glue code or whatever.

In Visual Studio 2005, that's something I could achieve with a Microsoft
database - Access or SQL Server -. When you select one of these
databases, code is being generated, that works, really, no problem.

Although Npgsql seems to be a very nice library to access Postgresql, I
was not able to do that. Adding a database to the project is fine for MS
Access / SQL Server / Oracle databases, but I'm still searching how to
do it for Postgresql.

So my question is: is it reasonable to expect as much integration of
Postgresql in Visual Studio than with the other databases? Does anyone
work under Visual Studio as easily with Postgresql than with MS Access /
SQL Server?

---
Philippe


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

   http://archives.postgresql.org


Re: [GENERAL] Visual Studio 2005 .Net -> Npgsql -> Postgresql

2005-05-27 Thread Douglas McNaught
"Philippe Lang" <[EMAIL PROTECTED]> writes:

> Although Npgsql seems to be a very nice library to access Postgresql, I
> was not able to do that. Adding a database to the project is fine for MS
> Access / SQL Server / Oracle databases, but I'm still searching how to
> do it for Postgresql.
>
> So my question is: is it reasonable to expect as much integration of
> Postgresql in Visual Studio than with the other databases? Does anyone
> work under Visual Studio as easily with Postgresql than with MS Access /
> SQL Server?

While knowing very little about Microsoft technologies, I would say
that what you are looking for is a function of the quality of the
database driver.  So talk to the Npgsql folks about your specific
problems rather than posting to -general.

-Doug

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] Trigger and arguments question

2005-05-27 Thread Alban Hertroys

Hervé Inisan wrote:

Hi everybody!

I have a trigger like this:

CREATE TRIGGER mytrigger
   AFTER INSERT OR UPDATE OR DELETE
   ON myschema.mytable
   FOR EACH ROW
   EXECUTE PROCEDURE myschema.myfunction(myarg);

It sends an argument to myfunction(), and I can retrieve this value in
TG_ARGV[0]. Fine.
What I'm trying to do is using TG_ARGV[0] to point to a field in NEW or OLD.
Is it possible?


You'll be missing OLD and NEW on INSERT and DELETE respectively, I'm 
afraid. You may want to split your triggers for different events.


--
Alban Hertroys
MAG Productions

T: +31(0)53 4346874
F: +31(0)53 4346876
E: [EMAIL PROTECTED]
W: http://www.magproductions.nl


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

  http://archives.postgresql.org


[GENERAL] relocation error-urgent

2005-05-27 Thread Nageshwar Rao
I have postgresql7.4.6 runing . I am not able to log into database using
psql and also  tried to create new database using createdb but getting the
following error for both

psql: relocation error: psql: undefined symbol: get_progname

createdb: relocation error: createdb: undefined symbol: get_progname

help appreciated


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

   http://archives.postgresql.org


Re: [GENERAL] Visual Studio 2005 .Net -> Npgsql -> Postgresql

2005-05-27 Thread Não use este endereço para mensagens pessoais
Try using with ODBC works great for VS2005

On 5/27/05, Philippe Lang <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'v been playing with Visual Studio 2005 beta 2 recently. I'm evaluating
> it as a RAD tool for developing GUI front-ends to Postgresql.
> 
> RAD means for me something similar to Delphi: you configure a database
> connexion, drop a few objects on a form, controls, you bind the controls
> to the datasource, and finished. No glue code or whatever.
> 
> In Visual Studio 2005, that's something I could achieve with a Microsoft
> database - Access or SQL Server -. When you select one of these
> databases, code is being generated, that works, really, no problem.
> 
> Although Npgsql seems to be a very nice library to access Postgresql, I
> was not able to do that. Adding a database to the project is fine for MS
> Access / SQL Server / Oracle databases, but I'm still searching how to
> do it for Postgresql.
> 
> So my question is: is it reasonable to expect as much integration of
> Postgresql in Visual Studio than with the other databases? Does anyone
> work under Visual Studio as easily with Postgresql than with MS Access /
> SQL Server?
> 
> ---
> Philippe
> 
> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
>   http://archives.postgresql.org
>

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


Re: [GENERAL] relocation error-urgent

2005-05-27 Thread Peter Eisentraut
Nageshwar Rao wrote:
> I have postgresql7.4.6 runing . I am not able to log into database
> using psql and also  tried to create new database using createdb but
> getting the following error for both
>
> psql: relocation error: psql: undefined symbol: get_progname
>
> createdb: relocation error: createdb: undefined symbol: get_progname

It seems you are mixing programs and libraries from different 
installations.  Try with ldd or some analogous program to determine 
which libpq library the programs are actually using and check if that 
is the right version.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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


Re: [GENERAL] Trigger and arguments question

2005-05-27 Thread Hervé Inisan
> Hervé Inisan wrote:
> > Hi everybody!
> > 
> > I have a trigger like this:
> > 
> > CREATE TRIGGER mytrigger
> >AFTER INSERT OR UPDATE OR DELETE
> >ON myschema.mytable
> >FOR EACH ROW
> >EXECUTE PROCEDURE myschema.myfunction(myarg);
> > 
> > It sends an argument to myfunction(), and I can retrieve 
> this value in 
> > TG_ARGV[0]. Fine.
> > What I'm trying to do is using TG_ARGV[0] to point to a 
> field in NEW or OLD.
> > Is it possible?
> 
> You'll be missing OLD and NEW on INSERT and DELETE 
> respectively, I'm afraid. You may want to split your triggers 
> for different events.

Thank you all for your answers.
I tried with EXECUTE, with you're right: no way to build a NEW.field
dynamically.

-- Hervé Inisan.



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


Re: [GENERAL] Query for importing and exporting data from a database

2005-05-27 Thread Yateen Joshi
Thanks for that!
Is there any way I can check if my Postgres was compiled using that
option or not?

Yateen V. Joshi


-Original Message-
From: Douglas McNaught [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 26, 2005 8:49 PM
To: Yateen Joshi
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Query for importing and exporting data from a
database

"Yateen Joshi" <[EMAIL PROTECTED]> writes:

> Link: File-List
>
> Hi,
>
>  
>
> I am using postgres 7.4.2 on Solaris. My unix system does not place a
> limitation of 2 GB on file size. If I export  a data from my database
that
> causes the file size to be more than 2 GB, then that export fails (and
> vice versa for importing, i.e. if the file size is more than 3 GB, it
can
> not import). Two questions -
>
> Why does this happen?
>
> Is there any way to avoid this?

Probably, your Postgres was not compiled with the LARGEFILE option (I
forget exactly what it's called). 

You may be able to work around it by doing something like:

pg_dump -t mytable mydb | cat > output.sql

-Doug

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


Re: [GENERAL] another failover testing question

2005-05-27 Thread David Parker
>It should not be ... at least, assuming that Slony is using 
>the standard DROP TRIGGER operation, rather than playing 
>directly with the system catalogs ...

AFAICS, the slony uninstall command is not doing anything exotic, though
it DOES do a little bit of fiddling with pg_catalog to RESTORE
previously disabled triggers. Otherwise it is using plain vanilla drop
trigger.

I found a slony list thread from a few months ago that discussed this
issue: http://archives.postgresql.org/pgsql-general/2005-02/msg00813.php

The discussion there centered around cached plans causing the "no
relation with OID" problem. The area of our code that experiences these
problems is calling libpq - we have a wrapper for it that plugs into our
Tcl environment - but it is not using prepared statements, and the
commands it is executing are not calls to stored procedures, etc.

I cannot repro this problem simply using psql, so it must have something
to do with the way we are using libpq, but I have no idea what object(s)
we are holding onto that reference slony OIDs.

- DAP

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] Trigger and arguments question

2005-05-27 Thread Stephan Szabo
On Thu, 26 May 2005, [iso-8859-1] Hervé Inisan wrote:

> It sends an argument to myfunction(), and I can retrieve this value in
> TG_ARGV[0]. Fine.
> What I'm trying to do is using TG_ARGV[0] to point to a field in NEW or OLD.
> Is it possible?
>
> Something like NEW.TG_ARGV[0]...
>
> I'm trying to write a kind of generic function which I could use on multiple
> tables with different field names (myarg being the field name).
> But I can't get it to work.
>
> Any clues or other solutions?

If you're using plpgsql, that's not possible.  It should be possible in
some of the other pl languges, however.

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

   http://archives.postgresql.org


Re: [GENERAL] Just a crazy idea!

2005-05-27 Thread Jeff Trout


On May 26, 2005, at 5:04 PM, Hrishikesh Deshmukh wrote:


Is it possible to connect a DB in Postgresql to a DB in MySQL!
I know its a crazy idea!
H


http://pgfoundry.org/projects/dbi-link/

although you'll need a patch to make it work unless the author has  
updated it.



--
Jeff Trout <[EMAIL PROTECTED]>
http://www.jefftrout.com/
http://www.stuarthamm.net/



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


[GENERAL] solaris 10 vs Linux Debian on SUN Fire v40z

2005-05-27 Thread Thomas Chille
Hi,

we are planning to use Postgresql 8.0 on a SUN Fire v40z Server with 4
SingleCore Opterons. It will be later replaced by an DualCore
Opterons.

Would you prefer using Solaris or Linux?

Thanks in Advance,
Thomas

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [GENERAL] Visual Studio 2005 .Net -> Npgsql -> Postgresql

2005-05-27 Thread Brar Piening

See:
http://gborg.postgresql.org/pipermail/npgsql-general/2005-May/001374.html


Philippe Lang schrieb:


Hi,

I'v been playing with Visual Studio 2005 beta 2 recently. I'm evaluating
it as a RAD tool for developing GUI front-ends to Postgresql.

RAD means for me something similar to Delphi: you configure a database
connexion, drop a few objects on a form, controls, you bind the controls
to the datasource, and finished. No glue code or whatever.

In Visual Studio 2005, that's something I could achieve with a Microsoft
database - Access or SQL Server -. When you select one of these
databases, code is being generated, that works, really, no problem.

Although Npgsql seems to be a very nice library to access Postgresql, I
was not able to do that. Adding a database to the project is fine for MS
Access / SQL Server / Oracle databases, but I'm still searching how to
do it for Postgresql.

So my question is: is it reasonable to expect as much integration of
Postgresql in Visual Studio than with the other databases? Does anyone
work under Visual Studio as easily with Postgresql than with MS Access /
SQL Server?

---
Philippe


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

  http://archives.postgresql.org


 




---(end of broadcast)---
TIP 3: 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] Question: migrate

2005-05-27 Thread Hrishikesh Deshmukh
Hi All,

I have a huge database working on a debian linux machine, this machine
is going to get a hard drive wipe and new OS. I have another debian
linux machine (exact hardware + software). Is there a way to get
database "migrated" from machine 1 to machine 2 without much work?

Anxiously waiting for reply. Kindly advice.

Thanks in advance.

Hrishi

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


Re: [GENERAL] Visual Studio 2005 .Net -> Npgsql -> Postgresql

2005-05-27 Thread Shelby Cain


--- Philippe Lang <[EMAIL PROTECTED]> wrote:
> 
> So my question is: is it reasonable to expect as much integration of
> Postgresql in Visual Studio than with the other databases? Does
> anyone
> work under Visual Studio as easily with Postgresql than with MS
> Access /
> SQL Server?
> 

Open the controls toolbox in VS.Net.  Select the "General" category and
right-click anywhere on the pane.  Select Add/Remove items and navigate
to the Npgsql.dll located in your Postgresql install directory.  You'll
now have the Connection/Command/etc controls that you can place on
forms.

As an aside, I'd highly recommend learning how ADO.Net works at the
fundamental level so that you can (if necessary) code these things
manually instead of having to rely on the forms designer provided by
VS.Net.

Regards,

Shelby Cain


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] Question: migrate

2005-05-27 Thread Jeff Trout


On May 27, 2005, at 12:10 PM, Hrishikesh Deshmukh wrote:


Hi All,

I have a huge database working on a debian linux machine, this machine
is going to get a hard drive wipe and new OS. I have another debian
linux machine (exact hardware + software). Is there a way to get
database "migrated" from machine 1 to machine 2 without much work?



2 methods

1. since it is the same kind of hardware you can shut down PG on  
machine1 and tar up $PGDATA move to machine2, untar and fire up PG.


2. pg_dump on machine 1, copy the dump, load up on machine2. (this  
will take longer)


--
Jeff Trout <[EMAIL PROTECTED]>
http://www.jefftrout.com/
http://www.stuarthamm.net/



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [GENERAL] solaris 10 vs Linux Debian on SUN Fire v40z

2005-05-27 Thread Tony Caduto
Both are good, I guess it depends what kind of expertise you have around 
or are willing to pay for.


For me I would pick Linux because it is easier to install and maintain, 
and there is much more articles etc on the web.
For a bullet proof  Linux Install you could use CentOS which is a clone 
of Red Hat Enterprise Linux 4 or for really good performance you could 
also use Gentoo, I actually run all my PG servers on Gentoo and it is 
great, very easy to update and maintain.


You could also use FreeBSD, but I am not sure how well it would work 
with a 4 way system.


Thomas Chille wrote:


Hi,

we are planning to use Postgresql 8.0 on a SUN Fire v40z Server with 4
SingleCore Opterons. It will be later replaced by an DualCore
Opterons.

Would you prefer using Solaris or Linux?

Thanks in Advance,
Thomas

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


 





---(end of broadcast)---
TIP 3: 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] solaris 10 vs Linux Debian on SUN Fire v40z

2005-05-27 Thread Miguel Miranda

Thomas Chille wrote:

Hi,

we are planning to use Postgresql 8.0 on a SUN Fire v40z Server with 4
SingleCore Opterons. It will be later replaced by an DualCore
Opterons.

Would you prefer using Solaris or Linux?

Thanks in Advance,
Thomas

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

I would use FreeBSD instead, im not sure if their SMP kernel supports 4 
processors though.


May be a FreeBSD user could elaborate on this, what about 5.4?


---
Miguel

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


Re: [GENERAL] Question: migrate

2005-05-27 Thread Robert Treat
On Friday 27 May 2005 12:52, Jeff Trout wrote:
> On May 27, 2005, at 12:10 PM, Hrishikesh Deshmukh wrote:
> > Hi All,
> >
> > I have a huge database working on a debian linux machine, this machine
> > is going to get a hard drive wipe and new OS. I have another debian
> > linux machine (exact hardware + software). Is there a way to get
> > database "migrated" from machine 1 to machine 2 without much work?
>
> 2 methods
>
> 1. since it is the same kind of hardware you can shut down PG on
> machine1 and tar up $PGDATA move to machine2, untar and fire up PG.
>

Depending on your systems, it might be quicker to just mount one of the drives 
on the other machine and copy it directly over, bypassing the tar step. 

> 2. pg_dump on machine 1, copy the dump, load up on machine2. (this
> will take longer)
>

Option 3 would be to use slony, which would minimise the down time, but might 
not fall into the "without much work" constraint. 

-- 
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

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


[GENERAL] PostgreSQL/MS Access - solution for passing parameters to pass through queries

2005-05-27 Thread Zlatko Matic

Hi everybody!

Recently I was struggling with client/server issues in MS Access/PostgreSQL 
combination.
Although Access is intuitive and easy to use desktop database solution, many 
problems appear when someone is trying to use it as front-end for real 
server database systems such as PostgreSQL or MySQL.

One of these problems is regarding pass-through queries and parameters.
I wanted to have all the code on client, while executing it on the server in 
order to increase performance and speed. Therefore I created pass-through 
queriers for my forms and reports. The problem was that I couldn't pass 
parameters for where clause criteria, such as start and end-date. Therefore 
I have written procedure that passes parameters to pass-through queries.

I hope it will help to those dealing with the same problem...

For this method we use 2 saved pass-through queries.First, we have query 
with parameter name included in code in criteria expression.  Then, we have 
another query which SQL string is generated from the first one. The SQL 
string is refreshed each time before query execution, so that parameter name 
is replaced with actual value. The form is based on that executive 
pass-through query...


'
' This code has a list of saved pass-through queries along with 
parameters.and can be called

' on Click event.
' Theprocedure calls function ParametersToQueries () that recreates SQL 
string of executive query.

' written by: Zlatko Matic
'
Sub QueriesAndParameters ()

Dim ws As DAO.Workspace
Dim db As DAO.DATABASE
Dim QueryName As String
Dim NumberOfParameters As Integer

On Error GoTo ErrorHandler

DoCmd.Hourglass True

   Set ws = DBEngine(0)
   Set db = CurrentDb

   'List of queries and parameters...For example:

   QueryName = "SomeQuery"
   NumberOfParameters = 3
   ' Transfer name of the query and parameters to funtion 
ParametersToQuery

   Call ParametersToQuery (QueryName, NumberOfParameters, _
   "StartDate", Format([Forms]![MenuForm]![START_DATE], "-mm-dd"), 
_

   "EndDate", Format([Forms]![MenuForm]![END_DATE], "-mm-dd"), _
   "Option", [Forms]![MenuForm]![OPTION])

Exit:

   DoCmd.Hourglass False
   Exit Sub

ErrorHandler:

   Dim strErr As String

   strErr = "VBA-Error Information" & vbNewLine
   strErr = strErr & "Number: " & vbTab & vbTab & Err.Number & vbNewLine
   strErr = strErr & "Description: " & vbTab & Err.Description & vbNewLine
   strErr = strErr & "LastDLLError: " & vbTab & Err.LastDllError & 
vbNewLine

   strErr = strErr & vbNewLine
   MsgBox strErr, vbOKOnly + vbExclamation, "Error"

   Resume Exit

End Sub

Here is the code for function ParametersToQuery:
'
' This function recreates SQL string of executive pass-through query
' written by: Zlatko Matic
'
Function ParametriziranjePstUpita(QueryName As String, NumberOfParameters As 
Integer, ParamArray Parameters () As Variant)


Dim ws As DAO.Workspace
Dim db As DAO.DATABASE
Dim qdf As DAO.QueryDef
Dim strSQL As String
Dim strConnect As String
Dim PstQueryName As String
Dim n As Integer
Dim x As Integer
Dim ParameterName As Variant
Dim ParameterValue As Variant
Dim Parameter As Variant

On Error GoTo ErrorHandler

DoCmd.Hourglass True

Set ws = DBEngine(0)
Set db = CurrentDb

   PstQueryName = QueryName & "_prm"

   'Open thempass-through query to extract SQL string
   Set qdf = db.QueryDefs(PstQueryName)
   strSQL = qdf.SQL
   strConnect = qdf.Connect
   'Creation of new SQL string
   'Assign parameters
   If NumberOfParameters > 0 Then
   x = 0
   For n = 0 To ((NumberOfParameters * 2) - 1) Step 2
   ParameterName = Parameters (n)
   ParameterValue = Parameters (n + 1)
   strSQL = Replace(strSQL, ParameterName, ParameterValue)
   x = x + 1
   Next n
   End If

   qdf.Close

   'Assignig of changed SQL string to executive pass-through query
   If ObjectExists(acQuery, QueryName) Then
   'If executive query exists, open it
   Set qdf = db.QueryDefs(QueryName)
   qdf.Connect = strConnect
   Else
   'If executive pass-thrpough query doesn't exist, create it
   Set qdf = db.CreateQueryDef(QueryName)
   qdf.Connect = strConnect
   qdf.ODBCTimeout = 0
   qdf.ReturnsRecords = True
   End If
   'Set SQL string
   qdf.SQL = strSQL

   qdf.Close

Exit:

   DoCmd.Hourglass False
   Exit Function

ErrorHandler:

   Dim strErr As String

   strErr = "VBA-Error Information" & vbNewLine
   strErr = strErr & "Number: " & vbTab & vbTab & Err.Number & vbNewLine
   strErr = strErr & "Description: " & vbTab & Err.Description & vbNewLine

Re: [GENERAL] enable_sort optimization problem

2005-05-27 Thread Dave E Martin

tom lane wrote:

> Why does it think that only 159 of the 132245 rows in outages will have
> join partners in ipinterface?  The actual results look like they all do.
> It might be worth looking at the pg_stats rows for the join columns to
> see if there's something odd about the statistics.
>


Here are the pg_stats (as of today, I haven't done any analyzes or 
vacuums since the night of my first posting) for outages and ipinterface 
(I've obscured some addresses in the ipiddr row, and removed iphostname):


schemaname | tablename |  attname   |  null_frac  | avg_width | 
n_distinct 
|   
most_common_vals
| 
most_common_freqs 
|  
histogram_bounds   
| correlation

+---++-+---++---+---+-+-
public | outages   | outageid   |   0 | 4 
| -1 
|   
|   
| 
{201,14775,27621,39600,53231,66043,79629,92779,105267,119744,134644}
|0.390484
public | outages   | svclosteventid |   0 | 4 |  
-0.945011 | 
{280277,356772}   
| 
{0.00067,0.00067} 
| 
{17842,54830,81745,107030,135793,163240,191819,219223,268449,309128,371234} 
|0.390484
public | outages   | svcregainedeventid | 0.00033 | 4 |  
-0.958031 | 
{280279}  
| 
{0.00067} 
| 
{17844,54856,81787,107063,135821,163381,191856,219405,268450,309572,371494} 
|0.390818
public | outages   | nodeid |   0 | 4 
|396 | 
{962,397,191,185,377,139,237,378,1295,231}
| 
{0.017,0.0097,0.0087,0.0083,0.0083,0.0077,0.0077,0.0077,0.0077,0.007} 
| 
{3,158,178,206,236,258,293,316,358,395,1452}
|  -0.0325868
public | outages   | ipaddr |   0 |16 
|396 | 
{208,172.22.0.158,172.20.0.237,172.20.0.231,172.22.35.56,172.17.2.5,172.20.0.180,172.21.240.91,172.23.181.16,172.21.240.93}
| 
{0.017,0.0097,0.0087,0.0083,0.0083,0.0077,0.0077,0.0077,0.

Re: [GENERAL] another failover testing question

2005-05-27 Thread David Parker
I know better what is happening now. I had the scenario slightly wrong.

Slony creates a trigger on all replicated tables that calls into a
shared library. The _Slony_I_logTrigger method in this library
establishes a saved plan for inserts into its transaction log table
sl_log_1. I can create the missing OID error with:

1) configure replication
2) establish a client connection, perform operations on replicated
tables
3) remove replication (drops sl_log_1 table)
4) operations on replicated tables on client connection are still fine
5) re-configure replication (re-creates sl_log_1 table)
6) now the OID error appears in the client connection. The OID refers
to the previous version of the sl_log_1 table

I was pawing through our code to figure out where we might be saving a
prepared statement, and was forgetting that the slony1_funcs library
does this. This saved plan is executed with SPI_execp, and the
documentation states:

"If one of the objects (a table, function, etc.) referenced by the
prepared plan is dropped during the session then the results of
SPI_execp for this plan will be unpredictable."

I'm pretty sure I understand the problem now (corrections appreciated),
but I'm left with the operational question of how I get around this
issue. Is there any way short of PQreset to get a postgres process to
refresh its saved plans? I can generally avoid the
drop-replication/re-configure replication thing happening in our
procedures, but I can't prevent it completely

- DAP

>> Sorry, neglected the version yet again: 7.4.5. What happens 
>is that we 
>> have active connections accessing tables that are being 
>replicated by 
>> slony. Then somebody does an uninstall of slony, which removes the 
>> slony trigger from those tables. Then we start getting the OID error.
>> If this should indeed not be an issue in 7.4.5, I will try 
>to come up 
>> with a test case independent of a slony install.
>
>It should not be ... at least, assuming that Slony is using 
>the standard DROP TRIGGER operation, rather than playing 
>directly with the system catalogs ...
>
>   regards, tom lane
>

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


Re: [PERFORM] [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL

2005-05-27 Thread Bruce Momjian

Added to TODO:

* Consider sorting hash buckets so entries can be found using a binary
  search, rather than a linear scan
* In hash indexes, consider storing the hash value with or instead
  of the key itself


---

Neil Conway wrote:
> Bruce Momjian wrote:
> > Is there a TODO anywhere in this discussion?  If so, please let me know.
> 
> There are a couple:
> 
> - consider changing hash indexes to keep the entries in a hash bucket 
> sorted, to allow a binary search rather than a linear scan
> 
> - consider changing hash indexes to store each key's hash value in 
> addition to or instead of the key value.
> 
> You should probably include a pointer to this discussion as well.
> 
> (I'd like to take a look at implementing these if I get a chance.)
> 
> -Neil
> 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[GENERAL] Fast request for version checking....

2005-05-27 Thread Mohan, Ross
Folks, 

if you go to the root of your postgresql distro
and type
./configure --version

what version of AutoConf was used? 


thanks!

--Ross

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


Re: [GENERAL] enable_sort optimization problem

2005-05-27 Thread Tom Lane
Dave E Martin <[EMAIL PROTECTED]> writes:
> tom lane wrote:
>>> Why does it think that only 159 of the 132245 rows in outages will have
>>> join partners in ipinterface?  The actual results look like they all do.
>>> It might be worth looking at the pg_stats rows for the join columns to
>>> see if there's something odd about the statistics.

> Here are the pg_stats (as of today, I haven't done any analyzes or 
> vacuums since the night of my first posting) for outages and ipinterface 
> (I've obscured some addresses in the ipiddr row, and removed iphostname):

Oh, I see it: the most common values in the outages table have nothing
to do with the most common values in the ipinterface table.  (Not
surprising ... presumably only a small part of your interfaces have
recurring problems.)  The calculation that the planner does therefore
leads to the conclusion that the join will be fairly sparse.

I guess at this point I'm wondering why neither nodeid nor ipaddr is a
unique key for ipinterface ... is their combination unique?

If you could get rid of the apparently rather prevalent 0.0.0.0 entries
in ipinterface, you'd probably see a better estimation result.  (I'm too
lazy to go check, but if you can replace these with nulls I think it
will deter the planner from making the bogus calculation.)

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] another failover testing question

2005-05-27 Thread Tom Lane
"David Parker" <[EMAIL PROTECTED]> writes:
> I can create the missing OID error with:

> 1) configure replication
> 2) establish a client connection, perform operations on replicated
> tables
> 3) remove replication (drops sl_log_1 table)
> 4) operations on replicated tables on client connection are still fine
> 5) re-configure replication (re-creates sl_log_1 table)
> 6) now the OID error appears in the client connection. The OID refers
> to the previous version of the sl_log_1 table

> I was pawing through our code to figure out where we might be saving a
> prepared statement, and was forgetting that the slony1_funcs library
> does this.

I think this is essentially a bug in the Slony library --- it ought to
provide a way to flush its internally cached plan(s).

In the longer term there may be infrastructure for automatic rebuilding
of invalidated plans, but I wouldn't hold my breath waiting for this.
(Even if it existed now, most likely the Slony code would have to change
to take advantage of it ...)

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [GENERAL] Fast request for version checking....

2005-05-27 Thread Tom Lane
"Mohan, Ross" <[EMAIL PROTECTED]> writes:
> if you go to the root of your postgresql distro
> and type
> ./configure --version
> what version of AutoConf was used? 

For any reasonably recent PG release, it will be 2.53 if built from
source.  Some RPM distributions may have re-autoconf'd though (I think
Red Hat is currently using 2.59, for instance).

regards, tom lane

---(end of broadcast)---
TIP 3: 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