[GENERAL] handling out parameter

2010-06-04 Thread Ravi Katkar
Hi ,

I have below function adf with inout, out parameter ,

CREATE OR REPLACE FUNCTION adf(inout voutvar integer , out vVar integer)
 AS
$BODY$
BEGIN
  voutvar := 20;
  vvar := 10;
RETURN;
END; $BODY$
  LANGUAGE 'plpgsql'

After compiling I get below signature of function

adf(integer)

and return type as record.

CREATE OR REPLACE FUNCTION adf(INOUT voutvar integer, OUT vvar integer)
  RETURNS record AS

I wanted to catch output parameter - Vvar .

Below function tt , tries adf,

CREATE OR REPLACE FUNCTION tt()
  RETURNS VOID AS
$BODY$
DECLARE
 ii  integer;
 vout integer;
BEGIN
  --vvar := 10;
  vout := 10;
  perform adf(vout)  ;
RETURN;
END; $BODY$
  LANGUAGE 'plpgsql';


I have a couple of questions on above function

1) Why the return type is record after compiling?
2) How to catch the return value of out parameter for above case value of  vVar.


Thanks,
Ravi Katkar



Re: [GENERAL] so, does this overlap or not...? - fencepost question on overlaps()

2010-06-04 Thread Frank van Vugt
Hi Tom,

> The rationale is "do what the SQL spec says" ;-)

can't argue with the standard ;)

> I seem to recall a previous discussion in the PG lists

Good memory !

Adding 'sql standard' to the search options helped, this issue seems to elude 
people every now and then, given (amongst others):

http://archives.postgresql.org/pgsql-hackers/2005-05/msg01457.php

http://archives.postgresql.org/pgsql-general/2006-11/msg00763.php

http://archives.postgresql.org/pgsql-general/2006-11/msg00527.php


One might consider adding a single line to the end of 9.9 of the docs that 
warns for this behaviour and/or add the specific example?




Thanks for your help.


-- 
Best,




Frank.

-- 
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] handling out parameter

2010-06-04 Thread Pavel Stehule
Hello

2010/6/4 Ravi Katkar :
> Hi ,
>
>
>
> I have below function adf with inout, out parameter ,
>
>
>
> CREATE OR REPLACE FUNCTION adf(inout voutvar integer , out vVar integer)
>
>  AS
>
> $BODY$
>
> BEGIN
>
>   voutvar := 20;
>
>   vvar := 10;
>
> RETURN;
>
> END; $BODY$
>
>   LANGUAGE 'plpgsql'
>
>
>
> After compiling I get below signature of function
>

PostgreSQL doesn't compile PLpgSQL code - just validate syntax and
store source code and interface description to pg_proc table.

When function returns only one parameter, it returns some scalar data
type. The syntax isn't important. In other cases function has to
return record. One OUT param and one INOUT params are two OUT params
-> function has to return record.

Second important rule - PostgreSQL can not pass values by ref. Just
only by val. So if you want get some result, you cannot use PERFORM
statement.

CREATE OR REPLACE FUNCTION foo(IN a int, OUT b int)
AS $$
BEGIN
  b := a + 10;
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;

...
DECLARE result int;
BEGIN
  result := foo(10);
END;

...

CREATE OR REPLACE FUNCTION foo2(OUT a int, OUT b int, c int) AS $$
BEGIN
  a := c + 1;
  b := c + 2;
END
$$ LANGUAGE plpgsql;

DECLARE result RECORD;
BEGIN
  result := foo2(20);
  RAISE NOTICE 'result is % %', result.a, result.b;
END;

Regards

Pavel Stehule

>
>
> adf(integer)
>
>
>
> and return type as record.
>
>
>
> CREATE OR REPLACE FUNCTION adf(INOUT voutvar integer, OUT vvar integer)
>
>   RETURNS record AS
>
>
>
> I wanted to catch output parameter – Vvar .
>
>
>
> Below function tt , tries adf,
>
>
>
> CREATE OR REPLACE FUNCTION tt()
>
>   RETURNS VOID AS
>
> $BODY$
>
> DECLARE
>
>  ii  integer;
>
>  vout integer;
>
> BEGIN
>
>   --vvar := 10;
>
>   vout := 10;
>
>   perform adf(vout)  ;
>
> RETURN;
>
> END; $BODY$
>
>   LANGUAGE 'plpgsql';
>
>
>
>
>
> I have a couple of questions on above function
>
>
>
> 1) Why the return type is record after compiling?
>
> 2) How to catch the return value of out parameter for above case value of
>  vVar.
>
>
>
>
>
> Thanks,
>
> Ravi Katkar
>
>

-- 
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] create index concurrently - duplicate index to reduce time without an index

2010-06-04 Thread Alban Hertroys
> Thanks Greg, Alban and others,
> 
> This has cleared up a misunderstanding I had about why one should reindex.  
> Re-reading the documentation 
> http://www.postgresql.org/docs/8.4/interactive/sql-reindex.html it is clear 
> now that reindex or recreating and index should not normally be needed - 
> certainly not to keep an index up-to-date.  I would have guessed that VACUUM 
> or VACUUM ANALYSE on the table that the index is associated would have been 
> sufficient to reclaim space for a 'bloated' index (maybe only VACUUM FULL 
> would help).  In any case we can leave reindexing or full vacuum for outages 
> where we are interrupting service anyway.

VACUUM FULL actually causes bloat to indexes. It rearranges the data in the 
tables so that any gaps get used, but while doing that it also needs to update 
the indices related to those tables.

Normal VACUUM and VACUUM ANALYSE don't have this problem though, they just mark 
table space that's no longer in use (transaction that deleted rows has 
committed them) as reusable, so that later INSERTs can put their data in there. 
This is a bit of a simplification of what's really going on - for the details 
check the documentation.

Autovacuum does VACUUM ANALYSE in the background, using multiple threads in 
recent versions. You can (and seeing your use of the database you probably 
should) tune how often it vacuums tables through several configuration 
parameters.

Of course, running ANALYSE when you _know_ data in a table has changed 
significantly means you don't have to wait for autovac to get around to 
analysing that table.

> I was heartened by the responses and tried further testing (if it could not 
> hurt, why not try and see if it could be faster), but ran into a problem.  A 
> few times when I was trying to drop an index (before or after creating a 
> duplicate index with 'concurrently'), the dropping of the index stalled.  It 
> seems that this was because of existing connection:
> postgres: rods ICAT 130.102.163.141(58061) idle in transaction
> And new clients block.
> 
> Is that expected? Should we look for 'bugs' in out client that seems to be 
> holding a connection?

I'm not exactly sure why that is (I can't look into your database), but my 
guess is that the index is locked by a transaction. Apparently the transaction 
you refer to has uncommitted work that depends on the index at some point.

Keeping transactions open for a long time is usually a bad idea.

You saw that you can't drop an index in use by a transaction for example, but 
autovacuum is running into similar issues - it can't reclaim space until the 
transaction finishes as the transaction locks things that autovacuum will want 
to touch.
That probably means (I'm not sure it works that way, but it seems likely) that 
that autovacuum thread gets stuck at a lock and can't continue until the 
transaction holding the lock frees it.


> For the application we have, I'm ready to give up on this train of 
> investigation for optimization and just vacuum analyse key tables regularly 
> and vaccuum and maybe reindex more completely during outages - though we aim 
> for outages to be infrequent.  The database holds data representing a virtual 
> filesystem structure with millions of file (and associated access controls, 
> and information on underlying storage resources and replication).  There is 
> probably not much update or delete of the main data - at least compared with 
> the total holdings and the new data/files which are regularly being added to 
> the system.

In practice VACUUM FULL and REINDEX are used to reclaim disk space. That of 
itself doesn't look much like it'd improve performance, but using less disk 
space also means that data gets more tightly packed in your disk cache, for 
example. REINDEX can mean an index that didn't fit into RAM now does. They're 
both rather intrusive operations though, so it's a matter of balancing the 
costs and benefits. Many databases don't need to bother with VACUUM FULL or 
REINDEX.

> Ps. Greg, I don't understand the issue with 'concurrently rebuild (of) an 
> index that enforces a constraint or unique index'.  I don't think I care much 
> right at the moment, but I'm generally interested and others might be too.. 
> Would you expect the create index to fail or to cause locking or just 
> transient performance degradation?


I think what Greg was getting at is that there's a dependency tree between 
indexes and constraints: A primary key is implemented using a unique index. You 
can create a new (unique) index on the same columns concurrently, but you can't 
replace the primary key index with it as you're not allowed to drop the index 
without dropping the PK constraint. If you have any FK constraints pointing to 
that table, you can't drop the PK constraint without also dropping the FK 
constraints.

Quite a bit of trouble to go through to replace one index.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and 

[GENERAL] please help me. I can't pg_dumg DB

2010-06-04 Thread peeratat tungsungnern

 

My HDD has bad sector and i can change new HDD. I have a ploblem can't back up 
database and display massage is:

 

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  cache lookup failed for function 
137832813
pg_dump: The command was: SELECT tableoid, oid, adnum, 
pg_catalog.pg_get_expr(adbin, adrelid) AS adsrc FROM pg_catalog.pg_attrdef 
WHERE adrelid = '146944117'::pg_catalog.oid

 

please help me  and Thank you before.

  

  Mr.Peeeratat 
Tungsungnern
  
_
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969

Re: [GENERAL] please help me. I can't pg_dumg DB

2010-06-04 Thread Bill Moran
In response to peeratat tungsungnern :
> 
> My HDD has bad sector and i can change new HDD. I have a ploblem can't back 
> up database and display massage is:
> 
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  cache lookup failed for function 
> 137832813
> pg_dump: The command was: SELECT tableoid, oid, adnum, 
> pg_catalog.pg_get_expr(adbin, adrelid) AS adsrc FROM pg_catalog.pg_attrdef 
> WHERE adrelid = '146944117'::pg_catalog.oid

When asking for help, it's generally worthwhile to provide _at_least_ the
version of PostgreSQL that you're using.

However, on a guess, I'm guessing it's a slightly older version that has
that limitation where cached names don't get cleared when the objects are
deleted.  Try restarting PostgreSQL and see if that fixes the problem.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

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


[GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Eliot Gable
In order to avoid using a 'FOR ... LOOP array_append(); END LOOP;' method of
building an array (which is not at all efficient), I rewrote some of my code
to do things more effectively. One of the steps involves building two arrays
that are input to another stored procedure, but I am getting an error with
this step. Specifically, I have something like this:

create type complex1 as ( ... ); -- one integer member and about 16 text
members
create type complex2 as ( ... ); -- few integer members, about 10 text
members, and about 6 different enum members

CREATE OR REPLACE blah ...
...
DECLARE
  myvariable complex1[];
  mydatasource complex1;
  myrowsource complex2[];
...
BEGIN
...
  -- The first way I tried to do it:
  myvariable := array(
SELECT mydatasource FROM unnest(myrowsource)
  );
  -- The second way I tried to do it:
  myvariable := array(
SELECT (mydatasource)::complex1 FROM unnest(myrowsource)
  );
  -- The third way I tried to do it:
  myvariable := array(
SELECT (mydatasource.member1, mydatasource.member2, ...)::complex1 FROM
unnest(myrowsource)
  );
...
END ...

Each of these gives the same error message:

CONTEXT: ERROR
CODE: 42804
MESSAGE: cannot assign non-composite value to a row variable

This is pl/pgsql in 8.4.1. Does anybody have any insight on how I can get
around this issue? I'm not sure exactly what circumstances are involved in
this SELECT that is causing this error. I don't understand what is being
considered the row variable or what is being considered the non-composite
value. I get the error when the 'myrowsource' variable has no rows, as well
as when it has 2 rows.

Basically, all I want is to have myvariable be an array that has one 'row'
for each row in 'unnest(myrowsource)' with the value of each row being equal
to the 'mydatasource' contents. Maybe there is a better way to achieve that
which someone can point out?

Thanks for any assistance anyone can provide.

-- 
Eliot Gable

"We do not inherit the Earth from our ancestors: we borrow it from our
children." ~David Brower

"I decided the words were too conservative for me. We're not borrowing from
our children, we're stealing from them--and it's not even considered to be a
crime." ~David Brower

"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not
live to eat.) ~Marcus Tullius Cicero


Re: [GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Alban Hertroys
On 4 Jun 2010, at 15:37, Eliot Gable wrote:

> CREATE OR REPLACE blah ...
> ...
> DECLARE
>   myvariable complex1[];
>   mydatasource complex1;
>   myrowsource complex2[];
> ...
> BEGIN
> ...
>   -- The first way I tried to do it:
>   myvariable := array(
> SELECT mydatasource FROM unnest(myrowsource)
>   );

I don't see what you're trying to do here; apparently myrowsource has a column 
named mydatasource, but how is PG supposed to know which mydatasource you mean 
- the declared one or the one from mydatasource? The same goes for myrowsource.
I'm pretty sure you have a naming conflict.

Or did you intend to write:
myvariable := array(unnest(myrowsource));

That probably still doesn't work. I have no installation of 8.4 at my disposal 
atm, so I can't verify, but IIRC unnest doesn't return an array, but something 
else. You probably need to cast it to the right type first.

> Each of these gives the same error message:
> 
> CONTEXT: ERROR
> CODE: 42804
> MESSAGE: cannot assign non-composite value to a row variable

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4c0908b610152006515388!



-- 
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 can I run an external program from a stored procedure?

2010-06-04 Thread Rob Richardson
Greetings!
 
I'm running PostgreSQL 8.4 on MS Windows Server 2003.
 
Assume I have a program named FlashLightAndSoundHorn.exe.  In my
database, there is a table that is read by some other program.  Records
in that table have a timestamp, so I can tell how long they've been
waiting.  I want a stored procedure that checks to see if a record has
been waiting too long, and if it does, then it will run
FlashLightAndSoundHorn.exe.  How do I run that program from inside a
stored procedure?
 
Thanks very much!
 
RobR
 

Robert D. Richardson
Product Engineer Software
  
RAD-CON, Inc.
TECHNOLOGY: Innovative & Proven
Phone : +1.440.871.5720 ... ext 123
Fax:  +1.440.871.2948
Website:  www.RAD-CON.com  
E-mail:  rob.richard...@rad-con.com

 
<>

Re: [GENERAL] How can I run an external program from a stored procedure?

2010-06-04 Thread Tom Lane
"Rob Richardson"  writes:
> Assume I have a program named FlashLightAndSoundHorn.exe.  In my
> database, there is a table that is read by some other program.  Records
> in that table have a timestamp, so I can tell how long they've been
> waiting.  I want a stored procedure that checks to see if a record has
> been waiting too long, and if it does, then it will run
> FlashLightAndSoundHorn.exe.  How do I run that program from inside a
> stored procedure?

If you write in plperlu or plpythonu then you can use those languages'
ordinary ability to run a subprocess.

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 assign non-composite value to a row variable

2010-06-04 Thread Tom Lane
Alban Hertroys  writes:
> I'm pretty sure you have a naming conflict.

Yeah.  Specifically, the given example looks like it would try to assign
a null to the target variable, since it'd be taking the null value of a
different variable instead of a value from the intended source.

I believe the bizarre error message is coming from a plpgsql bug that we
fixed in 8.4.3, which basically was that assigning a null to a composite
variable would fail in some cases.  If you weren't shooting yourself in
the foot with naming conflicts, you might not trip over that case ...
but an update to 8.4.recent wouldn't be a bad idea anyway.

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


[GENERAL] Connection's limit in SCO OpenServer 5.0.7 and pg 8.3.11 (no more than 94 connections)

2010-06-04 Thread erobles

Hello! I have postgres running on SCO OpenServer 5.0.7

and I've noticed that only accepts up to 94 connections, no more ...
I modified the values in postgresql.conf
max_connections from  100 to 128
shared_buffers  from 24 to 48  MB

postgres is started  with:
su - postgres -c "/usr/local/pgsql83/bin/postmaster -i -D 
/usr/local/pgsql83/data"





I rebuilt the SCO kernel with these values:


NODE"srvr83"
EVDEVS96
EVQUEUES88
NSPTTYS64
NUMSP256
NSTREAM4352
NHINODE1024
GPGSLO2000
GPGSHI6000
NSTRPAGES6000
NAIOPROC50
NAIOREQ400
NAIOBUF400
NAIOHBUF100
NAIOREQPP400
NAIOLOCKTBL50
MAX_PROC1
MAXUMEM1048576
NCALL256
NCLIST512
NSTREVENT14848
NUMTIM1888
NUMTRW1888
SDSKOUT64
TTHOG4096
SECLUID0
SECSTOPIO1
SECCLEARID1

by the way the  following  variables have been established to the maximum
SEMMAP8192
SEMMNI8192
SEMMNS8192
SEMMSL300
SEMMNU100
SHMMAX2147483647


Any reply will be highly appreciated!


regards.




--
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 can I run an external program from a stored procedure?

2010-06-04 Thread Steve Atkins

On Jun 4, 2010, at 8:03 AM, Rob Richardson wrote:

> Greetings!
>  
> I'm running PostgreSQL 8.4 on MS Windows Server 2003.
>  
> Assume I have a program named FlashLightAndSoundHorn.exe.  In my database, 
> there is a table that is read by some other program.  Records in that table 
> have a timestamp, so I can tell how long they've been waiting.  I want a 
> stored procedure that checks to see if a record has been waiting too long, 
> and if it does, then it will run FlashLightAndSoundHorn.exe.  How do I run 
> that program from inside a stored procedure?

A better way to do it is to have an external program that polls the database 
(or waits to be notified from a database trigger using listen/notify) and have 
that program do anything that's needed.

Cheers,
  Steve


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


[GENERAL] Logging in as console crashes the database

2010-06-04 Thread Rob Richardson
We have a customer who is running PostgreSQL 8.4 on a Windows Server
2003 box.  The Postgres service is set up to store data on the
computer's H drive, which is actually an iSCSI connection to a folder of
a disk drive on a separate computer.  The same computer that runs
PostgreSQL also runs the Kepware OPC server.  If a user needs to connect
remotely to this computer to change something in the OPC server, he has
to connect using "mstsc /admin".  More often than not, when a user
connects remotely using the /admin option, PostgreSQL will crash.  The
only indication of a problem left in the log file is a message saying
that error 128 happened, which is a problem with a child process.  It
does not say which process, or what the problem was.
 
The only reference we were able to find on the Web for this problem said
that it went away when the user upgraded from 8.3.1 to 8.4.  That was
why we did the same upgrade.  For us, the problem still exists.
 
Has anyone else seen and fixed this problem?
 
RobR, remaining mystified about why that customer has such as wierd
database configuration
 


Re: [GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Eliot Gable
Thanks for the note on the bugfix in the update. I will try it. However,
there is no naming conflict. The idea was this:

The select query should return one result row for each row in the FROM
clause since there is no WHERE clause. Each result row should be the
contents of the complex1 data type contained by mydatasource. That set of
resulting rows should be converted to an array and assigned to myvariable.

On Fri, Jun 4, 2010 at 11:23 AM, Tom Lane  wrote:

> Alban Hertroys  writes:
> > I'm pretty sure you have a naming conflict.
>
> Yeah.  Specifically, the given example looks like it would try to assign
> a null to the target variable, since it'd be taking the null value of a
> different variable instead of a value from the intended source.
>
> I believe the bizarre error message is coming from a plpgsql bug that we
> fixed in 8.4.3, which basically was that assigning a null to a composite
> variable would fail in some cases.  If you weren't shooting yourself in
> the foot with naming conflicts, you might not trip over that case ...
> but an update to 8.4.recent wouldn't be a bad idea anyway.
>
>regards, tom lane
>



-- 
Eliot Gable

"We do not inherit the Earth from our ancestors: we borrow it from our
children." ~David Brower

"I decided the words were too conservative for me. We're not borrowing from
our children, we're stealing from them--and it's not even considered to be a
crime." ~David Brower

"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not
live to eat.) ~Marcus Tullius Cicero


Re: [GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Tom Lane
Eliot Gable  writes:
> Thanks for the note on the bugfix in the update. I will try it. However,
> there is no naming conflict.

There was most certainly a naming conflict in the sample code you
posted.  I realize that that probably was not the code you were
actually trying to use, but we can only go on what you show us.

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] How do we get the Client-Time and Server-Time from psql ?

2010-06-04 Thread raghavendra t
Thank you Very Much Steve.

On Thu, Jun 3, 2010 at 6:10 AM, Steve Crawford <
scrawf...@pinpointresearch.com> wrote:

> On 06/02/2010 03:29 PM, raghavendra t wrote:
>
>> ...
>>
>> Suppose am at the server-end, how could i get the client-time. Its really
>> troublesome when compared with the timezone column in a table.
>>
>> Not sure what you are getting at. You are always connected to the server
> _through_ a client and you _tell_ the server your timezone preferences.
>
> As long as you are using timestamptz and as long as the client properly
> sets its preferred time-zone prior to issuing queries or gives
> fully-qualified timestamps with TZ, then you are fine.
>
> Alternately, you can use (for libpq clients) the PGTZ environment variable.
>
> Or you can set things on a per-user basis:
> alter user foo set timezone to 'SOMETZ';
>
> Or for things like web-apps where the client-side of the connection to the
> database is probably through a single database-user and the actual users are
> all over the place you can set up a table of user-preferences and set the
> timezone appropriately.
>
> Cheers,
> Steve
>
>


Re: [GENERAL] Connection's limit in SCO OpenServer 5.0.7 and pg 8.3.11 (no more than 94 connections)

2010-06-04 Thread Filip Rembiałkowski
1. What kind of error you get when client tries to establish 95th
connection? 2. Did you try to consult sco expert? The problem seems to
be not caused by postgres...

2010/6/4, erobles :
> Hello! I have postgres running on SCO OpenServer 5.0.7
>
> and I've noticed that only accepts up to 94 connections, no more ...
> I modified the values in postgresql.conf
> max_connections from  100 to 128
> shared_buffers  from 24 to 48  MB
>
> postgres is started  with:
> su - postgres -c "/usr/local/pgsql83/bin/postmaster -i -D
> /usr/local/pgsql83/data"
>
>
>
>
> I rebuilt the SCO kernel with these values:
>
>
> NODE"srvr83"
> EVDEVS96
> EVQUEUES88
> NSPTTYS64
> NUMSP256
> NSTREAM4352
> NHINODE1024
> GPGSLO2000
> GPGSHI6000
> NSTRPAGES6000
> NAIOPROC50
> NAIOREQ400
> NAIOBUF400
> NAIOHBUF100
> NAIOREQPP400
> NAIOLOCKTBL50
> MAX_PROC1
> MAXUMEM1048576
> NCALL256
> NCLIST512
> NSTREVENT14848
> NUMTIM1888
> NUMTRW1888
> SDSKOUT64
> TTHOG4096
> SECLUID0
> SECSTOPIO1
> SECCLEARID1
>
> by the way the  following  variables have been established to the maximum
> SEMMAP8192
> SEMMNI8192
> SEMMNS8192
> SEMMSL300
> SEMMNU100
> SHMMAX2147483647
>
>
> Any reply will be highly appreciated!
>
>
> regards.
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Wysłane z mojego urządzenia przenośnego

Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/

-- 
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 assign non-composite value to a row variable

2010-06-04 Thread Eliot Gable
This is the code I posted:

create type complex1 as ( ... ); -- one integer member and about 16 text
members
create type complex2 as ( ... ); -- few integer members, about 10 text
members, and about 6 different enum members

CREATE OR REPLACE blah ...
...
DECLARE
  myvariable complex1[];
  mydatasource complex1;
  myrowsource complex2[];
...
BEGIN
...
  -- The first way I tried to do it:
  myvariable := array(
SELECT mydatasource FROM unnest(myrowsource)
  );
  -- The second way I tried to do it:
  myvariable := array(
SELECT (mydatasource)::complex1 FROM unnest(myrowsource)
  );
  -- The third way I tried to do it:
  myvariable := array(
SELECT (mydatasource.member1, mydatasource.member2, ...)::complex1 FROM
unnest(myrowsource)
  );
...
END ...

I think you are thinking there is a naming conflict because you are seeing
this:

SELECT mydatasource FROM unnest(myrowsource)

And also seeing this:

DECLARE
  myvariable complex1[];
  mydatasource complex1;
  myrowsource complex2[];

And also think that there is a column called mydatasource in
unnest(myrowsource). But there is no such column. If you are thinking there
is a naming conflict for another reason, please explain, because I'm not
seeing it.

What I am doing here is rather strange, and maybe there is a better way to
do it. I'm just not aware of it. I'm relatively new to PostgreSQL. As I
said, what I'm expecting my code to do is literally:

1. unnest the myrowsource array into rows
2. use the current contents of the previously declared mydatasource
variable, which is of type 'complex1' to
3. generate as many rows using those contents as there are rows in the
unnesting of myrowsource array
4. construct an array based on the resulting set of rows and store it in
myvariable


On Fri, Jun 4, 2010 at 1:40 PM, Tom Lane  wrote:

> Eliot Gable >
> writes:
> > Thanks for the note on the bugfix in the update. I will try it. However,
> > there is no naming conflict.
>
> There was most certainly a naming conflict in the sample code you
> posted.  I realize that that probably was not the code you were
> actually trying to use, but we can only go on what you show us.
>
>regards, tom lane
>



-- 
Eliot Gable

"We do not inherit the Earth from our ancestors: we borrow it from our
children." ~David Brower

"I decided the words were too conservative for me. We're not borrowing from
our children, we're stealing from them--and it's not even considered to be a
crime." ~David Brower

"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not
live to eat.) ~Marcus Tullius Cicero


Re: [GENERAL] Logging in as console crashes the database

2010-06-04 Thread John R Pierce

Rob Richardson wrote:
We have a customer who is running PostgreSQL 8.4 on a Windows Server 
2003 box.  The Postgres service is set up to store data on the 
computer's H drive, which is actually an iSCSI connection to a folder 
of a disk drive on a separate computer.  The same computer that runs 
PostgreSQL also runs the Kepware OPC server.  If a user needs to 
connect remotely to this computer to change something in the OPC 
server, he has to connect using "mstsc /admin".  More often than not, 
when a user connects remotely using the /admin option, PostgreSQL will 
crash.  The only indication of a problem left in the log file is a 
message saying that error 128 happened, which is a problem with a 
child process.  It does not say which process, or what the problem was.
 
The only reference we were able to find on the Web for this problem 
said that it went away when the user upgraded from 8.3.1 to 8.4.  That 
was why we did the same upgrade.  For us, the problem still exists.
 
Has anyone else seen and fixed this problem?



I've been watching these various reports of MSTSC causing the postgres 
service process to crash, and must say I've very mystified as to what 
possible mechanisms could be involved.I should note, I almost 
exclusively run postgres on Unix (AIX, Solaris) and Linux (mostly 
RHEL/CentOS), but I am quite familiar with MS Windows Server innards 
from other contexts.


I do hope your description of the iscsi connection is somewhat vague and 
mildly incorrect.  ISCSI targets (servers) are block devices, and 
usually serve either a disk partition or a single large file up as the 
logical unit to the iscsi initiator (your win2003 postgres server in 
this context).   also, I would ONLY run a database across iscsi if the 
iscsi target/server is a really robust appliance kind of environment, 
and not some sort of adhoc "oh look, we have some spare space over here, 
lets just serve it up", as if you reboot that target machine, the 
initiator (client) is gonna throw a hissy fit.


The one thing that MSTSC /ADMIN does that might impact processes is 
notify all processes in the 'desktop session' that the display driver 
and resolution etc is changing, I believe via a WM_DISPLAYCHANGE.   I 
can't see how this could impact a background service process, but if its 
service wrapper didn't handle this message well, perhaps thats a clue?


Does the 'new' version of Postgres for Windows packaged by EnterpriseDB 
have any sort of notify tray icon?


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


[GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Hi All,

We want to replicate /move data form db2 to postgres is there any software /
solutions / approach available to do this?

Thanks
Deepak


Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread Richard Broersma
On Fri, Jun 4, 2010 at 2:13 PM, DM  wrote:
> We want to replicate /move data form db2 to postgres is there any software /
> solutions / approach available to do this?


Here is a link on the postgresql wiki.

Hopefully it has some useful information.

http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#IBM_DB2

-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

-- 
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thanks Robert,

Is there any tools available.

Thanks
Deepak

On Fri, Jun 4, 2010 at 2:19 PM, Richard Broersma  wrote:

> On Fri, Jun 4, 2010 at 2:13 PM, DM  wrote:
> > We want to replicate /move data form db2 to postgres is there any
> software /
> > solutions / approach available to do this?
>
>
> Here is a link on the postgresql wiki.
>
> Hopefully it has some useful information.
>
>
> http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#IBM_DB2
>
> --
> Regards,
> Richard Broersma Jr.
>
> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> http://pugs.postgresql.org/lapug
>


Re: [GENERAL] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce

DM wrote:

Hi All,

We want to replicate /move data form db2 to postgres is there any 
software / solutions / approach available to do this?


in general, I'd likely use a perl or similar program to connect to the 
'other' database, fetch your data, and insert it into your postgres 
database.  this, of course, would require knowledge of the specific data 
you want to copy.   if you are talking about a live ongoing replica, 
then it gets more complicated.   if you're moving applications from DB2 
to postgres, yet more complications.


another approach might be DBI-Link, which is a plugin for postgres that 
allows you to connect to foreign external databases from within a 
postgres database, using pl/perl




--
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Sorry i didnt frame my question properly earlier, we are looking for
solution to do real time replication from db2 to postgres, its different
from migration.
Eventually we want to move away from DB2. Intention is to create a subset of
a db2 database on postgres and allow users to access the postgres database.

Thanks
Deepak

On Fri, Jun 4, 2010 at 2:23 PM, DM  wrote:

> Thanks Robert,
>
> Is there any tools available.
>
> Thanks
> Deepak
>
>
> On Fri, Jun 4, 2010 at 2:19 PM, Richard Broersma <
> richard.broer...@gmail.com> wrote:
>
>> On Fri, Jun 4, 2010 at 2:13 PM, DM  wrote:
>> > We want to replicate /move data form db2 to postgres is there any
>> software /
>> > solutions / approach available to do this?
>>
>>
>> Here is a link on the postgresql wiki.
>>
>> Hopefully it has some useful information.
>>
>>
>> http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#IBM_DB2
>>
>> --
>> Regards,
>> Richard Broersma Jr.
>>
>> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
>> http://pugs.postgresql.org/lapug
>>
>
>


Re: [GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Alvaro Herrera
Excerpts from Eliot Gable's message of vie jun 04 16:13:28 -0400 2010:
> This is the code I posted:
> 
> create type complex1 as ( ... ); -- one integer member and about 16 text
> members
> create type complex2 as ( ... ); -- few integer members, about 10 text
> members, and about 6 different enum members

If you present some sample code that somebody can paste directly into a
psql session, we can provide useful help.  Nobody here has time to
construct such things from vague descriptions.

-- 
Álvaro Herrera 

-- 
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread David Fetter
Deepak,

You can use DBI-Link to make writeable views of tables in DB2 (or
other data store) from PostgreSQL.  You can use the same linkage to
materialize those views, if you like.

The latest version of the software is on GitHub

http://github.com/davidfetter/DBI-Link

You can also join the low-traffic mailing list at

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

Cheers,
David.
On Fri, Jun 04, 2010 at 02:33:53PM -0700, DM wrote:
> Sorry i didnt frame my question properly earlier, we are looking for
> solution to do real time replication from db2 to postgres, its different
> from migration.
> Eventually we want to move away from DB2. Intention is to create a subset of
> a db2 database on postgres and allow users to access the postgres database.
> 
> Thanks
> Deepak
> 
> On Fri, Jun 4, 2010 at 2:23 PM, DM  wrote:
> 
> > Thanks Robert,
> >
> > Is there any tools available.
> >
> > Thanks
> > Deepak
> >
> >
> > On Fri, Jun 4, 2010 at 2:19 PM, Richard Broersma <
> > richard.broer...@gmail.com> wrote:
> >
> >> On Fri, Jun 4, 2010 at 2:13 PM, DM  wrote:
> >> > We want to replicate /move data form db2 to postgres is there any
> >> software /
> >> > solutions / approach available to do this?
> >>
> >>
> >> Here is a link on the postgresql wiki.
> >>
> >> Hopefully it has some useful information.
> >>
> >>
> >> http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#IBM_DB2
> >>
> >> --
> >> Regards,
> >> Richard Broersma Jr.
> >>
> >> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> >> http://pugs.postgresql.org/lapug
> >>
> >
> >

-- 
David Fetter  http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: david.fet...@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce

DM wrote:
Sorry i didnt frame my question properly earlier, we are looking for 
solution to do real time replication from db2 to postgres, its 
different from migration. 
Eventually we want to move away from DB2. Intention is to create a 
subset of a db2 database on postgres and allow users to access the 
postgres database.


*real* realtime, as in transaction by transaction?  or sorta-realtime, 
as in updates every X interval where X is a minute or few?


wild guess says, you'll need to roll that yourself, probably on the DB2 
side using triggers, and I have no idea how you'd connect to PG from the 
DB2 procedures (as I know very little about DB2 specifically)




--
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thank you so much for every ones inputs.

It is not real time, updates every 5 mins should be fine.
But the DB2 database is real busy and its real performance based.

Thanks
Deepak

On Fri, Jun 4, 2010 at 2:49 PM, John R Pierce  wrote:

> DM wrote:
>
>> Sorry i didnt frame my question properly earlier, we are looking for
>> solution to do real time replication from db2 to postgres, its different
>> from migration. Eventually we want to move away from DB2. Intention is to
>> create a subset of a db2 database on postgres and allow users to access the
>> postgres database.
>>
>
> *real* realtime, as in transaction by transaction?  or sorta-realtime, as
> in updates every X interval where X is a minute or few?
>
> wild guess says, you'll need to roll that yourself, probably on the DB2
> side using triggers, and I have no idea how you'd connect to PG from the DB2
> procedures (as I know very little about DB2 specifically)
>
>
>
>
> --
> 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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread John R Pierce

DM wrote:

Thank you so much for every ones inputs.

It is not real time, updates every 5 mins should be fine. 
But the DB2 database is real busy and its real performance based. 


well, you might look over 
http://www.redbooks.ibm.com/abstracts/sg246828.html   which discusses 
DB2 replication.  "The Appendix C provides information about configuring 
federated access to Informix, which can be used as a model for federated 
access to other non-DB2 database, such as Oracle, MS SQL Server, Sybase, 
and more, using DB2 Information Integrator V8. "






--
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] Move data from DB2 to Postgres any software/solutions/approach?

2010-06-04 Thread DM
Thank you so much for all your inputs.

On Fri, Jun 4, 2010 at 3:27 PM, John R Pierce  wrote:

> DM wrote:
>
>> Thank you so much for every ones inputs.
>>
>> It is not real time, updates every 5 mins should be fine. But the DB2
>> database is real busy and its real performance based.
>>
>
> well, you might look over
> http://www.redbooks.ibm.com/abstracts/sg246828.html   which discusses DB2
> replication.  "The Appendix C provides information about configuring
> federated access to Informix, which can be used as a model for federated
> access to other non-DB2 database, such as Oracle, MS SQL Server, Sybase, and
> more, using DB2 Information Integrator V8. "
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


[GENERAL] Null comparisons and the transform_null_equals run-time parameter

2010-06-04 Thread Ken Winter
When the run-time parameter transform_null_equals is on, shouldn't two
variables with NULL values evaluate as equal?  They don't seem to.  

 

At the bottom of this message is a little test function.  It tries all
comparisons of NULL-valued variables and NULL constants, both before and
after turning transform_null_equals on.  Here's what it returns:

 

transform_null_equals OFF: NULL = NULL -> Unknown

transform_null_equals OFF: v1 = NULL -> Unknown

transform_null_equals OFF: NULL = v2 -> Unknown

transform_null_equals OFF: v1 = v2 -> Unknown

transform_null_equals ON: NULL = NULL -> True

transform_null_equals ON: v1 = NULL -> True

transform_null_equals ON: NULL = v2 -> True

transform_null_equals ON: v1 = v2 -> Unknown

 

My problem is in the last line: Comparing two NULL variables produces an
unknown result.  I need it to evaluate as True, like the preceding three
comparisons.

 

Any suggestions?

 

~ TIA

~ Ken

 

 

CREATE OR REPLACE FUNCTION test() RETURNS varchar AS

$BODY$

DECLARE

  v1 VARCHAR;

  v2 VARCHAR;

  s VARCHAR := '';

BEGIN

  v1 := Null;

  v2 := Null;

  IF NULL = NULL THEN

s := s || 'transform_null_equals OFF: NULL = NULL -> True ';

  ELSIF NOT (NULL = NULL) THEN

s := s || 'transform_null_equals OFF: NULL = NULL -> False ';

  ELSE

s := s || 'transform_null_equals OFF: NULL = NULL -> Unknown ';

  END IF;

  s := s || chr(10);

  IF v1 = NULL THEN

s := s || 'transform_null_equals OFF: v1 = NULL -> True ';

  ELSIF NOT (v1 = NULL) THEN

s := s || 'transform_null_equals OFF: v1 = NULL -> False ';

  ELSE

s := s || 'transform_null_equals OFF: v1 = NULL -> Unknown ';

  END IF;

  s := s || chr(10);

  IF NULL = v2 THEN

s := s || 'transform_null_equals OFF: NULL = v2 -> True ';

  ELSIF NOT (NULL = v2) THEN

s := s || 'transform_null_equals OFF: NULL = v2 -> False ';

  ELSE

s := s || 'transform_null_equals OFF: NULL = v2 -> Unknown ';

  END IF;

  s := s || chr(10);

  IF v1 = v2 THEN

s := s || 'transform_null_equals OFF: v1 = v2 - > True ';

  ELSIF NOT v1 = v2 THEN

s := s || 'transform_null_equals OFF: v1 = v2 -> False ';

  ELSE

s := s || 'transform_null_equals OFF: v1 = v2 -> Unknown ';

  END IF;

  s := s || chr(10);

 

  SET LOCAL transform_null_equals TO ON;

 

  IF NULL = NULL THEN

s := s || 'transform_null_equals ON: NULL = NULL -> True ';

  ELSIF NOT (NULL = NULL) THEN

s := s || 'transform_null_equals ON: NULL = NULL -> False ';

  ELSE

s := s || 'transform_null_equals ON: NULL = NULL -> Unknown ';

  END IF;

  s := s || chr(10);

  IF v1 = NULL THEN

s := s || 'transform_null_equals ON: v1 = NULL -> True ';

  ELSIF NOT (v1 = NULL) THEN

s := s || 'transform_null_equals ON: v1 = NULL -> False ';

  ELSE

s := s || 'transform_null_equals ON: v1 = NULL -> Unknown ';

  END IF;

  s := s || chr(10);

  IF NULL = v2 THEN

s := s || 'transform_null_equals ON: NULL = v2 -> True ';

  ELSIF NOT (NULL = v2) THEN

s := s || 'transform_null_equals ON: NULL = v2 -> False ';

  ELSE

s := s || 'transform_null_equals ON: NULL = v2 -> Unknown ';

  END IF;

  s := s || chr(10);

  IF v1 = v2 THEN

s := s || 'transform_null_equals ON: v1 = v2 -> True ';

  ELSIF NOT v1 = v2 THEN

s := s || 'transform_null_equals ON: v1 = v2 -> False ';

  ELSE

s := s || 'transform_null_equals ON: v1 = v2 -> Unknown ';

  END IF;

  

  RETURN s;   

END;

$BODY$

LANGUAGE plpgsql VOLATILE;

 

 

SELECT test();



Re: [GENERAL] cannot assign non-composite value to a row variable

2010-06-04 Thread Eliot Gable
Updating did solve the problem. Thanks.

On Fri, Jun 4, 2010 at 11:23 AM, Tom Lane  wrote:

> Alban Hertroys  writes:
> > I'm pretty sure you have a naming conflict.
>
> Yeah.  Specifically, the given example looks like it would try to assign
> a null to the target variable, since it'd be taking the null value of a
> different variable instead of a value from the intended source.
>
> I believe the bizarre error message is coming from a plpgsql bug that we
> fixed in 8.4.3, which basically was that assigning a null to a composite
> variable would fail in some cases.  If you weren't shooting yourself in
> the foot with naming conflicts, you might not trip over that case ...
> but an update to 8.4.recent wouldn't be a bad idea anyway.
>
>regards, tom lane
>



-- 
Eliot Gable

"We do not inherit the Earth from our ancestors: we borrow it from our
children." ~David Brower

"I decided the words were too conservative for me. We're not borrowing from
our children, we're stealing from them--and it's not even considered to be a
crime." ~David Brower

"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not
live to eat.) ~Marcus Tullius Cicero


[GENERAL] parsing geometric operators

2010-06-04 Thread Konstantin Izmailov
I'm creating my own parser/regex combination for fast and lightweight
Postgres queries processing (in a user app). So I wanted to double check
some details in PG source, but could not find the geometric operators (
http://www.postgresql.org/docs/8.4/static/functions-geometry.html)
definition/rules neither in gram.y nor in scan.l.

I could try to define the rules based on documentation... but would it be
possible to find how they are defined in the PG source?

Thank you,
Konstantin


[GENERAL] Postgres 8.4 segfaults on CentOS 5.5 (using EnterpriseDB installers)

2010-06-04 Thread Aleksey Tsalolikhin
Hi.

   We've been running PostgreSQL 8.4.2 on CentOS 5.4 (64-bit),
installed with the EnterpriseDB installer.  This has been excellent.

   Now we have our first CentOS 5.5 server (64-bit) and I installed
PostgreSQL 8.4.4 using the EnterpriseDB installer, and it is unable to
start the database instance.  If I try to start it manually, I get a
Segmentation Fault.  I tried the 8.4.2 installer, but the installed
binaries segfault too.  Have you seen this?  Any suggestions to
resolve it?

  My /var/log/messages contains this after I try to run "psql" or
"pg_ctl" (after 8.4.2 install):

Jun  4 18:12:07 hwd-ddc-fox-prod01 kernel: psql[14072]: segfault at
0008 rip 00372340a402 rsp 7fffc0b2b940 error 4

Jun  4 18:22:53 hwd-ddc-fox-prod01 kernel: pg_ctl[14163]: segfault at
0008 rip 00372340a402 rsp 7fff8d14f040 error 4


Here is an strace:

open("/opt/PostgreSQL/8.4/bin/../lib/libsepol.so.1", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/lib64/libsepol.so.1", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\...@=\0%7\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=247496, ...}) = 0
mmap(0x372500, 2383168, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x372500
mprotect(0x372503b000, 2097152, PROT_NONE) = 0
mmap(0x372523b000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3b000) = 0x372523b000
mmap(0x372523c000, 40256, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x372523c000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2abeb4a36000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2abeb4a37000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2abeb4a38000
arch_prctl(ARCH_SET_FS, 0x2abeb4a37960) = 0
mprotect(0x372a211000, 4096, PROT_READ) = 0
mprotect(0x3724615000, 4096, PROT_READ) = 0
mprotect(0x3723b4d000, 16384, PROT_READ) = 0
mprotect(0x3724281000, 4096, PROT_READ) = 0
mprotect(0x3723e02000, 4096, PROT_READ) = 0
mprotect(0x3737008000, 4096, PROT_READ) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


I tried turning off SELinux but still get the Segmentation Fault.

Any suggestions, please?

Best,
-at

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


[GENERAL] ERROR: character 0x90 of encoding "WIN1252" has no equivalent in "UTF8"

2010-06-04 Thread Wang, Mary Y
Hi,

I'm getting this error from postgres " ERROR:  character 0x90 of encoding 
"WIN1252" has no equivalent in "UTF8"  " and from a dump file when I tried to 
use psql command to restore the dump.

I have SET client_encoding = 'win1252' in the dump file.

Any ideas?

Thanks
Mary





-- 
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] Logging in as console crashes the database

2010-06-04 Thread Craig Ringer
On 05/06/10 01:02, Rob Richardson wrote:
> We have a customer who is running PostgreSQL 8.4 on a Windows Server
> 2003 box.  The Postgres service is set up to store data on the
> computer's H drive, which is actually an iSCSI connection to a folder of
> a disk drive on a separate computer.  The same computer that runs
> PostgreSQL also runs the Kepware OPC server.  If a user needs to connect
> remotely to this computer to change something in the OPC server, he has
> to connect using "mstsc /admin".  More often than not, when a user
> connects remotely using the /admin option, PostgreSQL will crash.  The
> only indication of a problem left in the log file is a message saying
> that error 128 happened, which is a problem with a child process.  It
> does not say which process, or what the problem was.
>  
> The only reference we were able to find on the Web for this problem said
> that it went away when the user upgraded from 8.3.1 to 8.4.  That was
> why we did the same upgrade.  For us, the problem still exists.

Since you have a fairly reliable way to reproduce the crash, a backtrace
showing what is actually happening might be really handy. See:

http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Windows



-- 
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.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] parsing geometric operators

2010-06-04 Thread Konstantin Izmailov
Please ignore my question. I found "Op" tokens definition in scan.l!

On Fri, Jun 4, 2010 at 6:15 PM, Konstantin Izmailov wrote:

> I'm creating my own parser/regex combination for fast and lightweight
> Postgres queries processing (in a user app). So I wanted to double check
> some details in PG source, but could not find the geometric operators (
> http://www.postgresql.org/docs/8.4/static/functions-geometry.html)
> definition/rules neither in gram.y nor in scan.l.
>
> I could try to define the rules based on documentation... but would it be
> possible to find how they are defined in the PG source?
>
> Thank you,
> Konstantin
>