[GENERAL] psql core dump

2011-06-13 Thread Zhidong She
Hi Guys,

I downloaded a 9.0.4 binary from EnterpriseDB:
http://www.enterprisedb.com/postgresql-904-installers-linux64
After several tires, it seems the psql client is very easy to core dump.

See attached the core dump information.

Is it a known psql issue? or it just related to EnterpriseDB package?

Many thanks.

Br,
Zhidong
[root@ucs34 data]# /opt/PostgreSQL/9.0/bin/psql -U postgres
psql (9.0.4)
Type help for help.

postgres=# \l
*** glibc detected *** /opt/PostgreSQL/9.0/bin/psql: realloc(): invalid next 
size: 0x1df011b0 ***
=== Backtrace: =
/lib64/libc.so.6[0x34cea748f4]
/lib64/libc.so.6(realloc+0x102)[0x34cea753e2]
/opt/PostgreSQL/9.0/lib/libpq.so.5(enlargePQExpBuffer+0x66)[0x2ad86286a366]
/opt/PostgreSQL/9.0/lib/libpq.so.5(appendPQExpBuffer+0xdb)[0x2ad86286a56b]
/opt/PostgreSQL/9.0/bin/psql[0x417f35]
/opt/PostgreSQL/9.0/bin/psql[0x405e17]
/opt/PostgreSQL/9.0/bin/psql[0x40dae8]
/opt/PostgreSQL/9.0/bin/psql[0x40fa7e]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x34cea1d994]
/opt/PostgreSQL/9.0/bin/psql[0x403a69]
=== Memory map: 
0040-00456000 r-xp  08:01 92438705   
/opt/PostgreSQL/9.0/bin/psql
00655000-00656000 rw-p 00055000 08:01 92438705   
/opt/PostgreSQL/9.0/bin/psql
00656000-00657000 rw-p 00656000 00:00 0 
1dee8000-1df09000 rw-p 1dee8000 00:00 0  [heap]
3485e0-3485e03000 r-xp  08:01 92440290   
/opt/PostgreSQL/9.0/lib/libtermcap.so.2
3485e03000-3486002000 ---p 3000 08:01 92440290   
/opt/PostgreSQL/9.0/lib/libtermcap.so.2
3486002000-3486003000 rw-p 2000 08:01 92440290   
/opt/PostgreSQL/9.0/lib/libtermcap.so.2
34ce60-34ce61c000 r-xp  08:01 118620183  
/lib64/ld-2.5.so
34ce81b000-34ce81c000 r--p 0001b000 08:01 118620183  
/lib64/ld-2.5.so
34ce81c000-34ce81d000 rw-p 0001c000 08:01 118620183  
/lib64/ld-2.5.so
34cea0-34ceb4e000 r-xp  08:01 118620185  
/lib64/libc-2.5.so
34ceb4e000-34ced4e000 ---p 0014e000 08:01 118620185  
/lib64/libc-2.5.so
34ced4e000-34ced52000 r--p 0014e000 08:01 118620185  
/lib64/libc-2.5.so
34ced52000-34ced53000 rw-p 00152000 08:01 118620185  
/lib64/libc-2.5.so
34ced53000-34ced58000 rw-p 34ced53000 00:00 0 
34cee0-34cee82000 r-xp  08:01 118620233  
/lib64/libm-2.5.so
34cee82000-34cf081000 ---p 00082000 08:01 118620233  
/lib64/libm-2.5.so
34cf081000-34cf082000 r--p 00081000 08:01 118620233  
/lib64/libm-2.5.so
34cf082000-34cf083000 rw-p 00082000 08:01 118620233  
/lib64/libm-2.5.so
34cf20-34cf202000 r-xp  08:01 118620229  
/lib64/libdl-2.5.so
34cf202000-34cf402000 ---p 2000 08:01 118620229  
/lib64/libdl-2.5.so
34cf402000-34cf403000 r--p 2000 08:01 118620229  
/lib64/libdl-2.5.so
34cf403000-34cf404000 rw-p 3000 08:01 118620229  
/lib64/libdl-2.5.so
34cf60-34cf616000 r-xp  08:01 118620221  
/lib64/libpthread-2.5.so
34cf616000-34cf815000 ---p 00016000 08:01 118620221  
/lib64/libpthread-2.5.so
34cf815000-34cf816000 r--p 00015000 08:01 118620221  
/lib64/libpthread-2.5.so
34cf816000-34cf817000 rw-p 00016000 08:01 118620221  
/lib64/libpthread-2.5.so
34cf817000-34cf81b000 rw-p 34cf817000 00:00 0 
34cfe0-34cfe14000 r-xp  08:01 122500555  
/usr/lib64/libz.so.1.2.3
34cfe14000-34d0013000 ---p 00014000 08:01 122500555  
/usr/lib64/libz.so.1.2.3
34d0013000-34d0014000 rw-p 00013000 08:01 122500555  
/usr/lib64/libz.so.1.2.3
34d680-34d6815000 r-xp  08:01 118620362  
/lib64/libselinux.so.1
34d6815000-34d6a15000 ---p 00015000 08:01 118620362  
/lib64/libselinux.so.1
34d6a15000-34d6a17000 rw-p 00015000 08:01 118620362  
/lib64/libselinux.so.1
34d6a17000-34d6a18000 rw-p 34d6a17000 00:00 0 
34d6c0-34d6c3b000 r-xp  08:01 118620355  
/lib64/libsepol.so.1
34d6c3b000-34d6e3b000 ---p 0003b000 08:01 118620355  
/lib64/libsepol.so.1
34d6e3b000-34d6e3c000 rw-p 0003b000 08:01 118620355  
/lib64/libsepol.so.1
34d6e3c000-34d6e46000 rw-p 34d6e3c000 00:00 0 
34d840-34d8419000 r-xp  08:01 118620460  
/lib64/libaudit.so.0.0.0
34d8419000-34d8618000 ---p 00019000 08:01 118620460  
/lib64/libaudit.so.0.0.0
34d8618000-34d861a000 rw-p 00018000 08:01 118620460  
/lib64/libaudit.so.0.0.0
34d8c0-34d8c02000 r-xp  08:01 118620335  
/lib64/libkeyutils-1.2.so

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-13 Thread Craig Ringer
On 13/06/11 09:27, Merlin Moncure wrote:

 want to use the binary protocol mode (especially for postgres versions
 that don't support hex mode)

Allowing myself to get a wee bit sidetracked:

I've been wondering lately why hex was chosen as the new input/output
format when the bytea_output change went in. The Base64 encoding is
trivial to implement, already supported by standard libraries for many
languages and add-ons for the rest, fast to encode/decode, and much more
compact than a hex encoding, so it seems like a more attractive option.
PostgreSQL already supports base64 in explicit 'escape()' calls.

Was concern about input format ambiguity a motivator for avoiding
base64? Checking the archives:

http://archives.postgresql.org/pgsql-hackers/2009-05/msg00238.php
http://archives.postgresql.org/pgsql-hackers/2009-05/msg00192.php

... it was considered but knocked back because it's enough more complex
to encode that it could matter on big dumps and standards-compliant
base64 appears to require newlines - something that was viewed as ugly
and problematic. Initial input format detection reliability options were
also raised, but as the same solution used for hex input would apply to
base64 input too it doesn't look like that was a big factor.

Personally, even with the newline 'ick factor' I think it'd be pretty
nice to have as an option for dumps and COPY.

Ascii85 (base85) would be another alternative. It's used in PostScript
and PDF, but isn't anywhere near as widespread as base64. It's still
trivial to implement and is 7-8% more space-efficient than base64.

After a bit of digging, though, I can't help wonder if a binary dump
format that's machine-representation independent, fast and compact isn't
more practical. Tools like Thrift (http://thrift.apache.org), Protocol
Buffers, etc might make it less painful. Maybe an interesting GsOC
project? Supporting binary COPY with a machine independent format would
be a natural extension of that, too.

--
Craig Ringer

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


Re: [GENERAL] Reinstalling

2011-06-13 Thread Craig Ringer
On 13/06/11 05:59, Щепкин Александр wrote:
 Hello, I have a database with which I was running Windows XP (version of 
 PostgreSQL 8.3). After reinstalling the system on Windows 7 I'm having 
 problems, even though you are installing on the same postgresql 8.3. Is it 
 possible to connect to the old database to the new operating system and how 
 to do it.

Did you make a backup of your database?

When you reinstalled windows, did you erase your system and install
fresh? Or upgrade?

If you upgraded, did you uninstall PostgreSQL? Or leave it installed?

--
Craig Ringer


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


Re: [GENERAL] setting up streaming error. Please help

2011-06-13 Thread akp geek
Thanks Tom .

When I did Is there any that I can run some commands to point it
to *libpq.so.5.
  I have  LD_LIBRARY_PATH =/opt/postgres/9.0.2/lib. still it is pointing to
** /usr/lib  .. Any suggestions? *

*ldd libpqwalreceiver.so*

 * libpq.so.4 =/usr/lib/libpq.so.4*
*libgcc_s.so.1 = /usr/sfw/lib/libgcc_s.so.1*
*libssl.so.0.9.7 =   /usr/sfw/lib/libssl.so.0.9.7*
*libcrypto.so.0.9.7 =/usr/sfw/lib/libcrypto.so.0.9.7*
*libresolv.so.2 =/usr/lib/libresolv.so.2*
*libsocket.so.1 =/usr/lib/libsocket.so.1*
*libnsl.so.1 =   /usr/lib/libnsl.so.1*
*libpthread.so.1 =   /usr/lib/libpthread.so.1*
*libc.so.1 = /lib/libc.so.1*
*libmp.so.2 =/lib/libmp.so.2*
*libmd.so.1 =/lib/libmd.so.1*
*libscf.so.1 =   /lib/libscf.so.1*
*libdoor.so.1 =  /lib/libdoor.so.1*
*libuutil.so.1 = /lib/libuutil.so.1*
*libgen.so.1 =   /lib/libgen.so.1*
*libssl_extra.so.0.9.7 = /usr/sfw/lib/libssl_extra.so.0.9.7
*
*libcrypto_extra.so.0.9.7 =
 /usr/sfw/lib/libcrypto_extra.so.0.9.7*
*libm.so.2 = /lib/libm.so.2*
*/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1*


Appreciate your help

Regards

On Sat, Jun 11, 2011 at 12:25 PM, Tom Lane t...@sss.pgh.pa.us wrote:

 akp geek akpg...@gmail.com writes:
   After making the required changes to the Primary and slave , I
 have
  restarted the slave and I keep seeing the following in the logs.

  *FATAL:  could not connect to the primary server: invalid connection
 option
  replication*

 That message has to be caused by libpq, because the string 'invalid
 connection option' occurs nowhere else in PG.  I am guessing that you
 have an 8.4 or older libpq.so that walreceiver.so is somehow linking to.
 I don't know what Solaris' equivalent of LD_LIBRARY_PATH is, but I'd be
 looking into that angle if I were you.

regards, tom lane



[GENERAL] determine client os

2011-06-13 Thread Sim Zacks
I didn't see a function for this, but is there a way in a postgresql 
query to determine the client OS?




Thanks

Sim



--
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] determine client os

2011-06-13 Thread Pavel Stehule
Hello

There is no special function.

you can parse some info from version() function.

Regards

Pavel Stehule

2011/6/13 Sim Zacks s...@compulab.co.il:
 I didn't see a function for this, but is there a way in a postgresql query
 to determine the client OS?



 Thanks

 Sim



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


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


[GENERAL] Re: Can't drop temp table in subfunction during cursor loop (being used by active queries)

2011-06-13 Thread jonathansfl
please explain, as I have no idea what that means. thank you for your reply!!

--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Can-t-drop-temp-table-in-subfunction-during-cursor-loop-being-used-by-active-queries-tp4482806p4484134.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

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


Re: [GENERAL] determine client os

2011-06-13 Thread Craig Ringer

On 06/13/2011 08:21 PM, Pavel Stehule wrote:

Hello

There is no special function.

you can parse some info from version() function.


Yep, or you can use a PL/Python, PL/Perl or PL/Java function that makes 
the appropriate calls in that language. Any of these will probably 
require the use of the untrusted (superuser-only) version.


--
Craig Ringer

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


Re: [GENERAL] determine client os

2011-06-13 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


 Yep, or you can use a PL/Python, PL/Perl or PL/Java function that makes 
 the appropriate calls in that language. Any of these will probably 
 require the use of the untrusted (superuser-only) version.

Nope, you can do this easily in trusted perl:

CREATE OR REPLACE FUNCTION findos()
RETURNS TEXT
LANGUAGE plperl
AS $$
return $^O;
$$;

SELECT findos();

 findos 
- 
 linux


- -- 
Greg Sabino Mullane g...@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201106130831
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAk32AykACgkQvJuQZxSWSsjA4ACfTAqEYCuNEBgbPizAsZ0CJVlI
TmAAnA73swdgs9eP252umOr+LE5SfNuw
=y07O
-END PGP SIGNATURE-



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


Re: [GENERAL] determine client os

2011-06-13 Thread hubert depesz lubaczewski
On Mon, Jun 13, 2011 at 12:31:57PM -, Greg Sabino Mullane wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: RIPEMD160
 
 
  Yep, or you can use a PL/Python, PL/Perl or PL/Java function that makes 
  the appropriate calls in that language. Any of these will probably 
  require the use of the untrusted (superuser-only) version.
 
 Nope, you can do this easily in trusted perl:
 
 CREATE OR REPLACE FUNCTION findos()
 RETURNS TEXT
 LANGUAGE plperl
 AS $$
 return $^O;
 $$;
 
 SELECT findos();
 
  findos 
 - 
  linux

Please note that it will return os for *server*, and not *client*.

Best regards,

depesz


-- 
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] Tweaking bytea / large object block sizes?

2011-06-13 Thread Merlin Moncure
On Mon, Jun 13, 2011 at 1:58 AM, Craig Ringer
cr...@postnewspapers.com.au wrote:
 On 13/06/11 09:27, Merlin Moncure wrote:

 want to use the binary protocol mode (especially for postgres versions
 that don't support hex mode)

 Allowing myself to get a wee bit sidetracked:

 I've been wondering lately why hex was chosen as the new input/output
 format when the bytea_output change went in. The Base64 encoding is
 trivial to implement, already supported by standard libraries for many
 languages and add-ons for the rest, fast to encode/decode, and much more
 compact than a hex encoding, so it seems like a more attractive option.
 PostgreSQL already supports base64 in explicit 'escape()' calls.

yeah -- I remember the discussion.  I think the bottom line is that
hex is just simpler all around.  This conveys a number of small
advantages that, when added up, outweigh the slightly better space
efficiency.

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] setting up streaming error. Please help

2011-06-13 Thread Tom Lane
akp geek akpg...@gmail.com writes:
 *ldd libpqwalreceiver.so*

  * libpq.so.4 =/usr/lib/libpq.so.4*

Looks like you need to recompile, for starters.  libpq.so.4 would be 8.1
or even older.

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] determine client os

2011-06-13 Thread Craig Ringer

On 06/13/2011 08:35 PM, hubert depesz lubaczewski wrote:


Please note that it will return os for *server*, and not *client*.


Argh, thankyou. I misread the question. Please disregard my suggestion.

--
Craig Ringer

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


[GENERAL] Re: Can't drop temp table in subfunction during cursor loop (being used by active queries)

2011-06-13 Thread jonathansfl
How would I create a dynamic table name, using the loop increment as a
parameter?

DROP TABLE IF EXISTS tt_PERSONSTODEACTIVATE || v_iteration CASCADE;

that doesn't work. don't think i can use a dynamic variable as a table name,
so i can't build the table name as a variable. perhaps if the entire DROP
TABLE is inside dynamic SQL and I execute entire script. could try that,
although it's messy for such a simple problem.

i still don't understand still why the TEMP tables are not acting TEMPORARY
and are not going away when their loop ends.

--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Can-t-drop-temp-table-in-subfunction-during-cursor-loop-being-used-by-active-queries-tp4482806p4484358.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

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


Re: [GENERAL] Re: Can't drop temp table in subfunction during cursor loop (being used by active queries)

2011-06-13 Thread Merlin Moncure
On Mon, Jun 13, 2011 at 8:35 AM, jonathansfl jonathanbrink...@yahoo.com wrote:
 How would I create a dynamic table name, using the loop increment as a
 parameter?

 DROP TABLE IF EXISTS tt_PERSONSTODEACTIVATE || v_iteration CASCADE;

 that doesn't work. don't think i can use a dynamic variable as a table name,
 so i can't build the table name as a variable. perhaps if the entire DROP
 TABLE is inside dynamic SQL and I execute entire script. could try that,
 although it's messy for such a simple problem.

 i still don't understand still why the TEMP tables are not acting TEMPORARY
 and are not going away when their loop ends.

'execute' is for that:
http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

temp tables go away when the database session exits.

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] temp tables not dropping at end of script

2011-06-13 Thread jonathansfl
we're having a similar situation, where FunctionA calls FunctionB inside a
cursor. FunctionB DROPs Temp table, then creates temp table. FunctionA runs
through the cursor fine but breaks after the last loop, unable to DROP
temporary table because it is being used by active queries in this
session.

Those sessions should have been closed after each loop!

Here is my ticket on this:
http://postgresql.1045698.n5.nabble.com/Can-t-drop-temp-table-in-subfunction-during-cursor-loop-being-used-by-active-queries-td4482806.html#a4484134

Here is another similar (and unanswered) ticket:
http://forums.enterprisedb.com/posts/list/849.page


--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/temp-tables-not-dropping-at-end-of-script-tp4286391p4484759.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

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


[GENERAL] Bad link to beta2 source

2011-06-13 Thread Bruno Wolff III
The link Download 9.1 Beta 2 source code on 
http://www.postgresql.org/developer/beta
points to http://www.postgresql.org/ftp/source/v9.1beta1 instead of
http://www.postgresql.org/ftp/source/v9.1beta2 .

-- 
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] Bad link to beta2 source

2011-06-13 Thread Magnus Hagander
On Mon, Jun 13, 2011 at 18:48, Bruno Wolff III br...@wolff.to wrote:
 The link Download 9.1 Beta 2 source code on 
 http://www.postgresql.org/developer/beta
 points to http://www.postgresql.org/ftp/source/v9.1beta1 instead of
 http://www.postgresql.org/ftp/source/v9.1beta2 .

Thanks - fixed, will be included on next site build.


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

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


[GENERAL] Having a equal (=) operator on GIN-indexable columns

2011-06-13 Thread Andreas Joseph Krogh
Hi!

I'm not sure how to write a good $subject for this , but here it goes;
I'd like to have a multi-column index on a varchar-field and a
tsvector-field. GIN only likes tsvector-fields so I'm wondering if it's
possible to create a tsvector from a text which doesn't breake the text
up in vectors, but uses the whole string as the vector instead?

Given the schema:

CREATE TABLE mytable(
id SERIAL PRIMAY KEY,
field VARCHAR NOT NULL,
tsvector_col tsvector NOT NULL
);

I'd like to form a query as follows:
SELECT id FROM mytable WHERE tsvector_col @@ to_tsquery('simple',
'andre:*') AND to_tsvector('simple', field) @@ to_tsquery('simple',
'full_text_search');

And I'd like it to be semantically equivalent of:
SELECT id FROM mytable WHERE tsvector_col LIKE 'andrea%' AND field =
'full_text_search';

But I see that 'full_text_search' is broken up (of course):
andreak=# select to_tsvector('simple', 'full_text_search');
 to_tsvector 
--
 'full':1 'search':3 'text':2

Is it a way to achieve what I'm trying here?

-- 
Andreas Joseph Krogh andr...@officenet.no
Senior Software Developer / CTO
Public key: http://home.officenet.no/~andreak/public_key.asc
+-+
OfficeNet AS| The most difficult thing in the world is to |
Rosenholmveien 25   | know how to do a thing and to watch |
1414 Trollåsen  | somebody else doing it wrong, without   |
NORWAY  | comment.|
Org.nr: NO 981 479 076  | |
| |
Tlf:+47 24 15 38 90 | |
Fax:+47 24 15 38 91 | |
Mobile: +47 909  56 963 | |
+-+


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


[GENERAL] Help with ERROR: character 0xc280 of encoding UTF8 has no equivalent in WIN1252

2011-06-13 Thread Scot Kreienkamp
Hi everyone,



I have a database that is UTF8, and a client that is connecting using
client encoding WIN1252.  There are a few records in my database that
somehow have gotten characters in them that are not viewable.  When
viewing the records from the command line using UTF8 client encoding
there are strange looking characters, and the records cause an error
when viewing under WIN1252 encoding.



I cannot modify the data, so my alternative was this query, which I
found an example for on a list that Google was kind enough to translate
from French for me:



set client_encoding to 'WIN1252' ;

SELECT soldnotesid,soldid,regexp_replace(notes, E'\u008C', ' ', 'g') as
notes,
privatenote,modified,userloginid,notetype,sourcekey,hidden,notesmodified
,notesmodifiedby,created from soldnotes where soldid'317773002' and
soldid'317771002'



However, it still errors out:  psql:sql3:7: ERROR:  character 0xc280 of
encoding UTF8 has no equivalent in WIN1252



Is there any way to mask these bad characters from the field in a
query to allow the client to work?  I'll put it in a view once I get it
working so the end users can use the view.



PG 8.3.7.



Thanks for any help you can provide.



Scot Kreienkamp






This message is intended only for the individual or entity to which it is 
addressed.  It may contain privileged, confidential information which is exempt 
from disclosure under applicable laws.  If you are not the intended recipient, 
please note that you are strictly prohibited from disseminating or distributing 
this information (other than to the intended recipient) or copying this 
information.  If you have received this communication in error, please notify 
us immediately by e-mail or by telephone at the above number. Thank you.




[GENERAL] Postgres V9.0.3 and Avahi Zeroconfig

2011-06-13 Thread Day, David
Hi,

I took a patch that was available under 8.0.4 for Avahi zeroconfig and adpted  
it to 9.0.3.
Though publication of the service type _postgresql._tcp is successful.  When I 
shutdown the
Postgres server the advertised service is not removed from  mDNS and is visible 
though not resolvable for a very long period of time ( hour ? )

Based on stepping through the modified code I do hit  the  avahi interface 
calls to clean-up.
e.g. avahi_client_free, avahi_threaded_poll_stop, avahi_threaded_poll_free

Anyone with experience using the avahi publication patch in 8.0.4 or above with 
a similar observation on stopping the server not  correctly un-publishing the 
postgres service.

e.g

avahi-browse -vrt _postgres._tcp# finds service still visible.


Thanks


Dave




[GENERAL] configure error... please help 9.0.4

2011-06-13 Thread akp geek
Dear all -

   While setting up streaming I ran into issue with libpq. To
resolve it I need to recompile the source. I am issuing the following
command . I tried this before with 9.0.2 it worked. Now when issued the same
command I was getting the errors.


./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
--with-libxml --with-openssl --with-ossp-uuid
-with-includes=/opt/postgres/software/include/readline/
LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib

./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
--with-libxml --with-openssl --with-ossp-uuid
-with-includes=/opt/postgres/software/include/readline/
LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking which template to use... solaris
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking if gcc supports -Wdeclaration-after-statement... yes
checking if gcc supports -Wendif-labels... yes
checking if gcc supports -fno-strict-aliasing... yes
checking if gcc supports -fwrapv... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... yes
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... yes
checking for xml2-config... xml2-config
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for ld used by GCC... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... no
checking for ar... ar
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for bison... /usr/sfw/bin/bison
configure: using bison (GNU Bison) 1.875
checking for flex... /opt/postgres/software/flex/bin/flex
configure: using flex 2.5.35
checking for perl... /opt/postgres/perl/bin/perl
configure: using perl 5.12.3
checking for Perl archlibexp...
/opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris
checking for Perl privlibexp... /opt/postgres/perl/lib/perl5/5.12.3
checking for Perl useshrplib... true
checking for flags to link embedded Perl...   -L/usr/local/lib
-L/opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris/CORE -lperl -lsocket
-lnsl -ldl -lm -lc
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... none required
checking for library containing socket... -lsocket
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... none required
checking for library containing fdatasync... -lrt
checking for library containing gethostbyname_r... -lnsl
checking for library containing shmget... none required
checking for -lreadline... yes (-lreadline -ltermcap)
checking for inflate in -lz... yes
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for SSL_library_init in -lssl... yes
checking for xmlSaveToBuffer in -lxml2... yes
checking for uuid_export in -lossp-uuid... no
checking for uuid_export in -luuid... no
configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID


thanks for the help

Regards


Re: [GENERAL] configure error... please help 9.0.4

2011-06-13 Thread Scott Marlowe
On Mon, Jun 13, 2011 at 3:15 PM, akp geek akpg...@gmail.com wrote:
 Dear all -
                While setting up streaming I ran into issue with libpq. To
 resolve it I need to recompile the source. I am issuing the following
 command . I tried this before with 9.0.2 it worked. Now when issued the same
 command I was getting the errors.

 ./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
 --with-libxml --with-openssl --with-ossp-uuid
 -with-includes=/opt/postgres/software/include/readline/
 LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib
 ./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
 --with-libxml --with-openssl --with-ossp-uuid
 -with-includes=/opt/postgres/software/include/readline/
 LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib
 checking build system type... sparc-sun-solaris2.10
 checking host system type... sparc-sun-solaris2.10
 checking which template to use... solaris
 checking whether to build with 64-bit integer date/time support... yes
 checking whether NLS is wanted... no
 checking for default port number... 5432
 checking for block size... 8kB
 checking for segment size... 1GB
 checking for WAL block size... 8kB
 checking for WAL segment size... 16MB
 checking for gcc... gcc
 checking for C compiler default output file name... a.out
 checking whether the C compiler works... yes
 checking whether we are cross compiling... no
 checking for suffix of executables...
 checking for suffix of object files... o
 checking whether we are using the GNU C compiler... yes
 checking whether gcc accepts -g... yes
 checking for gcc option to accept ISO C89... none needed
 checking if gcc supports -Wdeclaration-after-statement... yes
 checking if gcc supports -Wendif-labels... yes
 checking if gcc supports -fno-strict-aliasing... yes
 checking if gcc supports -fwrapv... yes
 checking whether the C compiler still works... yes
 checking how to run the C preprocessor... gcc -E
 checking allow thread-safe client libraries... yes
 checking whether to build with Tcl... no
 checking whether to build Perl modules... yes
 checking whether to build Python modules... no
 checking whether to build with GSSAPI support... no
 checking whether to build with Kerberos 5 support... no
 checking whether to build with PAM support... no
 checking whether to build with LDAP support... no
 checking whether to build with Bonjour support... no
 checking whether to build with OpenSSL support... yes
 checking for xml2-config... xml2-config
 checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
 checking for egrep... /usr/sfw/bin/ggrep -E
 checking for ld used by GCC... /usr/ccs/bin/ld
 checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
 checking for ranlib... ranlib
 checking for strip... strip
 checking whether it is possible to strip libraries... no
 checking for ar... ar
 checking for tar... /bin/tar
 checking whether ln -s works... yes
 checking for gawk... no
 checking for mawk... no
 checking for nawk... nawk
 checking for a thread-safe mkdir -p... config/install-sh -c -d
 checking for bison... /usr/sfw/bin/bison
 configure: using bison (GNU Bison) 1.875
 checking for flex... /opt/postgres/software/flex/bin/flex
 configure: using flex 2.5.35
 checking for perl... /opt/postgres/perl/bin/perl
 configure: using perl 5.12.3
 checking for Perl archlibexp...
 /opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris
 checking for Perl privlibexp... /opt/postgres/perl/lib/perl5/5.12.3
 checking for Perl useshrplib... true
 checking for flags to link embedded Perl...   -L/usr/local/lib
 -L/opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris/CORE -lperl -lsocket
 -lnsl -ldl -lm -lc
 checking for main in -lm... yes
 checking for library containing setproctitle... no
 checking for library containing dlopen... none required
 checking for library containing socket... -lsocket
 checking for library containing shl_load... no
 checking for library containing getopt_long... none required
 checking for library containing crypt... none required
 checking for library containing fdatasync... -lrt
 checking for library containing gethostbyname_r... -lnsl
 checking for library containing shmget... none required
 checking for -lreadline... yes (-lreadline -ltermcap)
 checking for inflate in -lz... yes
 checking for CRYPTO_new_ex_data in -lcrypto... yes
 checking for SSL_library_init in -lssl... yes
 checking for xmlSaveToBuffer in -lxml2... yes
 checking for uuid_export in -lossp-uuid... no
 checking for uuid_export in -luuid... no
 configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID

You likely need some -dev packages.  Since you failed to mention what
OS you're running I'll assume it's ubuntu because that's what I'm
running.  Here's my apt-get install entries I use on my machines:

sudo apt-get install libreadline-dev zlib1g-dev libxml2-dev
libxslt-dev libossp-uuid-dev bison flex python2.6-dev libgss-dev
libssl-dev libkrb5-dev

All of those might or might 

Re: [GENERAL] configure error... please help 9.0.4

2011-06-13 Thread akp geek
Sorry all -

   I am doing the work on Solaris.

Regards

On Mon, Jun 13, 2011 at 5:38 PM, Scott Marlowe scott.marl...@gmail.comwrote:

 On Mon, Jun 13, 2011 at 3:15 PM, akp geek akpg...@gmail.com wrote:
  Dear all -
 While setting up streaming I ran into issue with libpq. To
  resolve it I need to recompile the source. I am issuing the following
  command . I tried this before with 9.0.2 it worked. Now when issued the
 same
  command I was getting the errors.
 
  ./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
  --with-libxml --with-openssl --with-ossp-uuid
  -with-includes=/opt/postgres/software/include/readline/
  LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib
  ./configure --prefix=/opt/postgres/9.0.4 --with-readline --with-perl
  --with-libxml --with-openssl --with-ossp-uuid
  -with-includes=/opt/postgres/software/include/readline/
  LDFLAGS=-L/opt/postgres/software/lib:/opt/postgres/gis/lib
  checking build system type... sparc-sun-solaris2.10
  checking host system type... sparc-sun-solaris2.10
  checking which template to use... solaris
  checking whether to build with 64-bit integer date/time support... yes
  checking whether NLS is wanted... no
  checking for default port number... 5432
  checking for block size... 8kB
  checking for segment size... 1GB
  checking for WAL block size... 8kB
  checking for WAL segment size... 16MB
  checking for gcc... gcc
  checking for C compiler default output file name... a.out
  checking whether the C compiler works... yes
  checking whether we are cross compiling... no
  checking for suffix of executables...
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking if gcc supports -Wdeclaration-after-statement... yes
  checking if gcc supports -Wendif-labels... yes
  checking if gcc supports -fno-strict-aliasing... yes
  checking if gcc supports -fwrapv... yes
  checking whether the C compiler still works... yes
  checking how to run the C preprocessor... gcc -E
  checking allow thread-safe client libraries... yes
  checking whether to build with Tcl... no
  checking whether to build Perl modules... yes
  checking whether to build Python modules... no
  checking whether to build with GSSAPI support... no
  checking whether to build with Kerberos 5 support... no
  checking whether to build with PAM support... no
  checking whether to build with LDAP support... no
  checking whether to build with Bonjour support... no
  checking whether to build with OpenSSL support... yes
  checking for xml2-config... xml2-config
  checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
  checking for egrep... /usr/sfw/bin/ggrep -E
  checking for ld used by GCC... /usr/ccs/bin/ld
  checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
  checking for ranlib... ranlib
  checking for strip... strip
  checking whether it is possible to strip libraries... no
  checking for ar... ar
  checking for tar... /bin/tar
  checking whether ln -s works... yes
  checking for gawk... no
  checking for mawk... no
  checking for nawk... nawk
  checking for a thread-safe mkdir -p... config/install-sh -c -d
  checking for bison... /usr/sfw/bin/bison
  configure: using bison (GNU Bison) 1.875
  checking for flex... /opt/postgres/software/flex/bin/flex
  configure: using flex 2.5.35
  checking for perl... /opt/postgres/perl/bin/perl
  configure: using perl 5.12.3
  checking for Perl archlibexp...
  /opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris
  checking for Perl privlibexp... /opt/postgres/perl/lib/perl5/5.12.3
  checking for Perl useshrplib... true
  checking for flags to link embedded Perl...   -L/usr/local/lib
  -L/opt/postgres/perl/lib/perl5/5.12.3/sun4-solaris/CORE -lperl -lsocket
  -lnsl -ldl -lm -lc
  checking for main in -lm... yes
  checking for library containing setproctitle... no
  checking for library containing dlopen... none required
  checking for library containing socket... -lsocket
  checking for library containing shl_load... no
  checking for library containing getopt_long... none required
  checking for library containing crypt... none required
  checking for library containing fdatasync... -lrt
  checking for library containing gethostbyname_r... -lnsl
  checking for library containing shmget... none required
  checking for -lreadline... yes (-lreadline -ltermcap)
  checking for inflate in -lz... yes
  checking for CRYPTO_new_ex_data in -lcrypto... yes
  checking for SSL_library_init in -lssl... yes
  checking for xmlSaveToBuffer in -lxml2... yes
  checking for uuid_export in -lossp-uuid... no
  checking for uuid_export in -luuid... no
  configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID

 You likely need some -dev packages.  Since you failed to mention what
 OS you're running I'll assume it's ubuntu because that's what 

Re: [GENERAL] [PERFORM] change sample size for statistics

2011-06-13 Thread Willy-Bas Loos
On Fri, Jun 10, 2011 at 9:58 PM, Josh Berkus j...@agliodbs.com wrote:

 It's not 10%.  We use a fixed sample size, which is configurable on the
 system, table, or column basis.


It seems that you are referring to alter column set statistics and
default_statistics_target, which are the number of percentiles in the
histogram  (and MCV's) .
I mean the number of records that are scanned by analyze to come to the
statistics for the planner, especially n_disctict.


On Fri, Jun 10, 2011 at 10:06 PM, Nathan Boley npbo...@gmail.com wrote:

 If you need to fix ndistinct, a better approach may be to do it manually.


That would be nice, but how do i prevent the analyzer to overwrite
n_distinct without blocking the generation of new histogram values etc for
that column?

We use version 8.4 at the moment (on debian squeeze).

Cheers,

WBL
-- 
Patriotism is the conviction that your country is superior to all others
because you were born in it. -- George Bernard Shaw


Re: [GENERAL] configure error... please help 9.0.4

2011-06-13 Thread John R Pierce

On 06/13/11 3:07 PM, akp geek wrote:
   I am doing the work on Solaris. 


then you'll likely need to build ossp-uuid and reference it in your 
./configure






--
john r pierceN 37, W 122
santa cruz ca mid-left coast


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


[GENERAL] trouble shooting

2011-06-13 Thread Nabil Ictech
  
Hello,

I installed PostgreSQL 8.3, Apache andphpPgAdmin, all in one.
I had to unistall it, in order to install Open ERP. Open ERP hasto work with its own PostgreSQL 8.3,but after unistalling your package, there seem to be something thatremained in mycomputer, because the PostgreSQL 8.3 fromOpen ERP will not get installed.

Thank you,Nabil Ictech 
   

Re: [GENERAL] configure error... please help 9.0.4

2011-06-13 Thread Craig Ringer

On 06/14/2011 05:15 AM, akp geek wrote:

Dear all -

While setting up streaming I ran into issue with libpq.
To resolve it I need to recompile the source. I am issuing the following
command . I tried this before with 9.0.2 it worked. Now when issued the
same command I was getting the errors.



configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID


Examine config.log and see why the ossp-uuid testcase failed.

Do you have ossp-uuid installed? Is it on your LIBRARY_PATH and 
INCLUDE_PATH ?


--
Craig Ringer

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


Re: [GENERAL] trouble shooting

2011-06-13 Thread Craig Ringer
On 14/06/11 06:53, Nabil Ictech wrote:
   
 Hello,
  
 I installed PostgreSQL 8.3, Apache and phpPgAdmin, all in one.
 I had to unistall it, in order to install Open ERP. Open ERP has to work
 with its own PostgreSQL 8.3, but after unistalling your package, there
 seem to be something that remained in my computer, because the
 PostgreSQL 8.3 from Open ERP will not get installed.

Most likely you will need to remove your postgres user account and/or
the PostgreSQL folder in Program Files.

OpenERP should be installing PostgreSQL independently on a non-default
port using a non-default user account so that it does not conflict with
the default PostgreSQL installers. I suggest you report this issue to
them, as there is no reason you should not be able to run a regular
PostgreSQL as well as OpenERP's PostgreSQL at the same time.


On a side note, I think it'd be great if the Pg (un)installer for
Windows had a clean uninstall that stripped all this stuff, or a
separate clean system utility. I know deleting the account(s) breaks
PgAdmin III etc, but it's clearly a need for many Windows users.

--
Craig Ringer

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


Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

2011-06-13 Thread Vikram A
Dear Mr. Craig Ringer,
Thank you for your response. 
I would like to crypt certain sensitive information in my applications such as 
Student register number, their marks, results etc. For this reason i done a 
study for doing encryption. Where I found that this PGP will help 
the encryption/decryption.  
Any other methods/techniques are there for encryption? I prefer encryption with 
key; key also should not be known to Developers. 
Please suggest any such methods. 
Thank you in advance.

Vikram



From: Craig Ringer cr...@postnewspapers.com.au
To: Vikram A vikkiatb...@yahoo.in
Cc: PGSQL - Genearal pgsql-general@postgresql.org
Sent: Friday, 10 June 2011 6:20 PM
Subject: Re: [GENERAL] PGP encrypt/decrypt - Prereqistes

On 06/10/2011 05:22 PM, Vikram A wrote:

 I am new to postgreSQL. I would like to use encrypt/decrypt using PGP
 keys on windows.

It'd be helpful to know in more detail what you want to encrypt and decrypt, 
and how. Getting crypto right is about a lot more than using good algorithms 
and good implementations.

 2. Any manual to follow the steps ?

You'll want the pgycrypto contrib module. Its documentation is here:

http://www.postgresql.org/docs/current/static/pgcrypto.html#AEN124147

... and I think (but am not certain) that it's available on Windows. Note that 
according to the documentation pgcrypto does not support signing - or 
presumably for verifying signatures.

You will also want GnuPG from http://www.gnupg.org/  to use it for key 
management and key generation.

--
Craig Ringer

Re: [GENERAL] determine client os

2011-06-13 Thread Sim Zacks

All the suggestions given are for the server OS :-(

My purpose is to be able to return a correct file path to the client 
without it specifying the OS.



Thanks

Sim


On 06/13/2011 05:38 PM, Craig Ringer wrote:


On 06/13/2011 08:35 PM, hubert depesz lubaczewski wrote:


Please note that it will return os for *server*, and not *client*.


Argh, thankyou. I misread the question. Please disregard my suggestion.

--
Craig Ringer




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


Re: [GENERAL] determine client os

2011-06-13 Thread Tom Lane
Sim Zacks s...@compulab.co.il writes:
 All the suggestions given are for the server OS :-(
 My purpose is to be able to return a correct file path to the client 
 without it specifying the OS.

File path?  Seems to me that even if you knew the client OS, that'd
provide next to no information about the installation pathnames of the
client software.  Maybe you need to be a bit clearer about what you're
trying to accomplish.

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] PGP encrypt/decrypt - Prereqistes

2011-06-13 Thread Craig Ringer
On 14/06/11 11:51, Vikram A wrote:
 Dear Mr. Craig Ringer,
 Thank you for your response. 
 I would like to crypt certain sensitive information in my applications
 such as Student register number, their marks, results etc. For this
 reason i done a study for doing encryption. Where I found that this PGP
 will help the encryption/decryption.

Sure. You can also just use a simple symmetric cypher for that sort of
thing, unless you know you need the ability to encrypt data without
knowing the secret key.

Since I presume your application needs to be able to *read* the data it
has written, and needs to be able to access that data in decrypted form,
I doubt you really need a public key system like PGP. Your application
will need to know the secret key to decrypt the data anyway.

 Any other methods/techniques are there for encryption?

Symmetric cyphers like AES. They're faster and easier to work with, just
a bit less flexible.

 I
 prefer encryption with key; key also should not be known to Developers. 

All encryption systems use a key. Do you mean a separate public and
private key? If so: why? What specific advantages does that gain you in
your situation?

Public key crypto (for encryption) is mostly useful when you have
less-trusted users/clients/whatever sending you information that you
want to keep secret from other people and from other users, so only a
few people can *read* the information even though many can *write* it.
If this is your situation you might have a use for pgcrypto's PGP
support; otherwise I'd suggest using a symmetric key for simplicity.

As for secrecy: You can't really keep the key secret from the developers
if they will have any access to the production system (for testing,
troubleshooting, performance tuning, etc). That's because the production
system needs to know the decryption key, and if the system knows the key
the developers of the system can get it to reveal that key.

Even if you don't give the developers the key, nothing stops them
modifying the program so that it emails a copy of the key to them
whenever it loads a key, or saves an unencrypted copy to a file on a
shared drive, or whatever. If the production system has an Internet
connection or any access to any other resource the developers can access
as well, they can get the key.

--
Craig Ringer

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


Re: [GENERAL] determine client os

2011-06-13 Thread Greg Smith

On 06/13/2011 07:04 AM, Sim Zacks wrote:
I didn't see a function for this, but is there a way in a postgresql 
query to determine the client OS?


A PostgreSQL client application is something that speaks a correct 
protocol to the server.  The server has no concept of what the client is 
other than the fact that it speaks a particular version of its 
language.  It knows the IP address and port number it connected on, but 
that's basically it.  So the idea of a query determining the client OS 
doesn't make sense; all it knows is what the client tells it, and the 
information required to connect to the server and execute queries does 
not include any such details.


If you want information about a client to make its way into a statement 
run on the server, you have to drive that from the direction of the 
client you're using yourself.  If your client is psql for example, you 
might pass client-side information into the program by using the 
-v/--set/--variable substitution mechanism, possibly combined with the 
SQL interpolation facility of psql.  But if your client program is in 
another programming language, you'll have to use some facility in it to 
fill in this information.


--
Greg Smith   2ndQuadrant USg...@2ndquadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
PostgreSQL 9.0 High Performance: http://www.2ndQuadrant.com/books


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