Re: [GENERAL] InitDB: Bad system call

2010-08-10 Thread Torsten Zühlsdorff

Hello Thom,


See http://www.postgresql.org/docs/9.0/static/kernel-resources.html
and the section under NetBSD/OpenBSD.


I already know the FreeBSD section. My current values are:

kern.ipc.shmall: 131072
kern.ipc.shmmax: 2684225436
kern.ipc.semmap: 4096

kern.ipc.semmnu: 512
kern.ipc.semmns: 1024
kern.ipc.semmni: 512

kern.ipc.shm_use_phys: 0

security.jail.sysvipc_allowed: 1

I also run the user with different UIDs:

$ grep pgsql -h /usr/local/jail/*/*/etc/passwd
pgsql:*:1070:70:PostgreSQL Daemon:/usr/local/pgsql:/bin/sh
pgsql:*:7575:7575:PostgreSQL Daemon:/usr/local/pgsql:/bin/sh
pgsql:*:1074:70:PostgreSQL Daemon:/usr/local/pgsql:/bin/sh
pgsql:*:1071:70:PostgreSQL Daemon:/usr/local/pgsql:/bin/sh

I also rebuild the complete jail to make sure, that it is not an error
while creating the jail.
I also disable all - but one (the live-db ;)) - postgresql instance to
make sure, that enough shared memory is free.
But the "bad system call" messages don't go away. Any other hint?

Greetings,
Torsten


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


[GENERAL] pl/pgsql editor and postgres developemnt tool

2010-08-10 Thread Atul.Goel
Hi All,

I am looking for a good tool for pl/pgsql / postgres developemnt tool. 
Something like Toad for Oracle.

Regards,
Atul Goel
SENIOR DEVELOPER

Global DataPoint
Middlesex House, 34-42 Cleveland Street
London W1T 4LB, UK
T: +44 (0)20 7079 4827
M: +44 (0)7846765098
www.globaldatapoint.com

This e-mail is confidential and should not be used by anyone who is not the 
original intended recipient. Global DataPoint Limited does not accept liability 
for any statements made which are clearly the sender's own and not expressly 
made on behalf of Global DataPoint Limited. No contracts may be concluded on 
behalf of Global DataPoint Limited by means of e-mail communication. Global 
DataPoint Limited Registered in England and Wales with registered number 
3739752 Registered Office Middlesex House, 34-42 Cleveland Street, London W1T 
4LB


Re: [GENERAL] pl/pgsql editor and postgres developemnt tool

2010-08-10 Thread Raymond O'Donnell
On 10/08/2010 09:39, atul.g...@globaldatapoint.com wrote:
> Hi All,
> 
>  
> 
> I am looking for a good tool for pl/pgsql / postgres developemnt tool.
> Something like Toad for Oracle.
> 

pgAdmin together with the pl/pgsql debugger plug-in are a pretty good
combination by all accounts.

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie

-- 
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] change owner strange behavior

2010-08-10 Thread David Galkowski
8.1.11

On Mon, Aug 9, 2010 at 9:29 PM, Tom Lane  wrote:
> David Galkowski  writes:
>> In order to consolidate two users, user1 and user2, in the database I
>> changed the owner of all tables and views that user2 owned to be owned
>> by user1.  I then revoked all remaining privileges from user2 and
>> dropped the role.  During this process I changed both table1 and view1
>> (that selects from table1) to be owned by user1.  After this process,
>> user1 cannot select from view1 with an error saying permission denied
>> on table1.
>
> Works for me ... what PG version are you dealing with?
>
>                        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] Partitioning into thousands of tables?

2010-08-10 Thread Davor J.
"Data Growth Pty Ltd"  wrote in message 
news:aanlktimzaio+7mtur=sx0jcqwu7uk+_xznudl4qrm...@mail.gmail.com...
  I have a table of around 200 million rows, occupying around 50G of disk.  It 
is slow to write, so I would like to partition it better.

Have you actually tested this? Why do you expect an improvement? I am quite 
interested.

Manual states: 

"The benefits will normally be worthwhile only when a table would otherwise be 
very large. The exact point at which a table will benefit from partitioning 
depends on the application, although a rule of
thumb is that the size of the table should exceed the physical memory of the 
database server."

Unfortunately, this last sentence is not explained. What operations would 
benefit from partitioning and what operations would not?

Another problem is that there is no time complexity information in the manual, 
and it can hardly be found on the net either.

But here is a try based on my limited understanding from the docs (and on which 
I would appreciate some feedback):

- INSERT on an unconstrained, unindex, etc (i.e. plain table): O(1). So the 
table size "in itself" doesn't play a role. But you probably have indexes. If 
they are B-trees you probably would be in the range of O(log(n)). (See 
http://en.wikipedia.org/wiki/B-tree. Unfortunately it doesn't show complexity, 
but it does say in the heading that "B-tree is optimized for systems that read 
and write large blocks of data". Also check 
http://en.wikipedia.org/wiki/B-tree#Insertion) Now 200M or 2M records... I 
wouldn't expect much improvement.

-UPDATES: I read somewhere that indexes use pointers to the data. I suppose 
your UPDATE-constraints are indexed, so there is no need for sequential scans 
on the implicit SELECT. So partitioning will not give you better performance. 
System cache will do it's job here.

A possible problem would be if your indexes are larger than your available 
memory. What impact that would have I completely do not know and I think it 
would be nice if someone could clear that up a bit. What impact would it have 
on SELECT? But in your case with 200M records, the indexes probably fit well 
into memory?

Regards,
Davor Josipovic

Re: [GENERAL] InitDB: Bad system call

2010-08-10 Thread Torsten Zühlsdorff

Torsten Zühlsdorff schrieb:

i've just compiled a new Jail at my FreeBDS 7.0-STABLE machine and 
trying to get PostgreSQL 9.0 Beta 4 running. Compiling etc works fine.


But when i call the initdb, i get "Bad System Call" messages. Here is 
the output:


$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -d
[output]

First i believed this is an error relating to SYSVSHM-, SYSVSEM-, 
SYSVMSG-options or User-Id 
(http://www.freebsddiary.org/jail-multiple.php). But the postgres-user 
has a user-id which is not used by other postgres-instances in other 
jails. And the other options are enabled in the root-instance.


I also tried to build postgres from a fresh portstree, to make sure, 
that i have nothing miss-"./configure"d, but there are the same problems.


I've tried the initdb in the only jail PostgreSQL is already running. 
There it works.


I have no clue what to do next. I didn't even find the core-dump -.- 
Should i just tune-up the System V IPC parameters and hope?


Greetings,
Torsten

--
http://www.dddbl.de - ein Datenbank-Layer, der die Arbeit mit 8 
verschiedenen Datenbanksystemen abstrahiert,
Queries von Applikationen trennt und automatisch die Query-Ergebnisse 
auswerten kann.


--
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] pl/pgsql editor and postgres developemnt tool

2010-08-10 Thread Atul.Goel
Hi Ray,

Thanks for reply. Are you using any editor for code formatting?

Regards,
Atul Goel


-Original Message-
From: Raymond O'Donnell [mailto:r...@iol.ie]
Sent: 10 August 2010 10:30
To: Atul Goel
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] pl/pgsql editor and postgres developemnt tool

On 10/08/2010 09:39, atul.g...@globaldatapoint.com wrote:
> Hi All,
>
>
>
> I am looking for a good tool for pl/pgsql / postgres developemnt tool.
> Something like Toad for Oracle.
>

pgAdmin together with the pl/pgsql debugger plug-in are a pretty good
combination by all accounts.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie
This e-mail is confidential and should not be used by anyone who is not the 
original intended recipient. Global DataPoint Limited does not accept liability 
for any statements made which are clearly the sender's own and not expressly 
made on behalf of Global DataPoint Limited. No contracts may be concluded on 
behalf of Global DataPoint Limited by means of e-mail communication. Global 
DataPoint Limited Registered in England and Wales with registered number 
3739752 Registered Office Middlesex House, 34-42 Cleveland Street, London W1T 
4LB

-- 
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] InitDB: Bad system call

2010-08-10 Thread Reko Turja

Torsten Zühlsdorff schrieb:

i've just compiled a new Jail at my FreeBDS 7.0-STABLE machine and 
trying to get PostgreSQL 9.0 Beta 4 running. Compiling etc works 
fine.


Is the machine really running a pre-RELENG 7.0?

But when i call the initdb, i get "Bad System Call" messages. Here 
is the output:


The system throwing out a coredump instead of failing gracefully 
suggests an OS bug and as you are seemingly running an ancient 
development branch, that seems even quite plausible.


In any case I'd ask the same question in the freebsd-questions as 
well.


-Reko 



--
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] InitDB: Bad system call

2010-08-10 Thread Torsten Zühlsdorff

Reko Turja schrieb:

i've just compiled a new Jail at my FreeBDS 7.0-STABLE machine and 
trying to get PostgreSQL 9.0 Beta 4 running. Compiling etc works fine.


Is the machine really running a pre-RELENG 7.0?


As far as i now, we used the 7.0 versions some month after their 
release. So: no.

When i look in, i see in the welcome message:
FreeBSD 7.0-STABLE (GENERIC) #1: Fri Aug 15 19:33:13 CEST 2008

That are 6 months after initial release of 7.0.

But when i call the initdb, i get "Bad System Call" messages. Here is 
the output:


The system throwing out a coredump instead of failing gracefully 
suggests an OS bug and as you are seemingly running an ancient 
development branch, that seems even quite plausible.


I'm running a development *jail* at the *same* machine like the 
live-database. The live-database works greats. There is also a second 
jail were a postgresql-instance is running. In both i can use Postgresql 
(versions 8.3 and 8.4) without any limitations. But in the third-jail i 
get the problems.


Greetings,
Torsten

--
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] change owner strange behavior

2010-08-10 Thread Tom Lane
David Galkowski  writes:
> On Mon, Aug 9, 2010 at 9:29 PM, Tom Lane  wrote:
>> Works for me ... what PG version are you dealing with?

> 8.1.11

Oh.  This is something we fixed in 8.2 and beyond:
http://archives.postgresql.org/pgsql-committers/2006-09/msg00101.php

It was not possible to back-patch it because of this:
http://archives.postgresql.org/pgsql-hackers/2006-04/msg01140.php

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] need help with plphp installation

2010-08-10 Thread Pete Kay
Hi,

I am getting the following errors while trying to get plphp installed
on postgres 8.5:

ERROR:  could not load library "/usr/local/pgsql/lib/plphp.so":
/usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals

** Error **

ERROR: could not load library "/usr/local/pgsql/lib/plphp.so":
/usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
SQL state: 58P01


here is what I get with ldd command:

 ldd -r /usr/local/lib/libphp5.so
linux-vdso.so.1 =>  (0x7fffa95ff000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x7fbd23614000)
librt.so.1 => /lib64/librt.so.1 (0x7fbd2340b000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x7fbd231f5000)
libm.so.6 => /lib64/libm.so.6 (0x7fbd22f72000)
libdl.so.2 => /lib64/libdl.so.2 (0x7fbd22d6e000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x7fbd22b55000)
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x7fbd22818000)
libz.so.1 => /usr/lib64/libz.so.1 (0x7fbd22604000)
libc.so.6 => /lib64/libc.so.6 (0x7fbd222ad000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7fbd22092000)
/lib64/ld-linux-x86-64.so.2 (0x003053e0)
undefined symbol: sapi_globals  (/usr/local/lib/libphp5.so)
undefined symbol: executor_globals  (/usr/local/lib/libphp5.so)
undefined symbol: php_ini_opened_path   (/usr/local/lib/libphp5.so)
undefined symbol: sapi_module   (/usr/local/lib/libphp5.so)
undefined symbol: php_import_environment_variables
(/usr/local/lib/libphp5.so)
undefined symbol: zend_qsort(/usr/local/lib/libphp5.so)
undefined symbol: module_registry   (/usr/local/lib/libphp5.so)
undefined symbol: php_module_shutdown_wrapper   (/usr/local/lib/libphp5.so)
undefined symbol: zend_error(/usr/local/lib/libphp5.so)
undefined symbol: xmlwriter_module_entry(/usr/local/lib/libphp5.so)
undefined symbol: libxml_module_entry   (/usr/local/lib/libphp5.so)
undefined symbol: dom_module_entry  (/usr/local/lib/libphp5.so)
undefined symbol: xmlreader_module_entry(/usr/local/lib/libphp5.so)
undefined symbol: xml_module_entry  (/usr/local/lib/libphp5.so)

Any help will be greatly appreciated.

p

-- 
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] need help with plphp installation

2010-08-10 Thread Thom Brown
On 10 August 2010 15:21, Pete Kay  wrote:
> Hi,
>
> I am getting the following errors while trying to get plphp installed
> on postgres 8.5:
>
> ERROR:  could not load library "/usr/local/pgsql/lib/plphp.so":
> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
>
> ** Error **
>
> ERROR: could not load library "/usr/local/pgsql/lib/plphp.so":
> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
> SQL state: 58P01
>
> 
> here is what I get with ldd command:
>
>  ldd -r /usr/local/lib/libphp5.so
>        linux-vdso.so.1 =>  (0x7fffa95ff000)
>        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x7fbd23614000)
>        librt.so.1 => /lib64/librt.so.1 (0x7fbd2340b000)
>        libresolv.so.2 => /lib64/libresolv.so.2 (0x7fbd231f5000)
>        libm.so.6 => /lib64/libm.so.6 (0x7fbd22f72000)
>        libdl.so.2 => /lib64/libdl.so.2 (0x7fbd22d6e000)
>        libnsl.so.1 => /lib64/libnsl.so.1 (0x7fbd22b55000)
>        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x7fbd22818000)
>        libz.so.1 => /usr/lib64/libz.so.1 (0x7fbd22604000)
>        libc.so.6 => /lib64/libc.so.6 (0x7fbd222ad000)
>        libpthread.so.0 => /lib64/libpthread.so.0 (0x7fbd22092000)
>        /lib64/ld-linux-x86-64.so.2 (0x003053e0)
> undefined symbol: sapi_globals  (/usr/local/lib/libphp5.so)
> undefined symbol: executor_globals      (/usr/local/lib/libphp5.so)
> undefined symbol: php_ini_opened_path   (/usr/local/lib/libphp5.so)
> undefined symbol: sapi_module   (/usr/local/lib/libphp5.so)
> undefined symbol: php_import_environment_variables
> (/usr/local/lib/libphp5.so)
> undefined symbol: zend_qsort    (/usr/local/lib/libphp5.so)
> undefined symbol: module_registry       (/usr/local/lib/libphp5.so)
> undefined symbol: php_module_shutdown_wrapper   (/usr/local/lib/libphp5.so)
> undefined symbol: zend_error    (/usr/local/lib/libphp5.so)
> undefined symbol: xmlwriter_module_entry        (/usr/local/lib/libphp5.so)
> undefined symbol: libxml_module_entry   (/usr/local/lib/libphp5.so)
> undefined symbol: dom_module_entry      (/usr/local/lib/libphp5.so)
> undefined symbol: xmlreader_module_entry        (/usr/local/lib/libphp5.so)
> undefined symbol: xml_module_entry      (/usr/local/lib/libphp5.so)
>
> Any help will be greatly appreciated.
>
> p
>
> --
You can't mean 8.5.  Surely 8.4?

-- 
Thom Brown
Registered Linux user: #516935

-- 
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] need help with plphp installation

2010-08-10 Thread Pete Kay
sorry my mistake.  It is 8.4.

On Tue, Aug 10, 2010 at 10:27 PM, Thom Brown  wrote:
> On 10 August 2010 15:21, Pete Kay  wrote:
>> Hi,
>>
>> I am getting the following errors while trying to get plphp installed
>> on postgres 8.5:
>>
>> ERROR:  could not load library "/usr/local/pgsql/lib/plphp.so":
>> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
>>
>> ** Error **
>>
>> ERROR: could not load library "/usr/local/pgsql/lib/plphp.so":
>> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
>> SQL state: 58P01
>>
>> 
>> here is what I get with ldd command:
>>
>>  ldd -r /usr/local/lib/libphp5.so
>>        linux-vdso.so.1 =>  (0x7fffa95ff000)
>>        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x7fbd23614000)
>>        librt.so.1 => /lib64/librt.so.1 (0x7fbd2340b000)
>>        libresolv.so.2 => /lib64/libresolv.so.2 (0x7fbd231f5000)
>>        libm.so.6 => /lib64/libm.so.6 (0x7fbd22f72000)
>>        libdl.so.2 => /lib64/libdl.so.2 (0x7fbd22d6e000)
>>        libnsl.so.1 => /lib64/libnsl.so.1 (0x7fbd22b55000)
>>        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x7fbd22818000)
>>        libz.so.1 => /usr/lib64/libz.so.1 (0x7fbd22604000)
>>        libc.so.6 => /lib64/libc.so.6 (0x7fbd222ad000)
>>        libpthread.so.0 => /lib64/libpthread.so.0 (0x7fbd22092000)
>>        /lib64/ld-linux-x86-64.so.2 (0x003053e0)
>> undefined symbol: sapi_globals  (/usr/local/lib/libphp5.so)
>> undefined symbol: executor_globals      (/usr/local/lib/libphp5.so)
>> undefined symbol: php_ini_opened_path   (/usr/local/lib/libphp5.so)
>> undefined symbol: sapi_module   (/usr/local/lib/libphp5.so)
>> undefined symbol: php_import_environment_variables
>> (/usr/local/lib/libphp5.so)
>> undefined symbol: zend_qsort    (/usr/local/lib/libphp5.so)
>> undefined symbol: module_registry       (/usr/local/lib/libphp5.so)
>> undefined symbol: php_module_shutdown_wrapper   (/usr/local/lib/libphp5.so)
>> undefined symbol: zend_error    (/usr/local/lib/libphp5.so)
>> undefined symbol: xmlwriter_module_entry        (/usr/local/lib/libphp5.so)
>> undefined symbol: libxml_module_entry   (/usr/local/lib/libphp5.so)
>> undefined symbol: dom_module_entry      (/usr/local/lib/libphp5.so)
>> undefined symbol: xmlreader_module_entry        (/usr/local/lib/libphp5.so)
>> undefined symbol: xml_module_entry      (/usr/local/lib/libphp5.so)
>>
>> Any help will be greatly appreciated.
>>
>> p
>>
>> --
> You can't mean 8.5.  Surely 8.4?
>
> --
> Thom Brown
> Registered Linux user: #516935
>

-- 
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] need help with plphp installation

2010-08-10 Thread Thom Brown
On 10 August 2010 15:33, Pete Kay  wrote:
> sorry my mistake.  It is 8.4.
>
> On Tue, Aug 10, 2010 at 10:27 PM, Thom Brown  wrote:
>> On 10 August 2010 15:21, Pete Kay  wrote:
>>> Hi,
>>>
>>> I am getting the following errors while trying to get plphp installed
>>> on postgres 8.5:
>>>
>>> ERROR:  could not load library "/usr/local/pgsql/lib/plphp.so":
>>> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
>>>
>>> ** Error **
>>>
>>> ERROR: could not load library "/usr/local/pgsql/lib/plphp.so":
>>> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals
>>> SQL state: 58P01
>>>
>>> 
>>> here is what I get with ldd command:
>>>
>>>  ldd -r /usr/local/lib/libphp5.so
>>>        linux-vdso.so.1 =>  (0x7fffa95ff000)
>>>        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x7fbd23614000)
>>>        librt.so.1 => /lib64/librt.so.1 (0x7fbd2340b000)
>>>        libresolv.so.2 => /lib64/libresolv.so.2 (0x7fbd231f5000)
>>>        libm.so.6 => /lib64/libm.so.6 (0x7fbd22f72000)
>>>        libdl.so.2 => /lib64/libdl.so.2 (0x7fbd22d6e000)
>>>        libnsl.so.1 => /lib64/libnsl.so.1 (0x7fbd22b55000)
>>>        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x7fbd22818000)
>>>        libz.so.1 => /usr/lib64/libz.so.1 (0x7fbd22604000)
>>>        libc.so.6 => /lib64/libc.so.6 (0x7fbd222ad000)
>>>        libpthread.so.0 => /lib64/libpthread.so.0 (0x7fbd22092000)
>>>        /lib64/ld-linux-x86-64.so.2 (0x003053e0)
>>> undefined symbol: sapi_globals  (/usr/local/lib/libphp5.so)
>>> undefined symbol: executor_globals      (/usr/local/lib/libphp5.so)
>>> undefined symbol: php_ini_opened_path   (/usr/local/lib/libphp5.so)
>>> undefined symbol: sapi_module   (/usr/local/lib/libphp5.so)
>>> undefined symbol: php_import_environment_variables
>>> (/usr/local/lib/libphp5.so)
>>> undefined symbol: zend_qsort    (/usr/local/lib/libphp5.so)
>>> undefined symbol: module_registry       (/usr/local/lib/libphp5.so)
>>> undefined symbol: php_module_shutdown_wrapper   (/usr/local/lib/libphp5.so)
>>> undefined symbol: zend_error    (/usr/local/lib/libphp5.so)
>>> undefined symbol: xmlwriter_module_entry        (/usr/local/lib/libphp5.so)
>>> undefined symbol: libxml_module_entry   (/usr/local/lib/libphp5.so)
>>> undefined symbol: dom_module_entry      (/usr/local/lib/libphp5.so)
>>> undefined symbol: xmlreader_module_entry        (/usr/local/lib/libphp5.so)
>>> undefined symbol: xml_module_entry      (/usr/local/lib/libphp5.so)
>>>
>>> Any help will be greatly appreciated.
>>>
>>> p
>>>
>>> --
>> You can't mean 8.5.  Surely 8.4?
>>
>> --
>> Thom Brown
>> Registered Linux user: #516935
>>
>

Which version of PHP do you have installed?  And how did you install plphp?

-- 
Thom Brown
Registered Linux user: #516935

-- 
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] need help with plphp installation

2010-08-10 Thread Alvaro Herrera
Also CC'ing the PL/php list.

Excerpts from Pete Kay's message of mar ago 10 10:21:58 -0400 2010:
> Hi,
> 
> I am getting the following errors while trying to get plphp installed
> on postgres 8.5:
> 
> ERROR:  could not load library "/usr/local/pgsql/lib/plphp.so":
> /usr/local/pgsql/lib/plphp.so: undefined symbol: sapi_globals

Hmm, how did you compile PHP? (i.e. what were the configure options?)
These symbols appear defined in my copy of the "embed" SAPI.

What platform are you on?

Are you using the latest from Github?  It contains a couple of small
fixes in the way LDFLAGS are handled for PHP.
http://github.com/commandprompt/PL-php

Also, what are you calling Postgres 8.5?  There's no such thing --
there's 8.4, and then there's 9.0 (which was called 8.5 initially, but
changed to 9.0 way before the first beta)

-- 
Álvaro Herrera 
The PostgreSQL Company - Command Prompt, Inc.
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


[GENERAL] Numeric2 - help with library

2010-08-10 Thread rsmogura
Hi,

I have a problem with running attached type numeric2 on PostgreSQL (8.4).
The file is compiled and loaded properly into database. I can create table
with this column, and store values there, but when I try to read those
values I got segmentation fault. The PostgreSQL doesn't even call method
numeric2_out. 

Method numeric2_in is called properly and result value is as I expect, but
when I set type storage to plain I didn't saw in table files (different
table space) values that can be treated as proper representation of
numeric2. I think I make a mistake in pointers or something, but I can't
find what is wrong.

Can you see at attached sources and says where the problem is. The code
worked in console application with mallocs, etc.

By the way, from those sources you can see how I see representation of
numerics without NBASE restriction in a way to store number on all
available bits.

Kind regards,
Radosław Smogura


numeric2.tar.gz
Description: application/gzip

-- 
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] Finding last checkpoint time

2010-08-10 Thread Bruce Momjian
Greg Sabino Mullane wrote:
[ There is text before PGP section. ]
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: RIPEMD160
> 
> 
> > Hmm, wouldn't have it been easier to set LC_MESSAGES to C before 
> > calling pg_controldata?
> 
> To be honest, I can't remember why that wasn't working for me when 
> I tried it some time ago. I just verified that it *will* work, 
> however, when I set LANGUAGE (LC_MESSAGES has no effect).
> 
> Specifically, LANGUAGE changes the headers of pg_controldata 
> (but not the actual output, LC_ALL does that). Thanks for the 
> nudge, I'll get to rewriting some code.

pg_upgrade does this in controldata.c for this exact reason:

/*
 * Because we test the pg_resetxlog output strings, it has to be in
 * English.
 */
if (getenv("LANG"))
lang = pg_strdup(ctx, getenv("LANG"));
#ifndef WIN32
putenv(pg_strdup(ctx, "LANG=C"));
#else
SetEnvironmentVariableA("LANG", "C");
#endif

-- 
  Bruce Momjian  http://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

-- 
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] RETURN QUERY SELECT & TYPE

2010-08-10 Thread Merlin Moncure
On Tue, Aug 10, 2010 at 2:27 AM, Pavel Stehule  wrote:
> Hello
>
> 2010/8/10 screamge :
>> Here is code of first procedure:
>> CREATE TYPE some_item AS
>> (id integer,
>> title character varying,
>> ...
>> );
>>
>>
>> CREATE OR REPLACE FUNCTION some_func (integer) RETURNS some_item AS
>> ...
>> itemid ALIAS for $1;
>> resulter some_item%rowtype;
>>
>> ...
>> SELECT INTO resulter
>> n_id, t_title FROM some_table WHERE n_id = itemid;
>> RETURN resulter;
>>
>>
>> I want to call some_func from another procedure and get result set of
>> some_items type. Something like this:
>>
>> CREATE OR REPLACE FUNCTION other_func (integer) RETURNS SETOF some_item AS
>> ...
>> RETURN QUERY SELECT some_func(id) FROM another_table;
>> ;
>
> hmm .. the I see it. PostgreSQL expect list of scalar values, but you
> are return a composite value. Pg does packing to composite type
> automatically. What you can do. Unpack a composite before (with
> subselect as protection to duplicate func call):
>
> RETURN QUERY SELECT (some_func).* FROM (SELECT some_func(id) FROM
> another_table) xx;

right -- when you have only a single composite type going out of the
function, postgres assumes you are returning its fields, not the type
itself.  This also affects how you will access the results of the
function in the calling query.  In non 'set returning' functions it's
not as noticeable if you are using variable assignment to set
composite memebers.

If you wanted to force a composite type return from a function (note:
I use composite types and have never had a reason to do this) you
could wrap the type to do it:

create table foo(foo_id) int;
create type foowrap(foo foo);
create function get_foo() returns setof foowrap as
$$
  begin
return query select row(1)::foo;
  end;
$$ language plpgsql;

postgres=# select * from get_foo();
 foo
-
 (1)
(1 row)

A more direct way to do this is to declare the function without the
wrap and simply don't use 'select *':
create function get_foo() returns setof foo as
$$
  begin
return query select 1;
  end;
$$ language plpgsql;

postgres=# select get_foo();
 get_foo
-
 (1)
(1 row)

postgres=# select * from get_foo();
 foo_id

  1
(1 row)

merlin

-- 
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] Finding last checkpoint time

2010-08-10 Thread Tom Lane
Bruce Momjian  writes:
> Greg Sabino Mullane wrote:
>> Specifically, LANGUAGE changes the headers of pg_controldata 
>> (but not the actual output, LC_ALL does that). Thanks for the 
>> nudge, I'll get to rewriting some code.

> pg_upgrade does this in controldata.c for this exact reason:

>   /*
>* Because we test the pg_resetxlog output strings, it has to be in
>* English.
>*/
>   if (getenv("LANG"))
>   lang = pg_strdup(ctx, getenv("LANG"));
>   #ifndef WIN32
>   putenv(pg_strdup(ctx, "LANG=C"));
>   #else
>   SetEnvironmentVariableA("LANG", "C");
>   #endif

You do realize that's far from bulletproof?  To be sure that that does
anything, you'd need to set (or unset) LC_ALL and LC_MESSAGES as well.
And I thought Windows spelled it LANGUAGE not LANG ...

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] MySQL versus Postgres

2010-08-10 Thread Jacqui Caren-home

Randal L. Schwartz wrote:

Do not overemphasize the example mode at the cost of presenting concepts
or structure.  You need all three.


Hmm I recently had to find out the various options to get values from a tuple
via SPI - referred by docs to the contrib examples :-(
Docs did not help and the examples only cover very basic cases.
I found the quickest way to find the list of macro's available was to read the 
source code :-)

I suppose the source is the final layer of documentation!

Jacqui



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


[GENERAL] fork() and dynamically loaded c functions....

2010-08-10 Thread Jay Flattery
Hi there,

I have some functions written in C that are dynamically loaded. I persist some 
state between function calls, initialised by _PG_init. This works fine

I now fork() a process in _PG_Init() (both processes interact), but when I 
shutdown postgre I get: LOG:  failed to find proc 0x1331110 in ProcArray
Basically the child process stays alive after postgre exists (as verified by ps 
-A)

I was thinking that I could use  _PG_fini for the cleanup, but the manual says 
that it "will only be called during an unload of the file, not during process 
termination."

Is there any way to either a) insert some cleanup code when the server shuts 
down; or b) instruct postgres to kill the child process?

Thanks!



  


-- 
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] pgtune

2010-08-10 Thread Vibhor Kumar

On Aug 9, 2010, at 11:40 AM, tuanhoanganh wrote:

> What is the name of DW in --type=DW
> Sorry for my English.
> 

DW: Data Warehouse



> Tuan Hoang Anh
> 
> On Mon, Aug 9, 2010 at 6:21 PM, Amitabh Kant  wrote:
> 2010/8/9 Sim Zacks 
> 
> 
> 
> I just found out about pgtune and am trying it out on my server.
> 
> 
> I have 2.5 questions:
> 
> 1) Are these settings the maximum that the server will handle, if it is
> strictly dedicated to postgresql? Meaning if I am running other stuff on
> the server as well, this would be a bad idea.
> 
> 
> 1a) If I have some intense plpython stored procedures, do they run in
> the postgresql memory space (ie using the memory settings from the
> postgresql.conf, or do they run under their own memory space and then I
> would have to take that into account when allocating postgresql memory?
> 
> 
> 2) If it sets my max_connections to 80 and would like to set it at 300,
> what would be the appropriate setting to lower at its expense?
> 
> 
> Sim
> 
> Look at the options available in pgtune
> 
> 
>   -M TOTALMEMORY, --memory=TOTALMEMORY
> Total system memory, will attempt to detect if
> unspecified
>   -T DBTYPE, --type=DBTYPE
> Database type, defaults to Mixed, valid options are
> DW, OLTP, Web, Mixed, Desktop
>   -c CONNECTIONS, --connections=CONNECTIONS
> Maximum number of expected connections, default
> depends on database type
> 
> For question 1, you can set the type of server you want. For question 2, you 
> can pass the -c parameter and it would adjust the other parameters. Not sure 
> of 1a though.
> 
> 
> Amitabh Kant
>  
> 

--Regards,
Vibhor
-- 
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] pgtune

2010-08-10 Thread Greg Smith

Sim Zacks wrote:

1) Are these settings the maximum that the server will handle, if it is
strictly dedicated to postgresql? Meaning if I am running other stuff on
the server as well, this would be a bad idea.
  


The idea is that they will be in the right general range for a system 
running nothing but PostgreSQL.  The current code goes a little far in 
that regard; I've gotten some reports that its setting for work_mem in 
particular is a bit too high for some people.  If the amount of memory 
you'd like to set aside for PostgreSQL use is smaller than the "all of 
the RAM in the server" it defaults to, just pass it "-M " with a 
smaller setting.  For example, if the server has 8GB of RAM, but you 
only want half to be considered usable by the server, you could add "-M 
4294967296".  Note that the server doesn't enforce a hard limit here and 
pgtune will give you high settings for everything, by design.



1a) If I have some intense plpython stored procedures, do they run in
the postgresql memory space (ie using the memory settings from the
postgresql.conf, or do they run under their own memory space and then I
would have to take that into account when allocating postgresql memory?
  


Most of the memory settings set in the postgresql.conf impact shared 
memory uses only by the server.  The main client side setting is 
work_mem, which isn't directly involved in allocating memory; it's only 
a rough guide to how much memory clients should use for operations like 
sorting and hashing.  If your stored procedure uses a bunch of memory, 
that's being allocated by the client running it, with no reference to 
any server side setting.



2) If it sets my max_connections to 80 and would like to set it at 300,
what would be the appropriate setting to lower at its expense?
  


Set "-c 300" when you run pgtune and it will do the right thing here.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
g...@2ndquadrant.com   www.2ndQuadrant.us


--
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] fork() and dynamically loaded c functions....

2010-08-10 Thread Tom Lane
Jay Flattery  writes:
> I have some functions written in C that are dynamically loaded. I persist 
> some 
> state between function calls, initialised by _PG_init. This works fine

OK...

> I now fork() a process in _PG_Init() (both processes interact), but when I 
> shutdown postgre I get: LOG:  failed to find proc 0x1331110 in ProcArray

What exactly is that child process doing?  It sure sounds like it thinks
it's a valid backend.

You can fork something if you like, but it had absolutely better not
touch any part of shared memory afterwards.

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] Read Committed Transaction Isolation and SELECT ... UNION ... SELECT

2010-08-10 Thread Eric Ridge
I think I've been studying the documentation too long and have thought
myself into a circle.

http://www.postgresql.org/docs/8.4/static/transaction-iso.html says:

"Also note that two successive SELECT commands can see different data,
even though they are within a single transaction, if other
transactions commit changes during execution of the first SELECT."

I get that what that means in normal cases, but what about a single
query comprised of one or more unions:

  SELECT ... FROM foo WHERE ...
UNION
  SELECT  ... FROM foo WHERE ...

Since the above is one query issued by the client, are the two SELECT
statements still operating within the same snapshot?  Is the above
considered to be one command?

I think the answer to those questions is "Yes", but I'd appreciate
some clarification.

Thanks in advance!

eric

-- 
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] Read Committed Transaction Isolation and SELECT ... UNION ... SELECT

2010-08-10 Thread Tom Lane
Eric Ridge  writes:
> http://www.postgresql.org/docs/8.4/static/transaction-iso.html says:

> "Also note that two successive SELECT commands can see different data,
> even though they are within a single transaction, if other
> transactions commit changes during execution of the first SELECT."

> I get that what that means in normal cases, but what about a single
> query comprised of one or more unions:

>   SELECT ... FROM foo WHERE ...
> UNION
>   SELECT  ... FROM foo WHERE ...

That's just one SELECT command.  Sub-SELECTs inside a query don't
count as separate commands for this purpose; the use of SELECT in
that way is just an artifact of the SQL grammar.

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] pl/pgsql editor and postgres developemnt tool

2010-08-10 Thread Raymond O'Donnell
On 10/08/2010 13:54, atul.g...@globaldatapoint.com wrote:
> Hi Ray,
> 
> Thanks for reply. Are you using any editor for code formatting?

I use the query editor in PgAdmin, and it works fine for me - syntax
highlighting, auto-indent, keyboard shortcuts for indentation and block
commenting, etc etc.

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie

-- 
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] Read Committed Transaction Isolation and SELECT ... UNION ... SELECT

2010-08-10 Thread Eric Ridge
On Tue, Aug 10, 2010 at 6:46 PM, Tom Lane  wrote:
>
> That's just one SELECT command.  Sub-SELECTs inside a query don't
> count as separate commands for this purpose; the use of SELECT in
> that way is just an artifact of the SQL grammar.

Thanks.  That's what I figured, but wanted to make sure.

eric

-- 
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] fork() and dynamically loaded c functions....

2010-08-10 Thread Jay Flattery
Thanks for your reply


>> I now fork() a process in _PG_Init() (both processes interact), but when I 
>> shutdown postgre I get: LOG:  failed to find proc 0x1331110 in ProcArray

>What exactly is that child process doing?  It sure sounds like it thinks
>it's a valid backend.

Actually it's not doing anything, as I'm just trying to work it all out - just 
a 

bunch of printfs and waits.
But the library is a PG_MAGIC_MODULE.

I tried killing it with pg_terminate_backend(pid) - but I get WARNING:   PID 
1166738497 is not a PostgreSQL server process. (Interestingly the  child 
pid=28629, which was printed in the line before)

>You can fork something if you like, but it had absolutely better not
>touch any part of shared memory afterwards.

Sure - it is intended to run independently.

Is there an internal pfork() or something similar I should use instead?



  


-- 
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] fork() and dynamically loaded c functions....

2010-08-10 Thread Tom Lane
Jay Flattery  writes:
>> What exactly is that child process doing?  It sure sounds like it thinks
>> it's a valid backend.

> Actually it's not doing anything, as I'm just trying to work it all out - 
> just a 

> bunch of printfs and waits.
> But the library is a PG_MAGIC_MODULE.

> I tried killing it with pg_terminate_backend(pid) - but I get WARNING:   PID 
> 1166738497 is not a PostgreSQL server process. (Interestingly the  child 
> pid=28629, which was printed in the line before)

The forked process still thinks it's a backend, so when you try to kill
it it's going to try to disconnect from shared memory.  This is bad,
since the parent still thinks the same thing, but the child will have
zapped the parent's entries in shared memory.

Offhand the only clean way I can see to launch a child process is to
fork *and exec something*.  There is way too much state lying around
in a backend process that could rise up to bite you if you don't.
You might find that doing on_exit_reset() in the child would fix the
worst problems, but it still sounds chancy as heck.

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] MySQL versus Postgres

2010-08-10 Thread Greg Smith

சிவகுமார் மா wrote:

1. Almost all webhosting providers have MySQL support, but PostgreSQL
support is available from only a few who also have MySQL support.
Hence MySQL is universal and PostgreSQL is present as also available.
  


http://www.postgresql.org/support/professional_hosting lists far more 
than "a few".  I think the only real area to complain about here is that 
there are definitely multiple sources for free small-scale MySQL 
hosting, but none I'm aware of for PostgreSQL.  I'm not sure what anyone 
here can do about that though.



a. Documentation is already available (PostgreSQL User Manual,
PostgreSQL Technical Documentation). Re-package them and publish as
books targeting different user levels.
  


Fultus already sells printed copies of the documentation.  They're not 
very popular.  Given that the trend everywhere is toward e-books, and 
you can get a free PostgreSQL manual in PDF form already, I'm not sure 
who exactly would be served by repackaging them in any way.  What's 
needed here is completely new content.



b. Cook Books can be created from the discussions in this mailing list.
  


We've already been doing that on the -performance list successfully; a 
good portion of things people used to get individual responses to now 
can be directed toward an article from 
http://wiki.postgresql.org/wiki/Performance_Optimization instead.


The problem is that few discussions happen on these lists for things 
like "how do I get used to PostgreSQL after growing up on MySQL?"  And 
that material will never be appropriate for the PostgreSQL 
documentation.  I would highly encourage people to migrate their own 
personal notes on such things to the very under-maintained section at 
http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#MySQL



3. The default configuration settings for PostgreSQL are not optimal
for performance. Can there be a recommended configuration file in the
installation (assuming certain amount of RAM and processor type) ?
  


This doesn't work because there are many different types of database 
applications, and what's optimal even as a starting configuration for 
each type is very different.  Also, hardware changes pretty fast; you'd 
be hard pressed to write down useful generic recommendations (or insert 
them into the core database code) that are still relevant at all after a 
release has been out a few years.


--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
g...@2ndquadrant.com   www.2ndQuadrant.us


--
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] InitDB: Bad system call

2010-08-10 Thread Greg Smith

Torsten Zühlsdorff wrote:

selecting default max_connections ... Bad system call (core dumped)
Bad system call (core dumped)
Bad system call (core dumped)
Bad system call (core dumped)
Bad system call (core dumped)
Bad system call (core dumped)
10
selecting default shared_buffers ... Bad system call (core dumped)
Bad system call (core dumped) ...


What it's doing in this part is trying to start the server process in a 
special testing mode, starting with large values for the settings that 
impact shared memory, then stepping down the sizes until that works.  
That's why there are so many of these.  But it looks like none of them 
actually work.


Have you tried running the initdb with strace or truss?  That might give 
you a clue as to exactly what system call is failing.  Your jail isn't 
allowing something fundamental here, but it's hard to guess what.


--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
g...@2ndquadrant.com   www.2ndQuadrant.us


--
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] InitDB: Bad system call

2010-08-10 Thread Tom Lane
Greg Smith  writes:
> Torsten Zühlsdorff wrote:
>> Bad system call (core dumped)

> Have you tried running the initdb with strace or truss?  That might give 
> you a clue as to exactly what system call is failing.  Your jail isn't 
> allowing something fundamental here, but it's hard to guess what.

Or even easier, gdb the core file ...

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] fork() and dynamically loaded c functions....

2010-08-10 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar ago 10 19:49:18 -0400 2010:

> Offhand the only clean way I can see to launch a child process is to
> fork *and exec something*.

You probably should close any open file descriptors too, just to be
safe.  (Or do we set FD_CLOEXEC on them?)

-- 
Álvaro Herrera 
The PostgreSQL Company - Command Prompt, Inc.
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] fork() and dynamically loaded c functions....

2010-08-10 Thread Tom Lane
Alvaro Herrera  writes:
> You probably should close any open file descriptors too, just to be
> safe.  (Or do we set FD_CLOEXEC on them?)

We don't.  It'd take an extra syscall per open(), which seems like rather
a lot of overhead to deal with a case we aren't even trying to support.

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] Is there a way to bypass sql?

2010-08-10 Thread Samantha Atkins

On Aug 9, 2010, at 11:57 AM, Merlin Moncure wrote:

> On Mon, Aug 9, 2010 at 2:39 PM, samantha  wrote:
>> I have been digging into NoSQL of late.  For navigational queries it would
>> be great if there was a way to bypass SQL and directly pull from an
>> identifier for a record or arbitrary byte stream.  Does postgresql directly
>> support such ability?   What is the closest that you could come?
> 
> You can get pretty close, depending on how you define 'bypass'.  For
> example, it is possible to send rich data structures back and forth
> between the client and the server without constructing a SQL text
> string.  Those structures still have to be strongly typed in the
> server unless you want to stuff everything into a bytea (which btw I
> think is a terrible idea for most cases).  Could you describe in more
> detail what you'd like to do and what (if any) inefficiencies or
> restrictions SQL is imposing that you would like to bypass?

In many OO projects the majority of the work on persistent objects is 
navigational and inserts with relatively few updates.  Queries are usually 
mainly for initial working set in many such systems and little else.  When 
retrieving an object given a persistent oid it would be better if I didn't need 
to go through even a prepared statement and especially it would be better if I 
did not need to translate column values or do subqueries to either construct my 
OO language object or construct my OO cache entry.   One thought is that I 
could in many cases store the cache entry format directly in a KV store and 
save a bit.  

There is also the interesting case of dynamic OO languages where technically 
the object fields do not have a defined type to start with.  

- samantha


-- 
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] Is there a way to bypass sql?

2010-08-10 Thread John R Pierce

 On 08/10/10 10:31 PM, Samantha Atkins wrote:
In many OO projects the majority of the work on persistent objects is 
navigational and inserts with relatively few updates. Queries are 
usually mainly for initial working set in many such systems and little 
else. When retrieving an object given a persistent oid it would be 
better if I didn't need to go through even a prepared statement and 
especially it would be better if I did not need to translate column 
values or do subqueries to either construct my OO language object or 
construct my OO cache entry. One thought is that I could in many cases 
store the cache entry format directly in a KV store and save a bit.


or just dump your data in a flatfile, in ASN.1 or XML or something.   
sheesh.






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


[GENERAL] deadlock

2010-08-10 Thread John R Pierce
 We've got an app, I don't know all the details of the schema offhand, 
but its using date partitioned tables, its heavily multithreaded and 
processing continuous events...   Under load, production (overseas) is 
getting a SQL deadlock...


   Process 20333: DROP table data_details_20100718
   Process 20333 waits for AccessExclusiveLock on relation 29609 of
   database 16384; blocked by process 20307.

   Process 20307: select * from data_daily where f1 =$1 and f2=$2 and
   f3=$3 and f4=$4 and ...
   Process 20307 waits for AccessShareLock on relation 28523 of
   database 16384; blocked by process 20333.



I'm -assuming- that the table being dropped is a partition of the other 
table.   I've asked the developers (my coworkers) to confirm, and for 
any details of how they are doing the partitions.



does anyone have any suggestions for what to look for, or what sort of 
common partition management mistakes in the application could lead to 
this sort of deadlock?




--
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] InitDB: Bad system call

2010-08-10 Thread Torsten Zühlsdorff

Hi Tom,


Bad system call (core dumped)


Have you tried running the initdb with strace or truss?  That might give 
you a clue as to exactly what system call is failing.  Your jail isn't 
allowing something fundamental here, but it's hard to guess what.


Or even easier, gdb the core file ...


As written early i can't locate the core file. But now i use truss:
$ truss -o /tmp/pg.truss /usr/local/bin/initdb /usr/local/pgsql/

Here is the result:
http://www.dddbl.de/pg.truss.txt

The first suspicious i can see are a lots of "ERR#32 'Broken pipe'" entries.

I also changed some ipc-values from:
kern.ipc.semmni=512
kern.ipc.semmns=1024
kern.ipc.semmnu=512

to:
kern.ipc.semmnu: 4096
kern.ipc.semmns: 8192
kern.ipc.semmni: 32767

But these are read-only values. I have to reboot the machine. But it's a 
live-machine and it will take some time to prepare rebooting. -.-


Greetings from Germany,
Torsten

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