[GENERAL] pg_ctl kill QUIT

2012-07-30 Thread Venkat Balaji
Hello Community,

We have used pg_ctl kill QUIT PID to terminate one of the processes on
the production database and the database went into recovery mode.

We understand that we should not use kill -9 and we did not do that.

Could you please help us avoid this problem permanently.

Regards,
Venkat

-- 
 

DISCLAIMER:

Please note that this message and any attachments may contain confidential 
and proprietary material and information and are intended only for the use 
of the intended recipient(s). If you are not the intended recipient, you 
are hereby notified that any review, use, disclosure, dissemination, 
distribution or copying of this message and any attachments is strictly 
prohibited. If you have received this email in error, please immediately 
notify the sender and delete this e-mail , whether electronic or printed. 
Please also note that any views, opinions, conclusions or commitments 
expressed in this message are those of the individual sender and do not 
necessarily reflect the views of *Ver sé Innovation Pvt Ltd*.



Re: [GENERAL] password help

2012-07-30 Thread Craig Ringer

On 07/30/2012 02:00 PM, Guillermo Echevarria Quintana-Gurt wrote:
Im contacting them tomorrow for sure. My issue is that I uninstalled 
the postgresql system from my computer and now I cant get it installed 
again because of the password issue. Thats all im trying to solve, 
getting the postgresql installed again in my laptop and like 
said because of being really really clulesss im having issues with 
that and im really sorry for taking your time on helping me.

A google search for windows 7 administrator command prompt reveals:

http://technet.microsoft.com/en-us/library/cc947813(v=ws.10).aspx 
http://technet.microsoft.com/en-us/library/cc947813%28v=ws.10%29.aspx


and

http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/

both of which explain in detail how to open a command prompt as 
administrator. It's similarly easy to find instructions on how to get to 
the administrative tools in the control panel.


The best way to be less clueless - as you call yourself - about 
computers is to actively learn by trying to research things when you run 
into problems. These days Google will often find the answer if you try a 
few different ways to ask the question.


Try re-reading Dave's blog post slowly. When you encounter something you 
don't understand, look it up. It will take longer that way, but you will 
learn more and most importantly you will be more able to solve your own 
problems in future.


--
Craig Ringer


Re: [GENERAL] insert binary data into a table column with psql

2012-07-30 Thread Jasen Betts
On 2012-07-24, jkells jtke...@verizon.net wrote:
 I am running REDHAT 5.5 64 bit with PostgreSQL 8.4.7 64 bit.  I am trying 
 to load a binary file into a bytea column into a table without any luck 
 from psql.
 On the linux server a script is looking for a file and if found would 
 create a record into a table that contains a ID, date of load and the  
 file in the bytea column.
 table looks like the following
 table x 
 (ID number,
  load_date date,
  image  bytea
 )
 from psql
 I have tried several ways including creating a function to read a file 
 without any success but basically I want to do something like the 
 following from a bash shell

 psql connection information -c insert into x (ID, load_date, image) 
 values ($PID,clock_timestamp()::timestamp(0), copy from '/tmp/$FN' with 
 binary);

for small files (44kB?) you can do this:

psql $CONNECTION_INFO -c insert into x (ID, load_date, image) values 
   ($PID,'now', decode('`/usr/bin/base64  /tmp/$FN`','base64'))
   
   
for larger files you can write a function to read files, you'll
probably need to use an untrusted language, eg plpythonu   

-- 
⚂⚃ 100% natural


-- 
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] insert binary data into a table column with psql

2012-07-30 Thread Jasen Betts
On 2012-07-30, Jasen Betts ja...@xnet.co.nz wrote:

 I have tried several ways including creating a function to read a file 
 without any success but basically I want to do something like the 
 following from a bash shell

 psql connection information -c insert into x (ID, load_date, image) 
 values ($PID,clock_timestamp()::timestamp(0), copy from '/tmp/$FN' with 
 binary);

 for small files (44kB?) you can do this:

 psql $CONNECTION_INFO -c insert into x (ID, load_date, image) values 
($PID,'now', decode('`/usr/bin/base64  /tmp/$FN`','base64'))


For larger files ( upto 1Gib ) you need to stream it.

(
   echo insert into x (ID, load_date, image) values ($PID,'now', decode('
   /usr/bin/base64  /tmp/$FN
   echo ','base64'));
) | psql $CONNECTION_INFO

-- 
⚂⚃ 100% natural


-- 
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] pg_ctl kill QUIT

2012-07-30 Thread Craig Ringer

On 07/30/2012 05:52 PM, Venkat Balaji wrote:

Hello Community,

We have used pg_ctlkill QUIT PID to terminate one of the processes 
on the production database and the database went into recovery mode.


Did you intend to send SIGTERM (signal 15) instead of SIGQUIT (signal 
3)? Signal 3 will be interpreted as a crash, it won't trigger a clean 
backend shutdown.


If you are using any non-prehistoric version you should always use 
pg_cancel_backend(...) to end a query, or pg_terminate_backend(...) to 
ask a backend to terminate, rather than killing processes.


The database is supposed to go into recovery mode if it crashes or 
terminates unexpectedly, like after a signal 3 (SIGQUIT) to a backend. 
All the backends are terminated and when it starts back up it does crash 
recovery then carries on happily.


If that is not what happened, please explain in more detail. Include:

- The text of the PostgreSQL log file from when you sent the signal. 
This is important. If it's long, put it on pastebin.com or something and 
link to it here.

- the exact text of any error messages you are getting
- Your postgresql version
- your OS and version
- why you tried to kill a backend / the postmaster / whaterver
- whether you know which process you killed and if so, what it was doing
- what steps you took after you killed the process

See: http://wiki.postgresql.org/wiki/Guide_to_reporting_problems


Here's what should happen, from my 9.1.4 on my Fedora x64 box:

WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back 
the current transaction and exit, because another server process exited 
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and 
repeat your command.

LOG:  server process (PID 19178) exited with exit code 2
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back 
the current transaction and exit, because another server process exited 
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and 
repeat your command.

LOG:  all server processes terminated; reinitializing
LOG:  database system was interrupted; last known up at 2012-07-30 
17:22:10 WST
LOG:  database system was not properly shut down; automatic recovery in 
progress

LOG:  record with zero length at 8/151BB008
LOG:  redo is not required
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

--
Craig Ringer


[GENERAL] Debian upgrade with PostgreSQL

2012-07-30 Thread Patrick Ernst

Hello,

We are running PostgreSQL 8.3 on a Debian Lenny system. Since the system 
is outdated, we want to update to Debian Squeeze.


Based on your knowledge and experience are there any special 
preparations for PostgreSQL we have to take care of? Or can you give us 
some tips how we should approach the system upgrade so that everything 
runs smoothly?


Regards,

Patrick

--
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] password help

2012-07-30 Thread Guillermo Echevarria Quintana-Gurt

Im contacting them tomorrow for sure. My issue is that I uninstalled the 
postgresql system from my computer and now I cant get it installed again 
because of the password issue. Thats all im trying to solve, getting the 
postgresql installed again in my laptop and like said because of being really 
really clulesss im having issues with that and im really sorry for taking your 
time on helping me.
  Date: Mon, 30 Jul 2012 13:49:03 +0800
 From: ring...@ringerc.id.au
 To: guie...@hotmail.com; pgsql-general@postgresql.org
 Subject: Re: [GENERAL] password help
 
 Please don't reply directly to me, reply via the mailing list (use 
 Reply all).
 
 On 07/30/2012 01:35 PM, Guillermo Echevarria Quintana-Gurt wrote:
  Hi Craig, I really appreciate your answer. My situation is the one I 
  described you in the first email. I guess i should've add that i really 
  have no clue about how to use/run or do anything related with postgresql, i 
  downloaded it because i was told I had to have it in order for a software i 
  was going to use to work (holdem manager). I installed it and things worked 
  fine, dont remember anytime doing anything with or to postgres. My problem 
  comes now that I upgraded to holdem manager 2 and cant get to open it, i 
  was told that it COULD be related to something to postgres and i could try 
  uninstalling and reinstalling it again to see if things worked then. I 
  tried that but as told encountered the password problem.
 This is a Holdem Manager issue. They've done a silent installation of 
 PostgreSQL, and their upgrade tool clearly doesn't do its job right.
 
 Please contact their technical support for assistance.
 
 --
 Craig Ringer
  

[GENERAL] GIN vs GIST multicolumn index

2012-07-30 Thread Oleg Mürk
Hello,

I need to index a table with two columns:
   column_t timestamp
   column_ia integer[]
The number of rows is around 100M. Each integer array (column_ia)
contains on average 4 values (100 possible integer values altogether)

I created two indexes:
  create index idx_gist on my_table using gist (date_trunc('month',
column_t), column_ia gist__int_ops);
  create index idx_gin on my_table using gin (date_trunc('month',
column_t), column_ia gin__int_ops);

I am running the following query:

 select count(*) from my_table where date_trunc('month', column_t) = 
 '2012-03-01' and column_ia  ('{322}'::int[])
  count
-
 1343197
(1 row)

For some reason query run time is 4x faster when using GIST index than
using GIN index (when all data is in RAM).
Both query runs perform Bitmap Index Scan. At the same time GIST index
takes 4x more space.

Is this an expected behavior or how can I speed up GIN index speed?
(or reduce GIST index size?)

P.S. Probably bitmap indexes would have been the best option.

Thank You!
Oleg Mürk

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


[GENERAL] conversion from epoch

2012-07-30 Thread Little, Douglas
I have an input source that is in epoch time.Is there a built-in conversion 
to changing to timestamp

Thanks


Doug Little

Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz 
Worldwide
500 W. Madison, Suite 1000  Chicago IL 60661| Office 312.260.2588 | Fax 
312.894.5164 | Cell 847-997-5741
douglas.lit...@orbitz.commailto:douglas.lit...@orbitz.com
 [cid:image001.jpg@01CD6E36.D9E7D130]   orbitz.comhttp://www.orbitz.com/ | 
ebookers.comhttp://www.ebookers.com/ | 
hotelclub.comhttp://www.hotelclub.com/ | 
cheaptickets.comhttp://www.cheaptickets.com/ | 
ratestogo.comhttp://www.ratestogo.com/ | 
asiahotels.comhttp://www.asiahotels.com/

inline: image001.jpg

Re: [GENERAL] conversion from epoch

2012-07-30 Thread Andreas Kretschmer




Little, Douglas douglas.lit...@orbitz.com hat am 30. Juli 2012 um 16:36
geschrieben:


 I have an input source that is in epoch time.Is there a built-in
 conversion to changing to timestamp
 
 
 
select 'epoch'::date + your epoch-value * '1second'::interval;




Andreas

-- 
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] conversion from epoch

2012-07-30 Thread Steve Atkins

On Jul 30, 2012, at 7:36 AM, Little, Douglas wrote:

 I have an input source that is in epoch time.Is there a built-in 
 conversion to changing to timestamp

to_timestamp().

You can also do things like select timestamptz 'epoch' + ? * interval '1 
second'.

Cheers,
  Steve


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


Re: [GENERAL] Debian upgrade with PostgreSQL

2012-07-30 Thread Vincent Veyron
Le lundi 30 juillet 2012 à 12:57 +0200, Patrick Ernst a écrit :

 We are running PostgreSQL 8.3 on a Debian Lenny system. Since the system 
 is outdated, we want to update to Debian Squeeze.
 
 Based on your knowledge and experience are there any special 
 preparations for PostgreSQL we have to take care of? Or can you give us 
 some tips how we should approach the system upgrade so that everything 
 runs smoothly?


Hi,

Below are the notes I took for step-by-step instructions. It went
smoothly.

uname -a :
Linux sd-21096 2.6.32-bpo.4-amd64 #1 SMP Thu Apr 8 10:20:24 UTC 2010
x86_64 GNU/Linux

#2012-03-30 upgrade from Lenny to Squeeze

#modify /etc/fstab to use uuid
#this command lists the uuid values to use
ls -l /dev/disk/by-uuid

#backup
pg_dumpall  8.3.out

#check package selection, delete all those marked 'hold'
dpkg --get-selections *  paquets-actuels.txt

#check w/ aptitude, hold must be empty
aptitude g

#edit /etc/apt/sources.list
sed -i 's/lenny/squeeze/g' /etc/apt/sources.list
#replace volatile repo w/squeeze-updates
deb http://ftp.debian.org/debian squeeze-updates main

#erase /etc/apt/preferences


#languages : add fr_FR@euro ISO-8859-15
dpkg-reconfigure locales

#clean cache
apt-get clean

#launch dist-upgrade
apt-get update
apt-get dist-upgrade

#reconfigure sysv-rc

#remove unwanted packages 
update-rc.d -f atd remove
update-rc.d -f bind9 remove 
update-rc.d -f mdadm remove 

#edit /etc/init.d/package
# Required-Start:none
# Required-Stop: none

#the following 3 packages have new configuration files
#the new file is edited manually

#reconfigure ssh
cat  /etc/ssh/ssh_config
#avoid timeout of backup scripts
SetupTimeOut 600

#reconfigure logrotate
/etc/logrotate.d/apache2

#reconfigure apache2
/etc/apache2/sites-available/default-ssl
/etc/apache2/apache2.conf
/etc/apache2/conf.d/security
/etc/apache2/mods-available/mime.conf

#Enable dependency based boot system
dpkg-reconfigure sysv-rc

#remove previous postgresql version
apt-get remove postgresql-8.3 postgresql-client-8.3 postgresql-doc-8.3
postgresql-plperl-8.3

#remove unused packages
apt-get autoremove

#install new postgresql version
apt-get install postgresql postgresql-plperl-8.4 

#résultat
Paramétrage de postgresql-8.4 (8.4.11-0squeeze1) ...
Creating new cluster (configuration: /etc/postgresql/8.4/main,
data: /var/lib/postgresql/8.4/main)...
Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf
to /etc/postgresql/8.4/main...
Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf
to /etc/postgresql/8.4/main...
Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf
to /etc/postgresql/8.4/main...
Configuring postgresql.conf to use port 5432...
update-alternatives: utilisation de
« /usr/share/postgresql/8.4/man/man1/postmaster.1.gz » pour fournir
« /usr/share/man/man1/postmaster.1.gz » (postmaster.1.gz) en mode
automatique.

#edit /etc/postgresql/8.4/main/postgresql.conf
ssl=off

#restore from dumpall
psql -f 8.3.out postgres

#remove unwanted stuff
apt-get purge portmap nfs-common

#clean up
apt-get autoremove


Done.



-- 
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres assurances et des dossiers contentieux pour 
le service juridique


-- 
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] conversion from epoch

2012-07-30 Thread Adrian Klaver

On 07/30/2012 07:36 AM, Little, Douglas wrote:

I have an input source that is in epoch time.Is there a built-in
conversion to changing to timestamp


http://www.postgresql.org/docs/9.1/interactive/functions-formatting.html

to_timestamp(double precision)	timestamp with time zone	convert Unix 
epoch to time stamp	to_timestamp(1284352323)



So:

test= SELECT to_timestamp(extract(epoch from now()));
 to_timestamp
---
 2012-07-30 15:51:42.587106-07




Thanks

*Doug Little*




--
Adrian Klaver
adrian.kla...@gmail.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] new material for Postgres for MySQL users presentation

2012-07-30 Thread Ondrej Ivanič
Hi,

Several years ago I gave this presentation to a bunch of PHP
developers in order to show then that something else is out there :).
Presentation was based on MySQL 4.1 and Postgres 8.2/8.3 (early 2008).
I would like to do it again and I'm looking for sources which can I
re-use (and credit back of course).

Presentation has the following structure:
- Installation (database server and required PHP modules)
- First look around (PGAdmin, psql)
- Postgres nomenclature and MySQL equivalents (database cluster,
schema, MVCC, fulltext)
- Let's create first database and users (psql, pg_hba, createdb,
createuser, ...)
- Basic performance tuning
- Cool things in Postgres (transactional DDL, PostGIS, custom types, ...)
- Annoying things (Slow count(*), (auto)vacuum/(auto)analyze)
- Replication and HA

I need to remove obsolete stuff and add new things like extensions
and hstore -- anything else worth mentioning? I would like to talk
more about replication and HA because Postgres implemented same set of
features like MySQL (but MySQL steps forward with master-master setup
(should I count Postgres-XC?)).

If you know about some good resources (presentations, blogs, ...)
which can I use please let me know!
Thanks!

-- 
Ondrej Ivanic
(ondrej.iva...@gmail.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] Postgres will not compile on Mac 10.8 with contrib/uuid-ossp

2012-07-30 Thread Steven Schlansker
It is not possible to compile Postgres contrib/uuid-ossp on the newest release 
of Mac OS X, 10.8

The specific compile error: 

make -C uuid-ossp install

/bin/sh ../../config/install-sh -c -d '/usr/local/Cellar/postgresql/9.1.3/lib'
/usr/bin/clang -Os -w -pipe -march=native -Qunused-arguments 
-I/usr/local/Cellar/ossp-uuid/1.6.2/include -Wall -Wmissing-prototypes 
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security 
-fno-strict-aliasing -fwrapv -fexcess-precision=standard  -I. -I. 
-I../../src/include -I/usr/local/Cellar/readline/6.2.2/include 
-I/usr/include/libxml2 -I/usr/include/libxml2   -c -o uuid-ossp.o uuid-ossp.c

In file included from uuid-ossp.c:27:
In file included from /usr/local/Cellar/ossp-uuid/1.6.2/include/uuid.h:38:
/usr/include/unistd.h:689:26: error: expected identifier
int  gethostuuid(uuid_t, const struct timespec *) 
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
 ^
In file included from uuid-ossp.c:27:
/usr/local/Cellar/ossp-uuid/1.6.2/include/uuid.h:94:24: error: typedef 
redefinition with different types ('struct uuid_st' vs '__darwin_uuid_t' (aka 
'unsigned char [16]'))
typedef struct uuid_st uuid_t;
   ^
/usr/include/uuid/uuid.h:42:25: note: previous definition is here
typedef __darwin_uuid_t uuid_t;
^
In file included from uuid-ossp.c:27:
/usr/local/Cellar/ossp-uuid/1.6.2/include/uuid.h:107:22: error: conflicting 
types for 'uuid_compare'
extern uuid_rc_t uuid_compare  (const uuid_t  *_uuid, const uuid_t *_uuid2, 
int *_result);
 ^
/usr/include/uuid/uuid.h:59:5: note: previous declaration is here
int uuid_compare(const uuid_t uu1, const uuid_t uu2);
^
3 errors generated.
make[2]: *** [uuid-ossp.o] Error 1
make[1]: *** [install-uuid-ossp-recurse] Error 2
make[1]: *** Waiting for unfinished jobs….


Full log available here (not mine, but I have the exact same problem):
https://gist.github.com/2287209

There is a workaround (disable uuid-ossp) but obviously this does not help 
those of us who require UUID support.

There are a number of bugs open:
https://github.com/mxcl/homebrew/issues/13639
https://trac.macports.org/ticket/35153

and a proposed fix which does fix the problem for me:

 This is caused by the inclusion of the system uuid.h in pwd.h. Just add the 
 line :
 
 #define _XOPEN_SOURCE
 
 at the first line of uuid-ossp.c, and it should compile fine.


I am not sure what the correct fix is, but adding the above definition does 
fix the issue.


-- 
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] 9.1.4: pg_restore: couldn't uncompress data?

2012-07-30 Thread Craig Ringer

On 07/24/2012 09:50 PM, Larry Rosenman wrote:

This one is concerning.  Trying to restore a backup from one system to
another, and got this:

pg_restore: restoring data for table userid
pg_restore: restoring data for table values
pg_restore: [compress_io] could not uncompress data: (null)
pg_restore: *** aborted because of error
[lrosenman@bpsandbox-db2 ~]$ ls -l db*
-rw-rw-r-- 1 lrosenman blueprint 10838183690 Jul 23 17:58
db.backup.2012_07_21T062258
[lrosenman@bpsandbox-db2 ~]$

The file is the same size on both systems, and was transferred with scp.

Any ideas why I would see this?

I just noticed you never saw any response to this.

Did you eventually find a resolution? If not, verify the checksum on the 
file with md5sum on both sides. It'd also help if you'd mention the 
operating system(s) / distro(s), Pg version(s), etc involved.


--
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] Postgres will not compile on Mac 10.8 with contrib/uuid-ossp

2012-07-30 Thread Tom Lane
Steven Schlansker ste...@likeness.com writes:
 It is not possible to compile Postgres contrib/uuid-ossp on the newest 
 release of Mac OS X, 10.8

This looks like some variant of the same issue that OSSP's uuid
package has had on Macs all along, to wit an unreliable method for
avoiding conflicts with any OS-supplied uuid type.  Back when we
last looked at this,
http://archives.postgresql.org/pgsql-hackers/2007-11/msg00551.php
we concluded that what we had to do was not include unistd.h
ahead of uuid.h, and as far as I can tell we're still not doing that;
for me, contrib/uuid-ossp still builds fine on Lion with uuid 1.6.2.

So assuming you're using a stock copy of 1.6.2, that leaves unistd.h
as the only variable in the equation that could have changed.  It's
not obvious from here exactly how it changed, but in any case this
fight is ultimately between OSSP uuid and OS X; there's not a lot
Postgres can (or should) do to fix it.  It's a bit distressing that
OSSP doesn't seem to have made any new uuid releases since 2008,
but maybe if you prod them they'll do something about this.

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] Postgres will not compile on Mac 10.8 with contrib/uuid-ossp

2012-07-30 Thread Steven Schlansker

On Jul 30, 2012, at 7:35 PM, Tom Lane t...@sss.pgh.pa.us wrote:

 Steven Schlansker ste...@likeness.com writes:
 It is not possible to compile Postgres contrib/uuid-ossp on the newest 
 release of Mac OS X, 10.8
 
 This looks like some variant of the same issue that OSSP's uuid
 package has had on Macs all along, to wit an unreliable method for
 avoiding conflicts with any OS-supplied uuid type.  Back when we
 last looked at this,
 http://archives.postgresql.org/pgsql-hackers/2007-11/msg00551.php
 we concluded that what we had to do was not include unistd.h
 ahead of uuid.h, and as far as I can tell we're still not doing that;
 for me, contrib/uuid-ossp still builds fine on Lion with uuid 1.6.2.

Looks right to me.

 
 So assuming you're using a stock copy of 1.6.2,

(I am)

 that leaves unistd.h
 as the only variable in the equation that could have changed.  It's
 not obvious from here exactly how it changed, but in any case this
 fight is ultimately between OSSP uuid and OS X; there's not a lot
 Postgres can (or should) do to fix it.  It's a bit distressing that
 OSSP doesn't seem to have made any new uuid releases since 2008,
 but maybe if you prod them they'll do something about this.
 
   regards, tom lane

I've sent a message upstream.  It seems that both their bug tracker and forum 
are either
nonexistent or so broken that they seem so.  So I will work on the assumption 
that this bug
won't get fixed upstream…

Would it be reasonable to include the _XOPEN_SOURCE define in the contrib 
module?
It at least fixes this issue and hopefully wouldn't cause any ill effects.

There's a patch at 
https://github.com/stevenschlansker/homebrew/commit/d86e17cbcc5d287d7a393a6754aa8f94b995c5ea

It's not terribly extensively tested but it does compile and I would be very 
surprised if it caused problems.
-- 
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] 9.1.4: pg_restore: couldn't uncompress data?

2012-07-30 Thread Larry Rosenman

On Mon, July 30, 2012 9:14 pm, Craig Ringer wrote:
 On 07/24/2012 09:50 PM, Larry Rosenman wrote:
 This one is concerning.  Trying to restore a backup from one system to
 another, and got this:

 pg_restore: restoring data for table userid
 pg_restore: restoring data for table values
 pg_restore: [compress_io] could not uncompress data: (null)
 pg_restore: *** aborted because of error
 [lrosenman@bpsandbox-db2 ~]$ ls -l db*
 -rw-rw-r-- 1 lrosenman blueprint 10838183690 Jul 23 17:58
 db.backup.2012_07_21T062258
 [lrosenman@bpsandbox-db2 ~]$

 The file is the same size on both systems, and was transferred with scp.

 Any ideas why I would see this?
 I just noticed you never saw any response to this.

 Did you eventually find a resolution? If not, verify the checksum on the
 file with md5sum on both sides. It'd also help if you'd mention the
 operating system(s) / distro(s), Pg version(s), etc involved.

 --
 Craig Ringer

Didn't resolve it for this file.

RHEL 5.4(IIRC), 64-bit, 9.1.4.

I haven't had an issue with others.

I'll check the sums.  thanks!

-- 
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: l...@lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893



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