[GENERAL] include PostgreSQL utilities into 3rd party program package

2008-04-09 Thread Michael Raven
Hello everybody.

I've got some kind of PostgreSQL copyright related question.

Our company is developing an commercial product for PostgreSQL administration.
We want to include some utilities (i.e. pg_dump.exe, pg_restore.exe etc)
from PostgreSQL for Windows installation package to installation package
of our product and use these utilities within our program.

Can we make it freely? Whether there are any special conditions for
this purpose?
What legal aspects of it exist?

Best regards,
Michael Raven.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Francisco Figueiredo Jr.
On Wed, Apr 9, 2008 at 1:31 PM, Francisco Figueiredo Jr.
<[EMAIL PROTECTED]> wrote:
> > >
>  > >
>  >
>  >  Ask the .npgsql mailing lists. They'll be able to tell you. There must be 
> a
>  > way of handling "non-standard" types in any case.
>  >
>
>  Hi all!
>
>  We are already working on that. The cast problem is indeed a bug in
>  Npgsql. We already have a one line fix for it.
>
>  Check it out here:
>
>  http://pgfoundry.org/forum/message.php?msg_id=1003377
>
>  I hope it helps.
>


Patch applied!

Please, grab latest cvs code and give it a try. Note that you still
will receive an string when working with char columns. But you will be
able to assign char values to NpgsqlParameters without any problem.

Please, let us know if you have any problems.




-- 
Regards,

Francisco Figueiredo Jr.
http://fxjr.blogspot.com
http://www.npgsql.org

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Write in file from postgres

2008-04-09 Thread Kevin Martins



--
From: "Kevin Martins" <[EMAIL PROTECTED]>
Sent: Thursday, April 10, 2008 12:03 AM
To: 
Subject: Re: [GENERAL] pain of postgres upgrade with extensions



Hello everybody,
First off all I am new in postgres but allready got some questions. It's 
possible to wirte in a file from postgres?

Kevin Martins
--
From: "Dave Potts" <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2008 8:46 PM
To: 
Subject: Re: [GENERAL] pain of postgres upgrade with extensions


Greg Sabino Mullane wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160




- dump version N database
- create empty version N+1 database
- install N+1's version of each needed contrib module into new database
- restore dump, ignoring "object already exists" errors

There is a TODO to figure out some cleaner way of handling this sort
of thing ...



I think I smell a GSOC project



I think there  is a slight misunderstanding here,  I was refering to
extensions items such as postgis, plr, pgperl, etc.  These have a slight
different foot print to the projects in the contrib directory.

Dave

- --
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200803121533
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAkfYMBMACgkQvJuQZxSWSsjmmwCg1JvB0G2py5jSbJdSZpWR8YyV
D4YAoLg2ZinEEGoNEU7S2mcL3bqhmNIh
=7pvA
-END PGP SIGNATURE-













--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pain of postgres upgrade with extensions

2008-04-09 Thread Kevin Martins


Hello everybody,
First off all I am new in postgres but allready got some questions. It's 
possible to wirte in a file from postgres?

Kevin Martins
--
From: "Dave Potts" <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2008 8:46 PM
To: 
Subject: Re: [GENERAL] pain of postgres upgrade with extensions


Greg Sabino Mullane wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160




- dump version N database
- create empty version N+1 database
- install N+1's version of each needed contrib module into new database
- restore dump, ignoring "object already exists" errors

There is a TODO to figure out some cleaner way of handling this sort
of thing ...



I think I smell a GSOC project



I think there  is a slight misunderstanding here,  I was refering to
extensions items such as postgis, plr, pgperl, etc.  These have a slight
different foot print to the projects in the contrib directory.

Dave

- --
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200803121533
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAkfYMBMACgkQvJuQZxSWSsjmmwCg1JvB0G2py5jSbJdSZpWR8YyV
D4YAoLg2ZinEEGoNEU7S2mcL3bqhmNIh
=7pvA
-END PGP SIGNATURE-













--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Tom Lane
"Greg Sabino Mullane" <[EMAIL PROTECTED]> writes:
> You should be using ALTER TABLE and not worry about changing tgenabled
> yourself, in case it wasn't obvious.

Yeah.  I had imagined Terry was hacking some backend code to do this,
in which case invoking CacheInvalidateRelcache directly might be
reasonable.  But updating tgenabled directly from client code is Just A
Bad Idea.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Geoffrey

Terry Lee Tucker wrote:

Greetings:

We have been working diligently toward integrating Slony into our production 
databases. We've been having trouble with various tables, although being 
replicated perfectly in the initial replication stage, afterwards, getting 
out of sync.


I have finally figured out what the problem is. We have a Perl process that 
continually updates certain columns across all databases. That Perl process 
calls a function we have written called disable_triggers which updates 
pg_class, setting reltriggers to 0 for the given table, and then later, after 
the work is complete, resetting reltriggers to the original value. 
Unfortunately, during this process, the Slony trigger is disabled as well 
which is causing our problem.


My questions is this: how would I go about changing my function so that all 
the triggers EXCEPT the Slony trigger would be disabled? Any ideas?


Version:
PostgreSQL 7.4.19 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 
20060404 (Red Hat 3.4.6-9)


Me thinks you forgot to mention that you are working on implementing 
this on Postgresql 8.3.1.



--
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
 - Benjamin Franklin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Francisco Figueiredo Jr.
On Wed, Apr 9, 2008 at 7:20 AM, leoabhi <[EMAIL PROTECTED]> wrote:
>
>   Hello,
>
Hello Abhi!

>   I wish to connect Visual Studio 2008(VB) to PostgreSQL..
>

Have you tried Npgsql?

http://www.npgsql.org
http://project.npgsql.org
http://documentation.npgsql.org

I hope it helps.


-- 
Regards,

Francisco Figueiredo Jr.
fxjr.blogspot.com
www.npgsql.org

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Geoffrey

Greg Sabino Mullane wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160



I see the following in the documentation for pg_trigger related
to tgenabled: "Controls in which session_replication_role modes the
trigger fires. O = trigger fires in "origin" and "local" modes,
D = trigger is disabled, R = trigger fires in "replica" mode, A =
trigger fires always."



My question is: When tgenabled is set to "D", how does that setting
interact with session_replication_role and, is there a way to use
tgenabled with a setting of "D" to prevent a particular trigger
from firing. Using ALTER TABLE to disable the trigger won't work
because the whole table is locked during the transaction and I only
want the disabled trigger to apply to the current transaction in the
current session.


If you simply want to ignore all triggers, just use a 'replica' role.
When done, switch it back to 'origin' (or your default, which should
be origin).

If you want to fire only a single trigger, set it to 'always' mode and
switch to 'replica'. If you want to fire all triggers *except* a
certain trigger, set that trigger to replica mode and leave the
session_replication_mode unchanged (default/origin).

You should be using ALTER TABLE and not worry about changing tgenabled
yourself, in case it wasn't obvious. You should be able to make permanent
changes and then just use session_replication_role to control how it acts
in a particular transaction.


The issue at hand (I work with the OP), is that our current application 
disables all triggers quite often.  Enter Slony, we want to replicate. 
So, what we need to do is, disable ALL triggers EXCEPT slony triggers.


--
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
 - Benjamin Franklin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


> I see the following in the documentation for pg_trigger related
> to tgenabled: "Controls in which session_replication_role modes the
> trigger fires. O = trigger fires in "origin" and "local" modes,
> D = trigger is disabled, R = trigger fires in "replica" mode, A =
> trigger fires always."

> My question is: When tgenabled is set to "D", how does that setting
> interact with session_replication_role and, is there a way to use
> tgenabled with a setting of "D" to prevent a particular trigger
> from firing. Using ALTER TABLE to disable the trigger won't work
> because the whole table is locked during the transaction and I only
> want the disabled trigger to apply to the current transaction in the
> current session.

If you simply want to ignore all triggers, just use a 'replica' role.
When done, switch it back to 'origin' (or your default, which should
be origin).

If you want to fire only a single trigger, set it to 'always' mode and
switch to 'replica'. If you want to fire all triggers *except* a
certain trigger, set that trigger to replica mode and leave the
session_replication_mode unchanged (default/origin).

You should be using ALTER TABLE and not worry about changing tgenabled
yourself, in case it wasn't obvious. You should be able to make permanent
changes and then just use session_replication_role to control how it acts
in a particular transaction.

Here's a quick example:

SET client_min_messages = 'ERROR';
DROP SCHEMA IF EXISTS triggertest CASCADE;
SET client_min_messages = 'NOTICE';

CREATE SCHEMA triggertest;

SET SEARCH_PATH = triggertest;

CREATE TABLE foo(a int);

INSERT INTO foo VALUES (1);

CREATE FUNCTION trig1()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $_$
 BEGIN
 RAISE NOTICE 'I am trigger one';
 RETURN NULL;
 END;
$_$;

CREATE FUNCTION trig2()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $_$
 BEGIN
 RAISE NOTICE 'I am trigger two';
 RETURN NULL;
 END;
$_$;

CREATE FUNCTION trig3()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $_$
 BEGIN
 RAISE NOTICE 'I am trigger three';
 RETURN NULL;
 END;
$_$;

CREATE TRIGGER t1 AFTER UPDATE on foo
FOR EACH ROW EXECUTE PROCEDURE trig1();

CREATE TRIGGER t2 AFTER UPDATE on foo
FOR EACH ROW EXECUTE PROCEDURE trig2();

CREATE TRIGGER t3 AFTER UPDATE on foo
FOR EACH ROW EXECUTE PROCEDURE trig3();

UPDATE foo SET a=a; -- all three fire

ALTER TABLE foo ENABLE ALWAYS TRIGGER t1;

ALTER TABLE foo ENABLE REPLICA TRIGGER t2;

UPDATE foo SET a=a; -- two does not fire

SET session_replication_role TO 'replica';

UPDATE foo SET a=a; -- three does not fire

SET session_replication_role TO DEFAULT;

UPDATE foo SET a=a; -- two does not fire

The output of the above yields:

CREATE TRIGGER
psql:trig.example:53: NOTICE:  I am trigger one
psql:trig.example:53: NOTICE:  I am trigger two
psql:trig.example:53: NOTICE:  I am trigger three
UPDATE 1
ALTER TABLE
ALTER TABLE
psql:trig.example:59: NOTICE:  I am trigger one
psql:trig.example:59: NOTICE:  I am trigger three
UPDATE 1
SET
psql:trig.example:63: NOTICE:  I am trigger one
psql:trig.example:63: NOTICE:  I am trigger two
UPDATE 1
SET
psql:trig.example:67: NOTICE:  I am trigger one
psql:trig.example:67: NOTICE:  I am trigger three
UPDATE 1


- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200804091452
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAkf9EUUACgkQvJuQZxSWSsgrQwCg7Q6ZBLBzzfy5fntxXPI17i8l
VTUAoNK++VH2lVj42tstfXM49P7NtCa+
=ex6Z
-END PGP SIGNATURE-



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Ivan Sergio Borgonovo
On Wed, 9 Apr 2008 19:11:57 +0200
Alban Hertroys <[EMAIL PROTECTED]> wrote:

> On Apr 9, 2008, at 5:27 PM, Jozef Ševčík wrote:
> > In MSSQL I had something like:
> > SELECT Column1,Column2 from MyTable
> >
> > In PgSQL I write:
> > SELECT “Column1”, “Column2” from “MyTable”
> >
> > Which is fine and working, I have no doubt about it. I’m just  
> > guessing if this does not affect performance
> > in any way.
> 
> What are you trying to fix that you don't just write SELECT  
> Column1,Column2 from MyTable ?
> Postgres understands that fine, why do you want to quote those  
> identifiers? Maybe your application code is case-sensitive with  
> regards to column (and maybe table) names?

There are a couple of small gotcha.

eg.

- PHP actually is case sensitive so:

$row['MyRow'] != $row['myrow']

If you used camel case in pg without quotes it will be a pain.

- Some pg functions aren't case-proof eg. pg_get_serial_sequence

I'm thinking to write a script to quote all identifiers... but I'm
worried it will look to much as a parser rather than a simple sed
script since I got trapped by the above too.


-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Craig Ringer

Abhishek MANDHANA wrote:

Did 30 seconds search worked ? for me its didnt ?

Please just dont test the connection, the applet shows Connection successful
, Are you able to create it  and see it under Server Explorer?
  


I mostly use Linux. I'm on Vista right now, but I have never used Visual 
Basic and have none of the tools for it.  I have Visual Studio for C++ 
installed, but not for Visual Basic .NET. So I can't test it, and I'm 
afraid I'm not going to install VB.net to test it. As such, I'm working 
from information available on the 'net, such as the PostgreSQL OLE DB 
provider documentation (which, by the way, is hard to find - I landed up 
digging it out of ViewCVS). You, however, will have a copy of the file 
that came with your copy of the OLE DB provider.


This is the README file. I strongly suggest having a look:
   
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/oledb/oledb/README?rev=1.7&content-type=text/x-cvsweb-markup


In any case, it's obvious in your screenshot that you left the "server" 
and "location" fields blank in the connection setup form. This is most 
likely the cause of your problem. Try putting "localhost" in the 
"server" box, and the name of your database in the "location" box. If 
you have not created a database yet, you will need to do so. See the 
PostgreSQL documentation on how to do that.


As for the error message, it basically means "oops, it didn't work and I 
don't know why". The PostgreSQL OLE DB provider README explains how to 
get more detailed error information.


--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Terry Lee Tucker
On Wednesday 09 April 2008 13:12, Tom Lane wrote:
> Terry Lee Tucker <[EMAIL PROTECTED]> writes:
> > My question is: When tgenabled is set to "D", how does that setting
> > interact with session_replication_role and, is there a way to use
> > tgenabled with a setting of "D" to prevent a particular trigger from
> > firing. Using ALTER TABLE to disable the trigger won't work because the
> > whole table is locked during the transaction and I only want the disabled
> > trigger to apply to the current transaction in the current session.
>
> I'll bet you're missing a relcache flush operation.  I don't think an
> update on pg_trigger will cause that by itself.
>
>regards, tom lane

Thanks for the response Tom. I hate to be dense, but I really don't have a 
clue as to what you are saying. I can't find anything in the docs regarding 
"relcache flush". I have to get this issue resolved as our system uses a Perl 
process to keep certain columns in certain tables in sync across several 
databases, so, if you can point me in the right direction, that would be 
great.

-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
[EMAIL PROTECTED]
www.turbocorp.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Abhishek MANDHANA
Did 30 seconds search worked ? for me its didnt ?

Please just dont test the connection, the applet shows Connection successful
, Are you able to create it  and see it under Server Explorer?

Abhi


On Wed, Apr 9, 2008 at 7:39 PM, Craig Ringer <[EMAIL PROTECTED]>
wrote:

> leoabhi wrote:
>
>  now my first 2 posts speak about this setup and problem/error i had while
> > setting up connection..it gives OLE-DB error which we already spoke
> > about..STILL UNRESOLVED.
> >
> > All goes around setup required to connect to postgreSQL using VB ,Server
> > Explorer.
> > I need the settings to be done in Server explorer , so tht i could
> > connect
> > to postgreSQL...please see snapshots from first posts..That is all you
> > will
> > neeed.you will understand it quickly now i hope..I know this speaks much
> > around VB but you need to know why OLE-DB error occurs when you connect
> > a
> > database?
> >
>
> A 30 second Google search suggests that "server" is ... the server
> hostname or IP address, and location is the database name.
>
> --
> Craig Ringer
>



-- 
Mandhana Abhishek R.
http://abhishekrm.googlepages.com


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Craig Ringer

leoabhi wrote:


now my first 2 posts speak about this setup and problem/error i had while
setting up connection..it gives OLE-DB error which we already spoke
about..STILL UNRESOLVED.

All goes around setup required to connect to postgreSQL using VB ,Server
Explorer.
I need the settings to be done in Server explorer , so tht i could connect
to postgreSQL...please see snapshots from first posts..That is all you will
neeed.you will understand it quickly now i hope..I know this speaks much
around VB but you need to know why OLE-DB error occurs when you connect a
database?


A 30 second Google search suggests that "server" is ... the server 
hostname or IP address, and location is the database name.


--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgresql 8.3: stats collector process eat all CPU all time

2008-04-09 Thread Tom Lane
Maxim Boguk <[EMAIL PROTECTED]> writes:
> ktrace/kdump this process show just one sequence:

>   69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
>   69360 postgres RET   poll -1 errno 4 Interrupted system call
>   69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
>   69360 postgres RET   poll -1 errno 4 Interrupted system call

So why is the poll() always returning EINTR?  I think you're looking
at a kernel bug.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Craig Ringer

Jozef Ševčík wrote:

So it all depends on how table is exactly created, thank you.

A last question - is there any way how to 'switch' this for
table without re-creating table again ?
  

ALTER TABLE "MixedCase" RENAME TO "lowercase";

The double quotes are optional on all lower case identifiers.

The tables you're dealing with are not, as far as I know, specially 
flagged as case sensitive or "needs double quotes". They just happen to 
have names containing upper case characters. As PostgreSQL flattens 
unquoted identifiers to lowercase, that means that you need to double 
quote them. There's nothing special about TableName vs tablename vs 
TABLENAME, at least as far as I know.


You can double quote all identifiers and I think many automated query 
building tools do just that. It's just a pain to type.


--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

Hello,

In brief.

TASK : Write a code in VB so that i can connect to postgreSQL and then
execute some stataments from my VB application.

I didnt want to code it ..I found the other way round very similar but
without coding.

Visual basic has a server explorer .. which can be used to connect to
various database(Eg:Access database,mdb or in our case postgreSQL) and then
you can execute the SQL statements in VB, now once you open Server explorer
you need to ADD/Create/setup a  A CONNECTION TO DATABASE which you want to
use., i.e. setup a connection to postgreSQL.

now my first 2 posts speak about this setup and problem/error i had while
setting up connection..it gives OLE-DB error which we already spoke
about..STILL UNRESOLVED.

All goes around setup required to connect to postgreSQL using VB ,Server
Explorer.
I need the settings to be done in Server explorer , so tht i could connect
to postgreSQL...please see snapshots from first posts..That is all you will
neeed.you will understand it quickly now i hope..I know this speaks much
around VB but you need to know why OLE-DB error occurs when you connect a
database?

I have found another way to connect , still i need to check its surety,
hopefully tomo it works 

I hope this helped you understand me better , please reply if you find any
solution. I will again post update about it tomorrow., but if this works it
would be gr8 atleast for me ;-)

>>I'm assuming you can connect from this machine using psql and/or
>>pgadmin, yes? 
Yes richard , I am able to connect

>>I'm assuming you've turned on connection logging at the server and have
>>checked to see what's happening there, yes? 
Yes i turned it on and it helped me to find out the other method , Thanks.

Thank you

Abhi

No idea. You're still not telling us what the error message is when you
try to connect.

I don't use .net, but if you write code to connect to any database then
the connect method/function will return some sort of status code to
indicate success or failure. There will then be a way of getting a
precise error code and message.

I'm assuming you can connect from this machine using psql and/or
pgadmin, yes?

I'm assuming you've turned on connection logging at the server and have
checked to see what's happening there, yes?

What happened when you tried the example code in the driver's tutorial?

-- 
   Richard Huxton
   Archonet Ltd 
-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16592116.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Jozef Ševčík
Hi Alban,

If I do:
select * from SourceCategory

pgAdmin gives me an error: ERROR:  relation "sourcecategory" does not exist

If I do:
select * from "SourceCategory"

It works OK.

As Richard mentioned, it's because table was probably created with CREATE TABLE 
"SourceCategory".
I was not sure about this because I had no control over creating the tables.



S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]
+420 608 782 813


-Original Message-
From: Alban Hertroys [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 09, 2008 7:12 PM
To: Jozef Ševčík
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Quoting table/column names vs performance

On Apr 9, 2008, at 5:27 PM, Jozef Ševčík wrote:
> In MSSQL I had something like:
> SELECT Column1,Column2 from MyTable
>
> In PgSQL I write:
> SELECT “Column1”, “Column2” from “MyTable”
>
> Which is fine and working, I have no doubt about it. I’m just
> guessing if this does not affect performance
> in any way.

What are you trying to fix that you don't just write SELECT
Column1,Column2 from MyTable ?
Postgres understands that fine, why do you want to quote those
identifiers? Maybe your application code is case-sensitive with
regards to column (and maybe table) names?

Regards,
Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:806,47fcf8e1927661781427083!



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes:
> My question is: When tgenabled is set to "D", how does that setting interact 
> with session_replication_role and, is there a way to use tgenabled with a 
> setting of "D" to prevent a particular trigger from firing. Using ALTER TABLE
> to disable the trigger won't work because the whole table is locked during 
> the transaction and I only want the disabled trigger to apply to the current 
> transaction in the current session.

I'll bet you're missing a relcache flush operation.  I don't think an
update on pg_trigger will cause that by itself.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Alban Hertroys

On Apr 9, 2008, at 5:27 PM, Jozef Ševčík wrote:

In MSSQL I had something like:
SELECT Column1,Column2 from MyTable

In PgSQL I write:
SELECT “Column1”, “Column2” from “MyTable”

Which is fine and working, I have no doubt about it. I’m just  
guessing if this does not affect performance

in any way.


What are you trying to fix that you don't just write SELECT  
Column1,Column2 from MyTable ?
Postgres understands that fine, why do you want to quote those  
identifiers? Maybe your application code is case-sensitive with  
regards to column (and maybe table) names?


Regards,
Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,47fcf8df927661984376163!



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Jozef Ševčík
Richard,

thanks for the great explanation. I'm sorry because I missed your notes to 
performance
in previous e-mail between the lines.

Cast (in)sensitivity is much more clear for me now.
When I moved project from MSSQL to Postgres I did not create tables manually,
I used some mssql-to-postgres migration tool. So it looks
like this tool used to put double-quotes when creating table.

So it all depends on how table is exactly created, thank you.

A last question - is there any way how to 'switch' this for
table without re-creating table again ?

Thanks in advance.

S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]
+420 608 782 813


-Original Message-
From: Richard Huxton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 09, 2008 6:57 PM
To: Jozef Ševčík
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Quoting table/column names vs performance

Jozef Ševčík wrote:
> Richard,
>
> thanks for the answer.
> In fact, I double-quoted identifiers only because PgSQL forced me to do so
> when using capitalized letters in table/column name.

Well, if you don't quote them they get folded to lower-case and you get
case-insensitive matching.

CREATE TABLE MyTable1 (a int); -- ends up as mytable1
CREATE TABLE "MyTable2" (a int); -- stays as MyTable2
SELECT * FROM MyTable1;  -- OK, looks for "mytable1"
SELECT * FROM MYTABLE1;  -- also OK
SELECT * FROM MyTaBlE1;  -- also OK
SELECT * FROM "MyTable1";-- Fails, looks for "MyTable1"
SELECT * FROM MyTable2;  -- Fails, looks for "mytable2"
SELECT * FROM "MyTable2"; -- OK

> I'm OK with this if it's PgSQL requirement (app runs on NHibernate so I just 
> change
> column="MyColumn" to column="`MyColumn`" in mapping files).
>
> In fact I like capitalized column/table names (more readable for me),
> but the point is if this affect performance when running queries (for example 
> PgSQL engine
> might take more time to analyze query with double-quoted identifiers or so).
>
> Is there any performance penalty for this ?

As I said, no cost you'll ever notice.

--
   Richard Huxton
   Archonet Ltd

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Richard Huxton

Jozef Ševčík wrote:

Richard,

thanks for the answer.
In fact, I double-quoted identifiers only because PgSQL forced me to do so
when using capitalized letters in table/column name.


Well, if you don't quote them they get folded to lower-case and you get 
case-insensitive matching.


CREATE TABLE MyTable1 (a int); -- ends up as mytable1
CREATE TABLE "MyTable2" (a int); -- stays as MyTable2
SELECT * FROM MyTable1;  -- OK, looks for "mytable1"
SELECT * FROM MYTABLE1;  -- also OK
SELECT * FROM MyTaBlE1;  -- also OK
SELECT * FROM "MyTable1";-- Fails, looks for "MyTable1"
SELECT * FROM MyTable2;  -- Fails, looks for "mytable2"
SELECT * FROM "MyTable2"; -- OK


I'm OK with this if it's PgSQL requirement (app runs on NHibernate so I just 
change
column="MyColumn" to column="`MyColumn`" in mapping files).

In fact I like capitalized column/table names (more readable for me),
but the point is if this affect performance when running queries (for example 
PgSQL engine
might take more time to analyze query with double-quoted identifiers or so).

Is there any performance penalty for this ?


As I said, no cost you'll ever notice.

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Terry Lee Tucker
On Wednesday 09 April 2008 11:00, Greg Sabino Mullane wrote:
> > I have a situation where an external process needs to disable the firing
> > of triggers on a table.
>
> ...
>
> > session_replication_role is set to "origin". I thought this was supposed
> > to be fixed in later versions of Postgres (I'm converting from 7.4.19 to
> > 8.3.1), so apparently I'm missing something.
>
> You want: SET session_replication_role to 'replica';
>
> --
> Greg Sabino Mullane [EMAIL PROTECTED]
> PGP Key: 0x14964AC8 200804091058
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

I see the following in the documentation for pg_trigger related to tgenabled:
"Controls in which session_replication_role modes the trigger fires. O = 
trigger fires in "origin" and "local" modes, D = trigger is disabled, R = 
trigger fires in "replica" mode, A = trigger fires always."

My question is: When tgenabled is set to "D", how does that setting interact 
with session_replication_role and, is there a way to use tgenabled with a 
setting of "D" to prevent a particular trigger from firing. Using ALTER TABLE 
to disable the trigger won't work because the whole table is locked during 
the transaction and I only want the disabled trigger to apply to the current 
transaction in the current session.

TIA
-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
[EMAIL PROTECTED]
www.turbocorp.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Francisco Figueiredo Jr.
> >
> >
>
>  Ask the .npgsql mailing lists. They'll be able to tell you. There must be a
> way of handling "non-standard" types in any case.
>

Hi all!

We are already working on that. The cast problem is indeed a bug in
Npgsql. We already have a one line fix for it.

Check it out here:

http://pgfoundry.org/forum/message.php?msg_id=1003377

I hope it helps.




-- 
Regards,

Francisco Figueiredo Jr.
fxjr.blogspot.com
www.npgsql.org

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
If I get the install to the point where it prompts me "Service
'PostgreSQL Database Server 8.3'(pgsql-8.3) failed to start.
Verify that you have sufficient priveleges to start system services",
I can connect to the database with pgAdmin III without any apparent
issues. Soif you close the installer forcibly at this point it
will be ok, or at least appear as such to a cursory inspection.

It's a hack, but it'll do me for the time being,
Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Jozef Ševčík
Richard,

thanks for the answer.
In fact, I double-quoted identifiers only because PgSQL forced me to do so
when using capitalized letters in table/column name.
I'm OK with this if it's PgSQL requirement (app runs on NHibernate so I just 
change
column="MyColumn" to column="`MyColumn`" in mapping files).

In fact I like capitalized column/table names (more readable for me),
but the point is if this affect performance when running queries (for example 
PgSQL engine
might take more time to analyze query with double-quoted identifiers or so).

Is there any performance penalty for this ?

S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]
+420 608 782 813


-Original Message-
From: Richard Huxton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 09, 2008 5:49 PM
To: Jozef Ševčík
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Quoting table/column names vs performance

Jozef Ševčík wrote:
> Hi all,
>
> I just switched from MS SQL to PostgreSQL on project and have
> question about double-quoting names of fields/tables regarding to
> performance.

If the cost of quoting column-names is a significant part of your query
costs, you must have some very fast queries. I would not worry.

> In MSSQL I had something like: SELECT Column1,Column2 from MyTable
>
> In PgSQL I write: SELECT "Column1", "Column2" from "MyTable"
>
> Which is fine and working, I have no doubt about it. I'm just
> guessing if this does not affect performance in any way. I know I may
> rename tables/fields to lowercase and avoid double-quotting, but it
> double-quotting has no affect on perf. is it worth it ? Or are there
> any advantages of using 'non-quoted' identifiers agains double-quoted

If you double-quote identifiers when you create them you'll want to
double-quote them everywhere they are used. That's OK with a new sytem,
but can be awkward if you have a lot of existing code that isn't already
quoted.

--
   Richard Huxton
   Archonet Ltd

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Richard Huxton

Jozef Ševčík wrote:

Hi all,

I just switched from MS SQL to PostgreSQL on project and have
question about double-quoting names of fields/tables regarding to
performance.


If the cost of quoting column-names is a significant part of your query 
costs, you must have some very fast queries. I would not worry.



In MSSQL I had something like: SELECT Column1,Column2 from MyTable

In PgSQL I write: SELECT "Column1", "Column2" from "MyTable"

Which is fine and working, I have no doubt about it. I'm just
guessing if this does not affect performance in any way. I know I may
rename tables/fields to lowercase and avoid double-quotting, but it
double-quotting has no affect on perf. is it worth it ? Or are there
any advantages of using 'non-quoted' identifiers agains double-quoted


If you double-quote identifiers when you create them you'll want to 
double-quote them everywhere they are used. That's OK with a new sytem, 
but can be awkward if you have a lot of existing code that isn't already 
quoted.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] tsvector_update_trigger throws error "column is not of tsvector type"

2008-04-09 Thread Markus Wollny
Hi!

Tom Lane wrote: 
> 
> Well, you could probably get away with an "update pg_attribute set
> atttypid ..." but it might be safer to just wait for 8.3.2. 

I like it safe :) Thanks for the advice!

Kind regards

   Markus


Computec Media AG
Sitz der Gesellschaft und Registergericht: Fürth (HRB 8818)
Vorstandsmitglieder: Johannes S. Gözalan (Vorsitzender) und Rainer Rosenbusch
Vorsitzender des Aufsichtsrates: Jürg Marquard 
Umsatzsteuer-Identifikationsnummer: DE 812 575 276



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Dump/Transfer Sequence Problems

2008-04-09 Thread Richard Huxton

Stefan Schwarzer wrote:

Hi,

I am using Navicat to transfer data from one database to another. But it 
soon gives me an error message like the following:


I think you'll probably have to ask the navicat people.

If you want to use pg_dump to transfer data from 8.1 to 8.2 though, use 
the version of pg_dump that ships with 8.2.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Syra . Didelez
No, at least not that I know
you can start the secondary logon service from command line with:

net start seclogon


- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com



"Martin Gainty" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
04/09/2008 05:32 PM

To
Syra Didelez/AWVJR/[EMAIL PROTECTED]
cc

Subject
Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution







Thanks Syra
I do not see netsvcs or svchost command...are these commands specific to 
Vista?

Bedankt
Martin-
- Original Message - 
From: [EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 
Cc: pgsql-general@postgresql.org ; [EMAIL PROTECTED] 
Sent: Wednesday, April 09, 2008 11:17 AM
Subject: Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary 
distribution


You can find it out by goign to Computer Management -> Services and 
Applications -> Services 
there's a list with all the services running on your system. 

If you must check that out programmatically, see if there is any 
svchost.exe process running, 
start with the -k netsvcs option. 

Good Luck ! 

I have a question for you: Are you trying to run a silent install ? 

- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com


Re: [GENERAL] tsvector_update_trigger throws error "column is not of tsvector type"

2008-04-09 Thread Tom Lane
"Markus Wollny" <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> It should work if you explicitly change the column's type to
>> pg_catalog.tsvector.  (There's a fix in place for 8.3.2, also.) 

> Which would probably be not such a good idea to try on a 7GB table in 
> production, I think. Or is there some way hacking the system catalog to 
> correct the type instead of an ALTER TABLE ... ALTER COLUMN TYPE?

Well, you could probably get away with an "update pg_attribute set
atttypid ..." but it might be safer to just wait for 8.3.2.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Martin Gainty
Thanks Syra

I do not see netsvcs or svchost command...are these commands specific to Vista?

Bedankt
Martin-
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Cc: pgsql-general@postgresql.org ; [EMAIL PROTECTED] 
  Sent: Wednesday, April 09, 2008 11:17 AM
  Subject: Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary 
distribution



  You can find it out by goign to Computer Management -> Services and 
Applications -> Services 
  there's a list with all the services running on your system. 

  If you must check that out programmatically, see if there is any svchost.exe 
process running, 
  start with the -k netsvcs option. 

  Good Luck ! 

  I have a question for you: Are you trying to run a silent install ? 

  - Syra Didelez -
  Apogee Portal Deployment Manager
  Apogee Portal Hotfix Manager
  Agfa-Gevaert N.V.

  Tel.: +32 3 444 4237
  http://www.agfa.com

[GENERAL] Quoting table/column names vs performance

2008-04-09 Thread Jozef Ševčík
Hi all,

I just switched from MS SQL to PostgreSQL on project and have question about 
double-quoting names of fields/tables
regarding to performance.

In MSSQL I had something like:
SELECT Column1,Column2 from MyTable

In PgSQL I write:
SELECT "Column1", "Column2" from "MyTable"

Which is fine and working, I have no doubt about it. I'm just guessing if this 
does not affect performance
in any way.
I know I may rename tables/fields to lowercase and avoid double-quotting, but 
it double-quotting has no
affect on perf. is it worth it ?
Or are there any advantages of using 'non-quoted' identifiers agains 
double-quoted ?

Thanks

S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]
+420 608 782 813



Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Syra,

No, I'm not running a silent install.

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Syra,

Yes, the svchost.exe process is running. Back to the drawing board

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Syra . Didelez
Is it also running, being enabled only is not enough,
if that's not it, I'm afraid I can't help you

- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com

Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Syra . Didelez
You can find it out by goign to Computer Management -> Services and 
Applications -> Services
there's a list with all the services running on your system.

If you must check that out programmatically, see if there is any 
svchost.exe process running,
start with the -k netsvcs option.

Good Luck !

I have a question for you: Are you trying to run a silent install ? 

- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com

Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Syra,

I can confirm that secondary logon appears as enabled under
"Services". I guess that narrows down the problem...

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Terry Lee Tucker
On Wednesday 09 April 2008 11:00, Greg Sabino Mullane wrote:
> > I have a situation where an external process needs to disable the firing
> > of triggers on a table.
>
> ...
>
> > session_replication_role is set to "origin". I thought this was supposed
> > to be fixed in later versions of Postgres (I'm converting from 7.4.19 to
> > 8.3.1), so apparently I'm missing something.
>
> You want: SET session_replication_role to 'replica';

Thanks for the response Greg. Should the session_replication_role be restored 
to "origin", when the process is complete?

>
> --
> Greg Sabino Mullane [EMAIL PROTECTED]
> PGP Key: 0x14964AC8 200804091058
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
[EMAIL PROTECTED]
www.turbocorp.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Syra,

It is my machine, and I have exclusive access to it. I cannot think of
why it would be disabled. I'm trying to figure out how to verify that
it is running. I found a Korean blog post that discusses the problem,
but the google translate isn't great:

http://www.google.com/translate?u=http%3A%2F%2Fentireboy.egloos.com%2F3677148&langpair=ko%7Cen&hl=en&ie=UTF8

Anyone speak Korean?
Regards,
Peter

On Wed, Apr 9, 2008 at 4:09 PM,  <[EMAIL PROTECTED]> wrote:
>
> No, it is not, there are always the 'smart' sys admins who block everything
> everywhere ...
>
>
>
>  - Syra Didelez -
>  Apogee Portal Deployment Manager
>  Apogee Portal Hotfix Manager
>  Agfa-Gevaert N.V.
>
>  Tel.: +32 3 444 4237
>  http://www.agfa.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Postgresql 8.3: stats collector process eat all CPU all time

2008-04-09 Thread Maxim Boguk

details:

db version: postgres (PostgreSQL) 8.3.0
OS version: FreeBSD 7.0-RELEASE

stats collector eating whole single CPU last week or so...

TOP lookin like:

  PID USERNAME  THR PRI NICE   SIZERES STATE  C   TIME   WCPU COMMAND
69360 pgsql   1 1240 22380K  5548K CPU0   1 258.6H 99.02% postgres

where 69360 is:
USERPID %CPU %MEM   VSZ   RSS  TT  STAT STARTED  TIME COMMAND
pgsql 69360 100,0  0,1 22380  5548  ??  Rs   20мар08 15513:55,99 postgres: 
stats collector process(postgres)

Server is dedicated server for DB... under small load so stats collector eat 
more CPU then all other db activity by 5-10x.

Stats collector itself doing his work (eg i see all required requests in 
pg_stat_activity and  counts work well too).

And stat collector add a lot system load on server.

ktrace/kdump this process show just one sequence:

 69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
 69360 postgres RET   poll -1 errno 4 Interrupted system call
 69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
 69360 postgres RET   poll -1 errno 4 Interrupted system call
 69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
 69360 postgres RET   poll -1 errno 4 Interrupted system call
 69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)
 69360 postgres RET   poll -1 errno 4 Interrupted system call
 69360 postgres CALL  poll(0x7fffd4e0,0x1,0x7d0)

kdump.out for 1 second size over 10Mbytes.


Look like something wrong going on.

Any idea what happend and how to fix situation (after postgres reboot situation 
become bad again in few days).

--
Maxim Boguk

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Dump/Transfer Sequence Problems

2008-04-09 Thread Stefan Schwarzer

Hi,

I am using Navicat to transfer data from one database to another. But  
it soon gives me an error message like the following:


[Err] [Dtf] Transfer Data [create table "admin"."news" (   "id" int4  
not null default nextval('news_id_seq1'::regclass) , "date" date ,  
"text_en" text , "text_fr" text , "text_es" text )  WITHOUT OIDS;
ALTER table "admin"."news" SET WITHOUT CLUSTER;;]: ERROR:  relation  
"news_id_seq1" does not exist


Ok, I understand meanwhile that there is a sequence being created when  
using SERIALs But why does a dump or that kind of transfer  
transfers not the sequence with it? Or is it because I am using 8.1 on  
one and 8.2 on another machine? I can't imagine...


Thanks for any suggestions,

Stef


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Syra . Didelez
No, it is not, there are always the 'smart' sys admins who block 
everything everywhere ...


- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com

Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Syra,

Is it not on by default?
Regards,
Peter

On Wed, Apr 9, 2008 at 3:55 PM,  <[EMAIL PROTECTED]> wrote:
>
> Is the secondary logon service running on your system ?
>
>  - Syra Didelez -
>  Apogee Portal Deployment Manager
>  Apogee Portal Hotfix Manager
>  Agfa-Gevaert N.V.
>
>  Tel.: +32 3 444 4237
>  http://www.agfa.com
>
>
>
>  "Peter Geoghegan" <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
>
> 04/09/2008 04:34 PM
>
> To pgsql-general@postgresql.org
>
> cc
>
> Subject [GENERAL] Problem with windows Postgres 8.3.1 MSI binary
> distribution
>
>
>
>
>
>
>
> Hello,
>
>  I have a problem with the windows Postgres 8.3.1 MSI binary
>  distribution. When I attempt to install postgres 8.3.1
>  with postgres automatically creating its own user account, the
>  installer complains:
>
>  "Service 'PostgreSQL Database Server 8.3'(pgsql-8.3) failed to start.
>  Verify that you have sufficient priveleges to start system services."
>
>  This, despite the fact that 4 postgres.exe processes are now visible
>  in task manager, running as the just created postgres user. I believe
>  that the installer creates accounts with the ability to log on as a
>  service, and to log on locally, so this shouldn't be a problem.
>  Besides, I've manually ensured that the account has these privelege in
>  "Local Security Settings", and the account I run
>  PGinstaller is an administrative account.
>
>  This is a new user account, not one from a previous postgres install.
>  I deleted all the older ones in the well hidden "Local Users and
>  Groups" dialog.
>
>  What should I do to prevent this messagebox from appearing, which
>  forces me to roll back the installation?
>
>  Regards,
>  Peter
>
>  --
>  Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>  To make changes to your subscription:
>  http://www.postgresql.org/mailpref/pgsql-general
>
>

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Disable Triggers

2008-04-09 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


> I have a situation where an external process needs to disable the firing of
> triggers on a table.
...
> session_replication_role is set to "origin". I thought this was supposed to
> be fixed in later versions of Postgres (I'm converting from 7.4.19 to 8.3.1),
> so apparently I'm missing something.

You want: SET session_replication_role to 'replica';

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200804091058
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAkf82cMACgkQvJuQZxSWSshqbwCfURuaWGtih7HEIrPs3lOCU+2V
zN8An3eEH3G/2emX0pl2Z2NmszXB7kiN
=cu+o
-END PGP SIGNATURE-



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Crash after VACUUM FULL cancel

2008-04-09 Thread Alvaro Herrera
Hardwick, Joe wrote:

> We have a cronjob that runs nightly to do the VACUUM FULL ANALYZE on a
> few tables in each schema and occasionally we'll cancel one if they take
> longer than usual to run and block our morning loads.. This is the first
> time Postgres has had any trouble with it.   Is cancelling a full vacuum
> a bad idea?

Yes -- this is a known problem but since VACUUM FULL is deprecated, the
most likely outcome is that it won't get fixed.  Just don't cancel it.

You don't need VACUUM FULL anyway in most cases -- plain VACUUM ANALYZE
should be more than enough.  For the rare cases that it's not, you can
use CLUSTER to compress the dead space.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Syra . Didelez
Is the secondary logon service running on your system ?

- Syra Didelez -
Apogee Portal Deployment Manager
Apogee Portal Hotfix Manager
Agfa-Gevaert N.V.

Tel.: +32 3 444 4237
http://www.agfa.com



"Peter Geoghegan" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
04/09/2008 04:34 PM

To
pgsql-general@postgresql.org
cc

Subject
[GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution







Hello,

I have a problem with the windows Postgres 8.3.1 MSI binary
distribution. When I attempt to install postgres 8.3.1
with postgres automatically creating its own user account, the
installer complains:

"Service 'PostgreSQL Database Server 8.3'(pgsql-8.3) failed to start.
Verify that you have sufficient priveleges to start system services."

This, despite the fact that 4 postgres.exe processes are now visible
in task manager, running as the just created postgres user. I believe
that the installer creates accounts with the ability to log on as a
service, and to log on locally, so this shouldn't be a problem.
Besides, I've manually ensured that the account has these privelege in
"Local Security Settings", and the account I run
PGinstaller is an administrative account.

This is a new user account, not one from a previous postgres install.
I deleted all the older ones in the well hidden "Local Users and
Groups" dialog.

What should I do to prevent this messagebox from appearing, which
forces me to roll back the installation?

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



Re: [GENERAL] High Availability / Replication with Sequoia

2008-04-09 Thread [EMAIL PROTECTED]
Thanks for the help guys,

I should clear up a little what I am trying to achieve I think.

The primary users of this db and application will be located in an
office, each user with a desktop machine, all networked. They need to
work with this DB in a fairly heavy kind of way, in so far as to say
that 80% of their day will be working with the application and the db.

The primary source of data will / must be located on a database server
that is actually in a different facility. It is possible to reach this
server from the office, and is done so daily, however the speed of
connection is very slow and is frequently disconnected - in short
unrelaible. To implement an extension of this 'primary' db with the
associated hardware and licensing costs at the local site is beyond
what the business is willing to pay. It also goes directly against the
'structure' that has been laid out by the IT group in that they want
all the db servers in a single location - regardless of business
impact they want to make their budget savings.

So, what I want to do is to satisfy the IT group by keeping a 'master'
copy of the db on their off-site facility, which in fact will be
populated from a source system sitting on my desk. The ETL tools will
be used for creating a completely (or as near as possible) automated
system for populating the 'master' that is offsite.

What I wanted to do next was to have Postgres installed on each of the
local users machines, along with the application they require, and run
them as a cluster - if one db goes down or one machine dies the client
software / app can still connect to the cluster and keep functioning
from another machine. I could then have the defective machine attended
to and if necessary re-built... In short the ability to work would not
be interrupted. Or at least thats the hope.

These desktops shut down each night too, as the staff leave to go
home. There is no possibility to install a server locally
(unfortunately). So with this in mind I was hoping that the
'automatic' nature of Sequoia would allow for recovery / updating from
the master or others in the cluster and keep all the local db's up to
date without the users having to do anything.

There is also a desire to have a mobile copy of this db / app for some
of the mobile users that come in to the office. They wont be able to
update while external due to the way the network is designed, but once
back in the office they could do this. I was hoping once again to keep
this as effortless as possible for the users. I am still hoping that
this may be achieveable.

In summary, what we are looking at is an install of Postgres on each
machine, a copy of Tomcat running the application, and maybe Sequoia
or Slony or some combination of both. ETL is handled separately (by
me) and the users are supposed to just be able to get on with their
work.

Do you think this is achieveable or am I up the creek and reaching too
far here?

Cheers

The Frog (you caught me out - its not my real name!)

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Trouble getting effective_cache_size parameter to take

2008-04-09 Thread Hardwick, Joe
Turns out someone had placed a second line further down in the file I
didn't realize was there... So it set it, then reset it.

Thanks,
Joe

-Original Message-
From: Tom Lane [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 08, 2008 8:53 AM
To: Hardwick, Joe
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Trouble getting effective_cache_size parameter to
take 

"Hardwick, Joe" <[EMAIL PROTECTED]> writes:
> I've got a Postgres v8.2.4 server that we recently upped from 2GB RAM 
> to 6GB.  I added:

> effective_cache_size = 5120MB

> to the postgresql.conf file but when I restart the server and do a 
> "show all" it always comes back with "1000MB".  I can set it manually 
> and it takes but for some reason it just seems to ignore it in the
config file.

Sure sounds to me like you're editing the wrong config file ...

regards, tom lane

__

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Crash after VACUUM FULL cancel

2008-04-09 Thread Hardwick, Joe
I realize this is very little info to go on but our server had some
trouble this morning.. 

Postgres 8.2.4 
Linux unicron.marketingsolutionsinc.com 2.6.15-1.2054_FC5smp #1 SMP Tue
Mar 14 16:05:46 EST 2006 i686 i686 i386 GNU/Linux


PID: 15980 - 2008-04-09 07:49:20 CDT - USER: postgres - DB:  maverick -
CMD: VACUUM - ERROR:  canceling statement due to user request
PID: 15980 - 2008-04-09 07:49:20 CDT - USER: postgres - DB:  maverick -
CMD: VACUUM - STATEMENT:  VACUUM FULL ANALYZE bsg_pike.accounts
PID: 15980 - 2008-04-09 07:49:20 CDT - USER: postgres - DB:  maverick -
CMD: VACUUM - PANIC:  cannot abort transaction 116388108, it was already
committed
PID: 4363 - 2008-04-09 07:49:20 CDT - USER:  - DB:   - CMD:  - LOG:
server process (PID 15980) was terminated by signal 6
PID: 4363 - 2008-04-09 07:49:20 CDT - USER:  - DB:   - CMD:  - LOG:
terminating any other active server processes
PID: 28867 - 2008-04-09 07:49:20 CDT - USER: skatz - DB:  maverick -
CMD: idle - WARNING:  terminating connection because of crash of another
server process
PID: 28867 - 2008-04-09 07:49:20 CDT - USER: skatz - DB:  maverick -
CMD: idle - DETAIL:  The postmaster has commanded this server process to
roll back the current transaction and exit, because another server
process exited abnormally and possibly corrupted shared memory.
PID: 28867 - 2008-04-09 07:49:20 CDT - USER: skatz - DB:  maverick -
CMD: idle - HINT:  In a moment you should be able to reconnect to the
database and repeat your command.
PID: 27424 - 2008-04-09 07:49:20 CDT - USER: bsg_pike - DB:  maverick -
CMD: SELECT waiting - WARNING:  terminating connection because of crash
of another server process
PID: 27424 - 2008-04-09 07:49:20 CDT - USER: bsg_pike - DB:  maverick -
CMD: SELECT waiting - DETAIL:  The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.


We have a cronjob that runs nightly to do the VACUUM FULL ANALYZE on a
few tables in each schema and occasionally we'll cancel one if they take
longer than usual to run and block our morning loads.. This is the first
time Postgres has had any trouble with it.   Is cancelling a full vacuum
a bad idea?

I know I'm not going to find any solution to why it happened, I'm just
looking for anyone's take on it..

Thanks,
Joe

__

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] tsvector_update_trigger throws error "column is not of tsvector type"

2008-04-09 Thread Markus Wollny
Tom Lane wrote:
> It should work if you explicitly change the column's type to
> pg_catalog.tsvector.  (There's a fix in place for 8.3.2, also.) 

Which would probably be not such a good idea to try on a 7GB table in 
production, I think. Or is there some way hacking the system catalog to correct 
the type instead of an ALTER TABLE ... ALTER COLUMN TYPE?

Kind regards

   Markus



Computec Media AG
Sitz der Gesellschaft und Registergericht: Fürth (HRB 8818)
Vorstandsmitglieder: Johannes S. Gözalan (Vorsitzender) und Rainer Rosenbusch
Vorsitzender des Aufsichtsrates: Jürg Marquard 
Umsatzsteuer-Identifikationsnummer: DE 812 575 276



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Problem with windows Postgres 8.3.1 MSI binary distribution

2008-04-09 Thread Peter Geoghegan
Hello,

I have a problem with the windows Postgres 8.3.1 MSI binary
distribution. When I attempt to install postgres 8.3.1
with postgres automatically creating its own user account, the
installer complains:

"Service 'PostgreSQL Database Server 8.3'(pgsql-8.3) failed to start.
Verify that you have sufficient priveleges to start system services."

This, despite the fact that 4 postgres.exe processes are now visible
in task manager, running as the just created postgres user. I believe
that the installer creates accounts with the ability to log on as a
service, and to log on locally, so this shouldn't be a problem.
Besides, I've manually ensured that the account has these privelege in
"Local Security Settings", and the account I run
PGinstaller is an administrative account.

This is a new user account, not one from a previous postgres install.
I deleted all the older ones in the well hidden "Local Users and
Groups" dialog.

What should I do to prevent this messagebox from appearing, which
forces me to roll back the installation?

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Richard Huxton

leoabhi wrote:

Hi Richard,

is it possible to check them individually how ?


No idea - you're one using .net - how would you normally check?

> well..!! I think it has

something to do with settings. couldnt even add a connection because once i
click ok, it show the OLE-DB error, so no question about executing
statements..
In tried with mdb database it works.

Found some more help.
http://support.microsoft.com/?scid=kb%3Ben-us%3B269495&x=9&y=10

Please see a snapshot of settings i could change .. The above help file also
speaks about Connection string (FILENAME). Any idea how this setting is to
be done if necessary for adding a postgresql connection.


No idea. You're still not telling us what the error message is when you 
try to connect.


I don't use .net, but if you write code to connect to any database then 
the connect method/function will return some sort of status code to 
indicate success or failure. There will then be a way of getting a 
precise error code and message.


I'm assuming you can connect from this machine using psql and/or 
pgadmin, yes?


I'm assuming you've turned on connection logging at the server and have 
checked to see what's happening there, yes?


What happened when you tried the example code in the driver's tutorial?

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Disable Triggers

2008-04-09 Thread Terry Lee Tucker
Greetings:

I have a situation where an external process needs to disable the firing of 
triggers on a table. I have two backend functions which handle this task:
disable_triggers ('table_name')
enable_triggers ('table_name')

These functions are called inside a transaction. The first, stores various 
attributes of the triggers in a secondary table, then updates pg_trigger 
setting tgenabled to 'D'. The second restores the value of tgenabled from the 
secondary table and then deletes the records from the secondary table. 

I can begin a transaction withing psql, issue: SELECT disable_triggers 
('cust'), make an update to cust and the before and after triggers all fire 
just like normal. I can do a \d cust inside the same transaction and the 
triggers sections is listed with the heading: "Disabled Triggers". I can look 
at the pg_trigger records associated with the cust table, and tgenabled is 
set to "D", but the triggers still fire. session_replication_role is set to 
"origin". I thought this was supposed to be fixed in later versions of 
Postgres (I'm converting from 7.4.19 to 8.3.1), so apparently I'm missing 
something.

Does anyone have any insight?

TIA
-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
[EMAIL PROTECTED]
www.turbocorp.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Richard Huxton

Andrus wrote:
ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It will 
require a lock on the table though.


1. This is part of composite primary key. It is discriminator column and 
cannot contain empty string, only single char is allowed.


char(1) doesn't enforce that. It enforces a maximum of  1 character.
  ^
richardh=> CREATE TABLE chartest (c char(1) NOT NULL);
CREATE TABLE
richardh=> INSERT INTO chartest VALUES ('a'),(' '),('');
INSERT 0 3

What it will do is strip the space in the second value so the last two 
values are the same (and have length()=0). Or rather, spaces are treated 
as trailing the value which amounts to the same thing here.


If you want a single character you'll want to add a CHECK > '' to a 
varchar or text column. That's because using the check on a char() 
column will disallow a space-character too.


richardh=> ALTER TABLE chartest ADD CONSTRAINT ccheck CHECK (c > '');
ALTER TABLE
richardh=> INSERT INTO chartest VALUES ('a'),(' '),('');
ERROR:  new row for relation "chartest" violates check constraint "ccheck"
richardh=> INSERT INTO chartest VALUES ('a'),(' ');
ERROR:  new row for relation "chartest" violates check constraint "ccheck"


2. I'm afraid that this will broke existing applications.


Possible, particularly since the behaviour of the column as defined is 
problematic anyway. It depends on how they expect a single space to 
behave vs an empty string.



So I'm not sure that it is reasonable to make such change.

I is more reasonable to force npgsql driver to generate other code if no 
other solution.

npgsql driver wants to add explicit casts to parameters.
Is it reasonable to force driver to generate code

select * from test where tc=' '::char(1);

for char parameter type ?
I'd say so - I presume it just needs to be taught about different types of 
text. Presumably it already knows that int8 is different from int4, so 
it'll be doing something similar already.


Should it cast to char(1) or varchar(1) ?


Well in your case char(1), obviously.


Driver cannot determine this form .NET type char.


I'm guessing it doesn't rely on the .NET type, but rather on the 
database types. Certainly there are plenty of types available to PG that 
probably don't have a mapping in a standard .NET install.


So this seems not possible without providing additional meta information to 
driver, i.e. standard ADO .NET interface cannot used.


So I think that only solution is to create this query using string 
concatenation and possibly open it to sql injection attacks, parameter 
replacement is not possible.


Ask the .npgsql mailing lists. They'll be able to tell you. There must 
be a way of handling "non-standard" types in any case.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Trouble with foreign key

2008-04-09 Thread Kyle Wilcox

How is your foreign key defined?

From a quick look it seems the column is named "_stamp" not 
"_tmp_stamp" in the tmp_stamp table.


[EMAIL PROTECTED] wrote:

Hi,

there is a problem with foreign key (PG 8.3RC2). Please, look at below. I don't 
understand this behavior. Why this INSERT is ending with this error message. In 
my opinion, the key is obviously present. Thank you.
--
Otakarek

# INSERT INTO www_es_orderhead_cs(_status,_tmp_ip,_tmp_stamp) 
VALUES('n','xx.121.111.31','2f980de9f2297c7902f3415f6537c6be');

ERROR:  insert or update on table "www_es_orderhead_cs" violates foreign key constraint 
"www_es_orderhead_cs__tmp_stamp_fkey"
DETAIL:  Key (_tmp_stamp)=(2f980de9f2297c7902f3415f6537c6be) is not present in table 
"tmp_stamp".

# SELECT * from tmp_stamp;
   _ip|  _stamp  |   _expired   
 | _var
--+--+---+--
 xx.121.111.31/32 | 2f980de9f2297c7902f3415f6537c6be | 2008-04-08 
17:49:33.193914+02 |
(1 row)



--

 Kyle Wilcox
 NOAA Chesapeake Bay Office
 410 Severn Avenue
 Suite 107A
 Annapolis, MD 21403
 office: (410) 295-3151
 [EMAIL PROTECTED]

 A: It takes over twice as long to understand the conversation.
 Q: What's wrong with top-posting?
 A: Top-posting.
 Q: What's the worst thing about plain text email discussions?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] tsvector_update_trigger throws error "column is not of tsvector type"

2008-04-09 Thread Tom Lane
"Markus Wollny" <[EMAIL PROTECTED]> writes:
> Everything works fine. It's sort of less elegant though than having just the 
> one generic trigger function and configuring the needed fields in the trigger 
> itself. 

It should work if you explicitly change the column's type to
pg_catalog.tsvector.  (There's a fix in place for 8.3.2, also.)

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Cannot use a standalone backend to VACUUM in "postgres""

2008-04-09 Thread Alvaro Herrera
Manuel Sugawara wrote:

> Ok, will do that. Thanks a lot Alvaro. Want me to send more details to
> debug the problem?.

Yes, it would be good to know why the shared catalogs were not being
vacuumed, if you can find that out.  I would have guessed that they
weren't being vacuumed due to the fact that they can only be vacuumed by
a superuser, but in a standalone backend you are always superuser.  So
if you ran a database-wide vacuum, they should have been processed.

What happens if you try "vacuum pg_database", etc?  Does the
age(relfrozenxid) change?

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: R: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Peter Geoghegan
Paolo,

Oh yes, I see it now. It was necessary to re-initialise the database
in order for that to appear, which I have not done until now.

Now I have a new problem. When I attempt to install postgres 8.3.1
with postgres automatically creating its own user account, the
installer complains:

"Service 'PostgreSQL Database Server 8.3'(pgsql-8.3) failed to start.
Verify that you have sufficient priveleges to start system services."

This, despite the fact that 4 postgres.exe processes are now visible
in task manager, running as the just created postgres user. I believe
that the installer creates accounts with the ability to start
services, so this shouldn't be a problem. The account I run
PGinstaller is an administrative account.

This is a new user account, not one from a previous postgres install.
I deleted all the older ones in the well hidden "Local Users and
Groups" dialog.

What should I do to prevent this messagebox from appearing, which
forces me to roll back the installation?

Regards,
Peter

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] begin transaction locks out other connections

2008-04-09 Thread Richard Huxton

Ivano Luberti wrote:

On client1 we execute

begin;
insert into table1

and a message of correct execution for both statements is returned

On client2 we execute

begin;
insert into table2

and the client receives a correct execution message for the begin stmt 
but waits for the insert statement until client1 execute either a commit 
or a rollback.


These aren't valid statements, so you can't be getting a "success" 
message. You're going to have to give details of what you're doing if 
you want someone to tell you what is being locked and why.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Raymond O'Donnell

On 09/04/2008 11:50, Peter Geoghegan wrote:


I recall that in earlier versions of the PostgreSQL windows binary
distribution, I had finer grained control of what modules were
installed. The only optional module is now PL/Java, which I don't use,
and things like headers and libraries. I cannot specify installing
Pl/PgSQL, Pl/Perl etc, or this fabled debugging module for that
matter.


Working from memory, the contrib modules aren't listed in the initial 
tree view of components (which is what you're referring to here) - 
they're chosen at a later stage in the installation process.


Ray.

--
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
--

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] begin transaction locks out other connections

2008-04-09 Thread Ivano Luberti
Hello everybody, I have searched for a long time about this issue but I 
was not able to find what is the cause. Maybe because I have not been 
able to identify the right keywords.


We are experiencing the following problem using postgres8.3 and postgres8.1
On client1 we execute

begin;
insert into table1

and a message of correct execution for both statements is returned

On client2 we execute

begin;
insert into table2

and the client receives a correct execution message for the begin stmt 
but waits for the insert statement until client1 execute either a commit 
or a rollback.


The same happens with an insert on client1 and an update on client2 .
While there is no problem with an insert on client1 and a select on client2.

We have experienced the same problem either using pgAdmin as a client or 
the jdbc driver.
So it seems the problem is on the db server: we experienced the same 
problem on different installations of the same server on different 
operative system.


Of course I'm colling this a problem beacuse there would be no need of 
transaction support if request would be strictly serialized.


Thank to anyone has payed attention to this message.





_
_ __ 

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Andrus
> ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It will 
> require a lock on the table though.

1. This is part of composite primary key. It is discriminator column and 
cannot contain empty string, only single char is allowed.
2. I'm afraid that this will broke existing applications.

So I'm not sure that it is reasonable to make such change.

>> I is more reasonable to force npgsql driver to generate other code if no 
>> other solution.
>> npgsql driver wants to add explicit casts to parameters.
>> Is it reasonable to force driver to generate code
>>
>> select * from test where tc=' '::char(1);
>>
>> for char parameter type ?
>
> I'd say so - I presume it just needs to be taught about different types of 
> text. Presumably it already knows that int8 is different from int4, so 
> it'll be doing something similar already.

Should it cast to char(1) or varchar(1) ?
Driver cannot determine this form .NET type char.
So this seems not possible without providing additional meta information to 
driver, i.e. standard ADO .NET interface cannot used.

So I think that only solution is to create this query using string 
concatenation and possibly open it to sql injection attacks, parameter 
replacement is not possible.

> Check if there is a mailing-list for the npgsql project and ask there - 
> someone might already be working on it.

Done.

Andrus. 



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] How does psql actually implement the \d commands

2008-04-09 Thread Albe Laurenz
Andrew Falanga wrote:
> 
> I know about the -E option to psql and did that to get the following,
> which is what psql does for a \d :
> 
> * QUERY **
> SELECT c.oid,
>   n.nspname,
>   c.relname
> FROM pg_catalog.pg_class c
>  LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
> WHERE pg_catalog.pg_table_is_visible(c.oid)
>   AND c.relname ~ '^(personaldata)$'
> ORDER BY 2, 3;
> **
> 
> * QUERY **
> SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules
> FROM pg_catalog.pg_class WHERE oid = '17408'
> **
> 
> * QUERY **
> SELECT a.attname,
>   pg_catalog.format_type(a.atttypid, a.atttypmod),
>   (SELECT substring(d.adsrc for 128) FROM pg_catalog.pg_attrdef d
>WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND
> a.atthasdef),
>   a.attnotnull, a.attnum
> FROM pg_catalog.pg_attribute a
> WHERE a.attrelid = '17408' AND a.attnum > 0 AND NOT a.attisdropped
> ORDER BY a.attnum
> **
> 
> * QUERY **
> SELECT c.relname FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i
> WHERE c.oid=i.inhparent AND i.inhrelid = '17408' ORDER BY inhseqno ASC
> **
> 
> Now, I tried to execute these queries one at a time and they failed,
> somewhat miserably.  In what order does PostgreSQL actually execute
> them?  Are they implemented as sub-queries?  If so, in what order are
> they executed?

They do not fail here, and they should not fail.
They should be executed as above, in this order.

What are the miserable error messages you get?

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] tsvector_update_trigger throws error "column is not of tsvector type"

2008-04-09 Thread Markus Wollny
Hi!

Tom Lane wrote:
> I wrote:
>> Would you confirm that
>> select atttypid from pg_attribute where attrelid =
>> 'public.ct_com_board_message'::regclass and attname = 'idxfti';
>> gives 3614 (the preassigned OID for pg_catalog.tsvector)? 
> 
> Actually, I'll bet a nickel that you'll find it doesn't, but rather
> returns the OID of the domain over tsvector that the new
> contrib/tsearch2 module creates.  It's clearly a bug that the
> built-in trigger doesn't allow the domain alias to be used --- will
> fix.   
> 
>   regards, tom lane

That nickel would be yours to keep :)

community=# select atttypid from pg_attribute where attrelid = 
'public.ct_com_board_message'::regclass and attname = 'idxfti';
 atttypid
--
 33991259
(1 row)

Concerning the table definition - sorry, I edited out a couple of fields too 
many, which I assumed were not relevant to this case. Here is the full table 
definition:

CREATE TABLE public.ct_com_board_message
(
board_id integer DEFAULT 0,
thread_id integer DEFAULT 0,
father_id integer DEFAULT 0,
message_id integer NOT NULL DEFAULT 0,
user_id integer DEFAULT 0,
title text,
signature text,
follow_up text,
count_reply integer DEFAULT 0,
last_reply timestamptz,
created timestamptz DEFAULT now(),
article_id integer DEFAULT 0,
logged_ip text,
state_id smallint DEFAULT 0,
user_login text,
user_status smallint DEFAULT 5,
user_rights text,
text text,
deleted_user_id integer DEFAULT -1,
user_rank text,
user_rank_description text,
user_rank_picture text,
deleted_date timestamptz,
deleted_login text,
user_created timestamptz,
poll_id integer DEFAULT 0,
last_updated timestamptz DEFAULT now(),
idxfti tsvector,
CONSTRAINT "pk_ct_com_board_message" PRIMARY KEY (message_id)
);

The trigger definition:
CREATE TRIGGER "tsvectorupdate"
BEFORE
INSERT OR UPDATE
ON "public"."ct_com_board_message"
FOR EACH ROW
EXECUTE PROCEDURE 
pg_catalog.tsvector_update_trigger(idxfti,'pg_catalog.german',title,text,user_login);

And the error message from the log:
<2008-04-09 13:42:48 CEST - 8820: 192.168.222.132(52319)@community>ERROR:  
column "idxfti" is not of tsvector type
<2008-04-09 13:42:48 CEST - 8820: 192.168.222.132(52319)@community>STATEMENT:  
insert into PUBLIC.CT_COM_BOARD_MESSAGE
(
  BOARD_ID
, THREAD_ID
, FATHER_ID
, MESSAGE_ID
, USER_ID
, TITLE
, TEXT
, SIGNATURE
, LOGGED_IP
, USER_LOGIN
, USER_STATUS
, USER_RIGHTS
, USER_CREATED
, LAST_REPLY
)
values
(
  1
, 6579073
, 0
, 6579073
, 39
, 'Test TSearch2 tsvector_update_trigger'
, 'tsvector_update_trigger test test test'
, ''
, '123.123.123.123'
, 'Markus_Wollny'
, 100
, 'yp'
, '2001-03-22 16:54:53.0'
, CURRENT_TIMESTAMP
)

Now I have a custom trigger function:

CREATE or REPLACE FUNCTION "public"."board_message_trigger"()
RETURNS "pg_catalog"."trigger" AS 
$BODY$
begin
  new.idxfti :=
 to_tsvector(coalesce(new.title,'')) || 
 to_tsvector(coalesce(new.text,'')) || 
 to_tsvector(coalesce(new.user_login,''));
  return new;
end
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

And this trigger:
CREATE TRIGGER tsvectorupdate 
   BEFORE INSERT OR UPDATE ON ct_com_board_message 
   FOR EACH ROW EXECUTE PROCEDURE board_message_trigger();

Everything works fine. It's sort of less elegant though than having just the 
one generic trigger function and configuring the needed fields in the trigger 
itself. 

Kind regards

   Markus


Computec Media AG
Sitz der Gesellschaft und Registergericht: Fürth (HRB 8818)
Vorstandsmitglieder: Johannes S. Gözalan (Vorsitzender) und Rainer Rosenbusch
Vorsitzender des Aufsichtsrates: Jürg Marquard 
Umsatzsteuer-Identifikationsnummer: DE 812 575 276



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Albe Laurenz
Andrus wrote:
> Any idea why the following select statement does not return rows ?
> This select statement is generated by npgsql2 beta 3 so I
> cannot change it in my application.
> How to fix without changing select statement ?
> 
> Andrus.
> 
> create temp table test ( tc char(1) );
> insert into test values(' ');
> select * from test where tc=' '::text;

Because the arguments to the operator "=" are of different type,
implicit type conversion takes place.
"character(1)" will by converted to "text", during this conversion
trailing blanks will be ignored, as befits the "character(n)" type.

You can get what you probably want by:

create temp table test ( tc varchar(1) );

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] wrong query result

2008-04-09 Thread Albe Laurenz
josep porres wrote:
> select clau, lecact-lecant as m3, m3any, ta, tc, 3 as mesos, persones, true 
> as clavegueram
> from fac_abonats
> where clau in (select clau from tmp_claus_prova)
> order by clau
> 
> the thing is that the result of the query returns the same 
> number of rows as the table fac_abonats (thousands).

[...]

> At the end I've realized that there is no column named 
> 'clau'. It has another name.
> So the subselect query is wrong, if I execute it alone, an 
> error appears
> 
> ERROR:  no existe la columna «clau»
> LINE 6: select clau from tmp_claus_prova
>^
> ** Error **
> 
> ERROR: no existe la columna «clau»
> Estado SQL:42703
> Caracter: 188
> 
> The question is: 
> Is it a normal behaviour? Because I think that if the query 
> is wrong, wouldn't be better to raise an error?

Yes, this is normal behaviour.
The query is syntactically correct, it just doesn't do what you intended.

It will do the same as:

select clau, lecact-lecant as m3, m3any, ta, tc, 3 as mesos,
   persones, true as clavegueram
from fac_abonats
where 42 in (select 42 from tmp_claus_prova)
order by clau

except probably less efficiently.

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Dave Page
On Wed, Apr 9, 2008 at 12:22 PM, Richard Huxton <[EMAIL PROTECTED]> wrote:
> Peter Geoghegan wrote:
>
> > Richard,
> >
> > I recall that in earlier versions of the PostgreSQL windows binary
> > distribution, I had finer grained control of what modules were
> > installed. The only optional module is now PL/Java, which I don't use,
> > and things like headers and libraries. I cannot specify installing
> > Pl/PgSQL, Pl/Perl etc, or this fabled debugging module for that
> > matter.
> >
>
>  Hmm - I seem to remember there being a fairly long list of optional
> modules. Perhaps your download didn't unpack correctly?

If that list isn't there, then the OP is not using the pgInstaller
distro. The contrib modules are all still there on one page, and one
of them (on the bottom right if memory serves) is the debugger plugin.

Regardless of that, the files should still have been installed, so
checkout the README for details of how to setup the debugger in the
server:

http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/~checkout~/edb-debugger/server/README.pldebugger?rev=1.1

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

Hi Richard,

is it possible to check them individually how ? well..!! I think it has
something to do with settings. couldnt even add a connection because once i
click ok, it show the OLE-DB error, so no question about executing
statements..
In tried with mdb database it works.

Found some more help.
http://support.microsoft.com/?scid=kb%3Ben-us%3B269495&x=9&y=10

Please see a snapshot of settings i could change .. The above help file also
speaks about Connection string (FILENAME). Any idea how this setting is to
be done if necessary for adding a postgresql connection.

Please reply.

Thanks

abhi
http://www.nabble.com/file/p16584555/settings_VB.bmp settings_VB.bmp 

leoabhi wrote:
> 
>  Hello,
> 
>  I wish to connect Visual Studio 2008(VB) to PostgreSQL..
> 
> I used the following help file to do it ..
> http://support.microsoft.com/?scid=kb%3Ben-us%3B316649&x=12&y=14
> 
> Unfortunately, it does not connect..although when you test connection,
> using test connection switch, VB displays test connection successful. The
> error which i get is included in Snapshot .
> 
> The error in English means
> "Multiple-step OLE DB operation generated errors. 
> Check each OLE DB status value, if available. No work was done."
> 
> Please see enclosed snapsots..
>  http://www.nabble.com/file/p16583837/Vb_error1.bmp Vb_error1.bmp 
> 
> any help/suggestion would be great or else any other suggestion/program to
> connect VB to postgreSQL
>  http://www.nabble.com/file/p16583837/VB_Error.bmp VB_Error.bmp 
> 
> Thanks
> Abhi
> 
> 

-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16584555.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Richard Huxton

Peter Geoghegan wrote:

Richard,

I recall that in earlier versions of the PostgreSQL windows binary
distribution, I had finer grained control of what modules were
installed. The only optional module is now PL/Java, which I don't use,
and things like headers and libraries. I cannot specify installing
Pl/PgSQL, Pl/Perl etc, or this fabled debugging module for that
matter.


Hmm - I seem to remember there being a fairly long list of optional 
modules. Perhaps your download didn't unpack correctly?



This isn't the first time I encountered weirdness with the installer.
I recall that when I went to build libpq about 8 months ago, the
installer said it installed headers and libraries, which it simply did
not.


That *is* strange, since presumably on Windows it installs them to a 
sub-folder of the main install. Having said that, I'd say we see more 
reports of problems with installation on Windows than all other 
platforms put together. Partly the poor built-in packaging systems and 
partly the more complex permissions model I suspect.



Having gone through the 8.3.1 MSI installer meticulously, it is
abundantly clear that this module is unavailable. I uninstalled the
last version, 8.3.0, and installed 8.3.1 today. I recall that in the
8.3.0 installer, I could specify that I wanted the module, and I did,
but it didn't work, just as the 8.3.1 installer didn't work as
described in my original e-mail.That being the case, how should I
proceed?


Well, I've just switched into my Windows VM on my laptop here, and I 
appear to be running pgAdmin 1.8.2 and PostgreSQL 8.3.1, Visual C++ 
build 1400. It's got 20-odd pldbg_xxx functions installed in my test 
database and I get the option to debug a plpgsql function if I 
right-click it. So - at least on XP under vmware it works.


The log the installer produced mentions "dbg" and "debug" api .dlls 
being setup along with adminpack.


I've got pgadmin installed and the adminpack.

Otherwise, I don't remember doing anything special. What I would do is:
1. Backup and databases
2. Uninstall PG and pgadmin
3. Download a fresh install and check it's good
4. Install from scratch

Make sure you keep the logfile the installer generates, that way we can 
test what's in there.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


R: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Paolo Saudin
>-Messaggio originale-
>Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Per conto di Peter Geoghegan
>Inviato: mercoledì 9 aprile 2008 12.50
>A: Richard Huxton
>Cc: pgsql-general@postgresql.org
>Oggetto: Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib
module
>
>Richard,
>
>I recall that in earlier versions of the PostgreSQL windows binary
>distribution, I had finer grained control of what modules were
>installed. The only optional module is now PL/Java, which I don't use,
>and things like headers and libraries. I cannot specify installing
>Pl/PgSQL, Pl/Perl etc, or this fabled debugging module for that
>matter.
>
>This isn't the first time I encountered weirdness with the installer.
>I recall that when I went to build libpq about 8 months ago, the
>installer said it installed headers and libraries, which it simply did
>not.
>
>Having gone through the 8.3.1 MSI installer meticulously, it is
>abundantly clear that this module is unavailable. I uninstalled the
>last version, 8.3.0, and installed 8.3.1 today. I recall that in the
>8.3.0 installer, I could specify that I wanted the module, and I did,
>but it didn't work, just as the 8.3.1 installer didn't work as
>described in my original e-mail.That being the case, how should I
>proceed?
>
>Thanks,
>Peter Geoghegan
>
>-- 
>Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-general

I just installed Postgresql 8.3.1 on a fresh machine and in the step 'Enable
contrib modules', you can select plDebugger option to enable the debugger.

Paolo Saudin


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem after VACUUM ANALYZE

2008-04-09 Thread Gregory Stark
<[EMAIL PROTECTED]> writes:

> Could it be that something like this is happening:
> - In the early morning a new DB connection is opened.
> - While running VACUUM ANALYZE the planner uses different plans because some 
> index could not be used or the statistics are right in that moment not 
> present because they are updated... So the query gets a wrong plan. It uses a 
> seqScan instead of an index scan.

This isn't supposed to happen. The old statistics are still visible until the
new ones are visible. Nothing is locked or unavailable while analyze is running.

However one of the things that can happen is the statistics for one table get
updated and until the statistics for another table are updated the planner has
skewed results. It has the new statistics for the first table but old
statistics for the second table.

Normally the solution to this is to run analyze more frequently so things
don't change too drastically from one set of statistics to another. In some
situations this isn't good enough, for example if you're truncating a bunch of
tables together.

You can also run analyze (but not vacuum analyze) inside a transaction so all
the stats go into effect together when you commit. This does have downsides
however. I think it will block a vacuum analyze which tries to update the same
statistics, for example.

Another thing to be aware of is that *empty* tables cause Postgres to default
to a heuristic of assuming 1,000 records. That can cause strange things to
happen if you truncate just some tables and run analyze on them.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL 
training!

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Peter Geoghegan
Richard,

I recall that in earlier versions of the PostgreSQL windows binary
distribution, I had finer grained control of what modules were
installed. The only optional module is now PL/Java, which I don't use,
and things like headers and libraries. I cannot specify installing
Pl/PgSQL, Pl/Perl etc, or this fabled debugging module for that
matter.

This isn't the first time I encountered weirdness with the installer.
I recall that when I went to build libpq about 8 months ago, the
installer said it installed headers and libraries, which it simply did
not.

Having gone through the 8.3.1 MSI installer meticulously, it is
abundantly clear that this module is unavailable. I uninstalled the
last version, 8.3.0, and installed 8.3.1 today. I recall that in the
8.3.0 installer, I could specify that I wanted the module, and I did,
but it didn't work, just as the 8.3.1 installer didn't work as
described in my original e-mail.That being the case, how should I
proceed?

Thanks,
Peter Geoghegan

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Richard Huxton

Peter Geoghegan wrote:

Hello,

I'm developing a large postgreSQL database front end application on
win32. I'd consider the ability to debug Pl/PgSQL functions highly
desirable. Until now, I've been using RAISE NOTICE debugging, which is
equivalent to printf debugging, and is sub optimal.


"Sub optimal" is the polite way of saying it :-)


It is installed as a contrib module with the Windows distribution of
PostgreSQL 8.3 and above". When I recently installed postgreSQL 8.3.1
from the win32 MSI binary distribution, there was no reference to this
contrib module. There was also no reference to it in the bundled
"stack builder" application. What did I miss?


It should be one of the optional items to install (like pl/perl or 
crypto etc) - there's a screen of tickboxes at some point during the 
install.


I'd re-run the installer and see if it lets you add the module. Oh, turn 
paranoid mode on first of course and backup your databases.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Richard Huxton

leoabhi wrote:

The error in English means
"Multiple-step OLE DB operation generated errors. 
Check each OLE DB status value, if available. No work was done."


Well, did you "check each OLE DB status value"? Which failed and what 
was it doing? Are there any errors logged at the server? Did you turn 
statement logging on at the server and see what statements were being 
executed?


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

 Hello,

 I wish to connect Visual Studio 2008(VB) to PostgreSQL..

I used the following help file to do it ..
http://support.microsoft.com/?scid=kb%3Ben-us%3B316649&x=12&y=14

Unfortunately, it does not connect..although when you test connection, using
test connection switch, VB displays test connection successful. The error
which i get is included in Snapshot .

The error in English means
"Multiple-step OLE DB operation generated errors. 
Check each OLE DB status value, if available. No work was done."

Please see enclosed snapsots..
http://www.nabble.com/file/p16583837/Vb_error1.bmp Vb_error1.bmp 

any help/suggestion would be great or else any other suggestion/program to
connect VB to postgreSQL
http://www.nabble.com/file/p16583837/VB_Error.bmp VB_Error.bmp 

Thanks
Abhi

-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16583837.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Debugging Pl/PgSQL functions with the debug contrib module

2008-04-09 Thread Peter Geoghegan
Hello,

I'm developing a large postgreSQL database front end application on
win32. I'd consider the ability to debug Pl/PgSQL functions highly
desirable. Until now, I've been using RAISE NOTICE debugging, which is
equivalent to printf debugging, and is sub optimal.

I am aware of the possibility of debugging Pl/PgSQL functions through
edb-debugger. I am unable to get this to work.

According to the PgAdmin III 1.8.2 documentation, "In order to use the
debugger, a plugin is required on your server. This is included by
default with EnterpriseDB, and is available for download on pgFoundry.
It is installed as a contrib module with the Windows distribution of
PostgreSQL 8.3 and above". When I recently installed postgreSQL 8.3.1
from the win32 MSI binary distribution, there was no reference to this
contrib module. There was also no reference to it in the bundled
"stack builder" application. What did I miss?

It is not apparent to me how I can test for the absence or presence of
this module within PgAdmin III. In the tools menu, there is a
"debugging" tab, but it is disabled in all of the contexts that I've
tried so far. I downloaded Lightning debugger, a tool that expressly
debugs Pl/PgSQL. When I attempt to connect to my database, a message
box appears:
---
WARNING
---
Debugger not supported:

Database missing debugger API functions
---
OK
---


The only available on PgFoundry is a source distribution:
http://pgfoundry.org/frs/?group_id=1000175 . Building this would
necessitate setting up a mingw build environment, which would be a lot
of effort.

What is the simplest, most direct way of enabling debugging of
Pl/PgSQL under these circumstances?

Thanks,

Peter Geoghegan

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Richard Huxton

Andrus Moor wrote:

Richard,

It doesn't return rows because you're using a space-padded type (char) 
to try and store a space.


I think you probably want varchar(1) instead.


thank you.
I have production database whose schema cannot changed easily.


ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It 
will require a lock on the table though.


I is more reasonable to force npgsql driver to generate other code if no 
other solution.

npgsql driver wants to add explicit casts to parameters.
Is it reasonable to force driver to generate code

select * from test where tc=' '::char(1);

for char parameter type ?


I'd say so - I presume it just needs to be taught about different types 
of text. Presumably it already knows that int8 is different from int4, 
so it'll be doing something similar already. Check if there is a 
mailing-list for the npgsql project and ask there - someone might 
already be working on it.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] SQL fast in PSQL, very slow using MS.NET driver

2008-04-09 Thread Ashish Sharma
Hi,

The setup in question includes PostGRESQL v8.2.4, Java based web servers and
MS.NET based web servers. Following is the fuzzy situation:

1.   Our SQL queries run very fast using PSQL (both, from the server as
well as the client).

2.   The Java app also retrieves the results very fast (of course, we
are using Postgres JDBC driver).

3.   But, the same SQL queries perform pathetically slow when called
from .NET application. The driver being used is NPGSQL.

 

I have tried  making some alterations to TCP related system variables like
TCP_NoDelay and TCPAckFrequency on Windows, but to no profit. Same setup is
already running on Oracle backend, and, there is no difference in SQL
response timings from either application.

 

Please advice, as this has become a major hurdle for us to push PostGRESQL
to be productionized, in place of currently running Oracle DB.

 

Regards,

 

Ashish Sharma

Core Database Systems

HYPERLINK "http://www.coredbsystems.com"http://www.coredbsystems.com 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.5/1356 - Release Date: 4/2/2008
4:14 PM
 


Re: [GENERAL] Trouble with foreign key

2008-04-09 Thread ludwig
Hi, what's the result of  SELECT * from tmp_stamp where _stamp = '2f980de9f2297c7902f3415f6537c6be';?Perhaps different fieldtypes (f. e. VARCHAR in table www_es_orderhead_cs versus CHAR(n) in Table _stamp filled up with blanks)? Ludwig  Hi,there is a problem with foreign key (PG 8.3RC2). Please, look at below. I don't understand this behavior. Why this INSERT is ending with this error message. In my opinion, the key is obviously present. Thank you.--Otakarek# INSERT INTO www_es_orderhead_cs(_status,_tmp_ip,_tmp_stamp) VALUES('n','xx.121.111.31','2f980de9f2297c7902f3415f6537c6be');ERROR:  insert or update on table "www_es_orderhead_cs" violates foreign key constraint "www_es_orderhead_cs__tmp_stamp_fkey"DETAIL:  Key (_tmp_stamp)=(2f980de9f2297c7902f3415f6537c6be) is not present in table "tmp_stamp".# SELECT * from tmp_stamp;   _ip|  _stamp  |   _expired| _var--+--+---+-- xx.121.111.31/32 | 2f980de9f2297c7902f3415f6537c6be | 2008-04-08 17:49:33.193914+02 |(1 row)-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Trouble with foreign key

2008-04-09 Thread Kevin Hunter
At 11:12p -0400 on Tue, 08 Apr 2008), Otakarek wrote:
> there is a problem with foreign key (PG 8.3RC2). Please, look at
  ^^

Before you go any further, I'd highly suggest updating.  8.3 was
released over 2 months ago, and has already progressed to 8.3.1.

Upgrade, check the release notes, then see what's up.

Kevin

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] select statement fails

2008-04-09 Thread Richard Huxton

Andrus wrote:

Any idea why the following select statement does not return rows ?
This select statement is generated by npgsql2 beta 3 so I cannot change it 
in my application.

How to fix without changing select statement ?

Andrus.

create temp table test ( tc char(1) );
insert into test values(' ');
select * from test where tc=' '::text;


It doesn't return rows because you're using a space-padded type (char) 
to try and store a space.


I think you probably want varchar(1) instead.

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] wrong query result

2008-04-09 Thread Martijn van Oosterhout
On Wed, Apr 09, 2008 at 10:20:18AM +0200, josep porres wrote:
> At the end I've realized that there is no column named 'clau'. It has
> another name.
> So the subselect query is wrong, if I execute it alone, an error appears



> The question is:
> Is it a normal behaviour? Because I think that if the query is wrong,
> wouldn't be better to raise an error?

Google for "correlated subquery". Short answer: It's supposed to work
that way.

Have a nce day,
-- 
Martijn van Oosterhout   <[EMAIL PROTECTED]>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.


signature.asc
Description: Digital signature


Re: [GENERAL] plperlu and perl 5.10

2008-04-09 Thread Kev
On Apr 8, 11:08 am, [EMAIL PROTECTED] (Alvaro Herrera) wrote:
> Kev escribió:
>
> > > Recompile PG?  Even if I'm running 8.3.1, released well after that?
>
> > Oh, sorry, do you mean, it's ready for 5.10 but still compiled with
> > 5.8 for now?  If so, is there a timeline for compiling with 5.10 by
> > default in the production releases of pgsql?
>
> You should request that to your package provider.

Would that be Dave Page?  (I went to the win32 binary readme, was that
the right place to find out?)

Thanks,
Kev

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Trouble with foreign key

2008-04-09 Thread otakarek
Hi,

there is a problem with foreign key (PG 8.3RC2). Please, look at below. I don't 
understand this behavior. Why this INSERT is ending with this error message. In 
my opinion, the key is obviously present. Thank you.
--
Otakarek

# INSERT INTO www_es_orderhead_cs(_status,_tmp_ip,_tmp_stamp) 
VALUES('n','xx.121.111.31','2f980de9f2297c7902f3415f6537c6be');

ERROR:  insert or update on table "www_es_orderhead_cs" violates foreign key 
constraint "www_es_orderhead_cs__tmp_stamp_fkey"
DETAIL:  Key (_tmp_stamp)=(2f980de9f2297c7902f3415f6537c6be) is not present in 
table "tmp_stamp".

# SELECT * from tmp_stamp;
   _ip|  _stamp  |   _expired   
 | _var
--+--+---+--
 xx.121.111.31/32 | 2f980de9f2297c7902f3415f6537c6be | 2008-04-08 
17:49:33.193914+02 |
(1 row)

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] more SSL crash woes....

2008-04-09 Thread Jeff Amiel
"PostgreSQL 8.2.4 on i386-pc-solaris2.10, compiled by GCC gcc (GCC) 3.4.3
(csl-sol210-3_4-branch+sol_rpath)"

As the proud author of this previous post:
http://archives.postgresql.org/pgsql-general/2007-08/msg01911.php

I never found a real answer except to disable SSL on the connections between my 
master and
subscriber nodes.

Things have been peachy ever since.

Todayfirst db crash in quite some time...seemingly unrelated to slony

Stack trace looks eerily familiar:

Core was generated by `/usr/local/pgsql/bin/postgres -D /db'.
Program terminated with signal 11, Segmentation fault.
#0  0xfee8ec23 in sk_value () from /usr/local/ssl/lib/libcrypto.so.0.9.8

*grumble*

I have located nothing unusual occurring at the time of the event
We have developers that connect from win32 and Fedora boxes via PGAdminIII and 
they use SSL
connections...but they have ALWAYS connected using SSL.

Any suggestions?  I really need to try to either provide an explanation or make 
SOME change to
prevent

upgrade openssl? (we are on 9.8e)
remove ALL encrypted connection capabilities (via pg_hba.conf)?
punt?

I'm dubious that that stack trace simply 'starts' in the middle of the 
libcrypto stuff.
shouldn't I see some postgresql functions in there somewhere?
(postgres compiled with --enable-debug)

Any help would be appreciated.











  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] plperlu and perl 5.10

2008-04-09 Thread Kev
On Apr 8, 11:48 am, [EMAIL PROTECTED] (Richard Huxton) wrote:
> Kev wrote:
> >> Recompile PG?  Even if I'm running 8.3.1, released well after that?
>
> > Oh, sorry, do you mean, it's ready for 5.10 but still compiled with
> > 5.8 for now?  If so, is there a timeline for compiling with 5.10 by
> > default in the production releases of pgsql?
>
> Like Alvaro says, that will be down to the package provider.
>
> I'm prepared to bet good money though that it will co-incide with
> whenever they ship Perl 5.10 with your system.
>
> Think about it - how happy would you have been with a plperl that
> *didn't* work with your default version of Perl? :-)

The day Microsoft starts shipping Perl with Windows...hmm...  ;)

Sorry, I probably should've mentioned the platform I have to use,
somewhere.

Kev

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] How does psql actually implement the \d commands

2008-04-09 Thread Andrew Falanga
Hi,

I know about the -E option to psql and did that to get the following,
which is what psql does for a \d :

* QUERY **
SELECT c.oid,
  n.nspname,
  c.relname
FROM pg_catalog.pg_class c
 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE pg_catalog.pg_table_is_visible(c.oid)
  AND c.relname ~ '^(personaldata)$'
ORDER BY 2, 3;
**

* QUERY **
SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules
FROM pg_catalog.pg_class WHERE oid = '17408'
**

* QUERY **
SELECT a.attname,
  pg_catalog.format_type(a.atttypid, a.atttypmod),
  (SELECT substring(d.adsrc for 128) FROM pg_catalog.pg_attrdef d
   WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND
a.atthasdef),
  a.attnotnull, a.attnum
FROM pg_catalog.pg_attribute a
WHERE a.attrelid = '17408' AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
**

* QUERY **
SELECT c.relname FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i
WHERE c.oid=i.inhparent AND i.inhrelid = '17408' ORDER BY inhseqno ASC
**

Now, I tried to execute these queries one at a time and they failed,
somewhat miserably.  In what order does PostgreSQL actually execute
them?  Are they implemented as sub-queries?  If so, in what order are
they executed?

Andy

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] select statement fails

2008-04-09 Thread Andrus
Any idea why the following select statement does not return rows ?
This select statement is generated by npgsql2 beta 3 so I cannot change it 
in my application.
How to fix without changing select statement ?

Andrus.

create temp table test ( tc char(1) );
insert into test values(' ');
select * from test where tc=' '::text;


Using

"PostgreSQL 8.3beta4, compiled by Visual C++ build 1400" 



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] wrong query result

2008-04-09 Thread Richard Huxton

josep porres wrote:

select clau, lecact-lecant as m3, m3any, ta, tc, 3 as mesos, persones, true
as clavegueram
from fac_abonats
where clau in (select clau from tmp_claus_prova)
order by clau



At the end I've realized that there is no column named 'clau'. It has
another name.



The question is:
Is it a normal behaviour? Because I think that if the query is wrong,
wouldn't be better to raise an error?


It's not an error, you need to be able to refer to columns in the outer 
query so you can do:

...(SELECT x FROM tmp_claus_prova WHERE y = clau)

It *is* confusing where you have a typo though. It gets everyone from 
time to time.


--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem after VACUUM ANALYZE

2008-04-09 Thread mljv
Am Mittwoch, 9. April 2008 10:11 schrieb David Wilson:
> On Wed, Apr 9, 2008 at 3:29 AM,  <[EMAIL PROTECTED]> wrote:
> >  But if i do "VACUUM ANALYZE" without concurrent queries, everything runs
> > fine afterwards.
> >
> >  If i run  "VACUUM ANALYZE" with few concurrent queries, it slows down to
> > a crawl.
> >
> >  Could it be that something like this is happening:
> >  - In the early morning a new DB connection is opened.
> >  - While running VACUUM ANALYZE the planner uses different plans because
> > some index could not be used or the statistics are right in that moment
> > not present because they are updated... So the query gets a wrong plan.
> > It uses a seqScan instead of an index scan.
> >  - This wrongly planned statement is prepared so even after VACUUM
> > ANALYZE is done, the statement does not use the wrong plan.
> >  - load raises triggers many concurrent queries with wrong plans. so
> > everything slows down.
>
> I've run into a very similar problem. I have some long-running
> processes that generate a large amount of data and then query that
> data that must periodically drop their connections and rebuild to
> ensure that query plans get re-planned according to updated
> statistics. This is especially true when a new DB is first being
> brought up with an initial set of data (~1 week of compute time, ~30gb
> of data and ~120m rows) with processes that live through the entire
> process.

This is not the case at my place. We are not producing lots of data. Just few 
data with small INSERTs all the time. I don't think that the statistic are 
really changing quite often as the tables are rather fixed and just some data 
is added.

> My solution, as mentioned above, is to rebuild the connection approx
> every hour on my long-running processes. This is a tricky question,
> because you want the benefit of not re-planning queries in 99.9% of
> the cases- I'm not really opposed to the current system that requires
> the reconnections, given that the overhead involved in them is
> completely negligible in the grand scheme of things. There are
> downsides to not replanning queries, and if you can't live with them
> then you should either force re-planning at intervals or avoid
> prepared statements.

In release 8.3:
http://www.postgresql.org/docs/8.3/interactive/release-8-3.html
"Automatically re-plan cached queries when table definitions change or 
statistics are updated"

So no reconnection is necessary in 8.3 to replan prepared statements. Maybe it 
helps you.

kind regards,
janning


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] wrong query result

2008-04-09 Thread josep porres
Hi


I just want to let you know one thing.
By the way, I'm running Postgres 8.3.1 on windows

I was making a query using pgadmin:

select clau, lecact-lecant as m3, m3any, ta, tc, 3 as mesos, persones, true
as clavegueram
from fac_abonats
where clau in (select clau from tmp_claus_prova)
order by clau

clau is the primary key of the table fac_abonats

the thing is that the result of the query returns the same number of rows as
the table fac_abonats (thousands).
select clau from tmp_claus_prova return about one hundred rows, and all the
values in the column exists
in fac_abonats.   So maybe something wrong is happening in the where clause.

At the end I've realized that there is no column named 'clau'. It has
another name.
So the subselect query is wrong, if I execute it alone, an error appears

ERROR:  no existe la columna «clau»
LINE 6: select clau from tmp_claus_prova
   ^

** Error **

ERROR: no existe la columna «clau»
Estado SQL:42703
Caracter: 188



The question is:
Is it a normal behaviour? Because I think that if the query is wrong,
wouldn't be better to raise an error?



Regards,


Josep Porres


Re: [GENERAL] Problem after VACUUM ANALYZE

2008-04-09 Thread Pavan Deolasee
On Wed, Apr 9, 2008 at 1:41 PM, David Wilson <[EMAIL PROTECTED]> wrote:

>
>
>  I've run into a very similar problem. I have some long-running
>  processes that generate a large amount of data and then query that
>  data that must periodically drop their connections and rebuild to
>  ensure that query plans get re-planned according to updated
>  statistics. This is especially true when a new DB is first being
>  brought up with an initial set of data (~1 week of compute time, ~30gb
>  of data and ~120m rows) with processes that live through the entire
>  process.
>

I believe plan-invalidation in 8.3 should address this. Isn't it ?

Thanks,
Pavan

-- 
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem after VACUUM ANALYZE

2008-04-09 Thread David Wilson
On Wed, Apr 9, 2008 at 3:29 AM,  <[EMAIL PROTECTED]> wrote:

>  But if i do "VACUUM ANALYZE" without concurrent queries, everything runs fine
>  afterwards.
>
>  If i run  "VACUUM ANALYZE" with few concurrent queries, it slows down to a
>  crawl.
>
>  Could it be that something like this is happening:
>  - In the early morning a new DB connection is opened.
>  - While running VACUUM ANALYZE the planner uses different plans because some
>  index could not be used or the statistics are right in that moment not
>  present because they are updated... So the query gets a wrong plan. It uses a
>  seqScan instead of an index scan.
>  - This wrongly planned statement is prepared so even after VACUUM ANALYZE is
>  done, the statement does not use the wrong plan.
>  - load raises triggers many concurrent queries with wrong plans. so 
> everything
>  slows down.
>

I've run into a very similar problem. I have some long-running
processes that generate a large amount of data and then query that
data that must periodically drop their connections and rebuild to
ensure that query plans get re-planned according to updated
statistics. This is especially true when a new DB is first being
brought up with an initial set of data (~1 week of compute time, ~30gb
of data and ~120m rows) with processes that live through the entire
process.

My solution, as mentioned above, is to rebuild the connection approx
every hour on my long-running processes. This is a tricky question,
because you want the benefit of not re-planning queries in 99.9% of
the cases- I'm not really opposed to the current system that requires
the reconnections, given that the overhead involved in them is
completely negligible in the grand scheme of things. There are
downsides to not replanning queries, and if you can't live with them
then you should either force re-planning at intervals or avoid
prepared statements.

-- 
- David T. Wilson
Princeton Satellite Systems
[EMAIL PROTECTED]

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Problem after VACUUM ANALYZE

2008-04-09 Thread mljv
Am Dienstag, 8. April 2008 18:38 schrieb Scott Marlowe:
> It sounds to me like two possible problems, maybe combined.
>
> One possibility is that you have a data distribution that results in
> statistics being gathered that don't really represent your data.  Try
> increasing the stats target for that column (or the whole db if you'd
> rather) and re-running analyze.
>
> The other possibility is that you've got some index bloat happening
> and you might benefit from  reindexing the problematic table.

But if i do "VACUUM ANALYZE" without concurrent queries, everything runs fine 
afterwards.

If i run  "VACUUM ANALYZE" with few concurrent queries, it slows down to a 
crawl.

Could it be that something like this is happening:
- In the early morning a new DB connection is opened.
- While running VACUUM ANALYZE the planner uses different plans because some 
index could not be used or the statistics are right in that moment not 
present because they are updated... So the query gets a wrong plan. It uses a 
seqScan instead of an index scan.
- This wrongly planned statement is prepared so even after VACUUM ANALYZE is 
done, the statement does not use the wrong plan. 
- load raises triggers many concurrent queries with wrong plans. so everything 
slows down.

kind regards,
janning


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general