Re: [GENERAL] Configure can't find com_err on OpenBSD for --with-krb5

2007-03-04 Thread Stefan Kaltenbrunner
Jim Rosenberg wrote:
 --On Saturday, March 3, 2007 11:24 PM -0500 Tom Lane [EMAIL PROTECTED]
 wrote:
 
 I am trying to build PostgreSQL 8.2.3 on OpenBSD 4.0. When I give the
 command

 ./configure -v --with-openssl --with-krb5
 --with-includes=/usr/include/kerberosV

 I get:

 checking for library containing com_err... no
 configure: error: could not find function 'com_err' required for
 Kerberos 5

 Perhaps you need a --with-libs switch too?  Usually, if the package
 didn't put its include files right in /usr/include, it likely didn't
 put the libraries right in /usr/lib either.
 
 Hmm. libkrb5 is in /usr/lib -- with all the rest of the libs -- not
 somewhere special.
 
 I also have /usr/lib/libcom_err.a too, and it seems to have com_err.o
 also. Putting in an explicit
 
 ./configure --with-openssl --with-krb5
 --with-includes=/usr/include/kerberosV
 --with-libs=/usr/lib


FWIW - we have a buildfarm box running OpenBSD 4.0/AMD64 - and it is
using the following configuration:

http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=zebradt=2007-03-02%2013:18:04

I vaguely remember I had some kerberos-related issues too when I set up
that box but the above configuration is working :-)

Stefan

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] Interface to posgresql

2007-03-04 Thread Shane Ambler

[EMAIL PROTECTED] wrote:

Thanks Shane, I appreciate your help.
I have installed postgresql on windows and there is no /urs/lib and 

 /urs/include folder in this installation. Can you please tell me
 why is that and what is the difference in the windwos and
 linux intallations

With windows the include files and libraries are an optional extra.

I think the older installer was setup a bit different - you may need to 
select custom install. When you get to install options you will find 
Development at the bottom of the list, here you can select to have the 
include files and libraries installed.


You will find them in the same folder as the other files installed.
This is in normally C:\Program Files\PostgreSQL\8.x




Regards
MAK
Shane Ambler-4 wrote:

makhan wrote:

Hi

I am trying to connect to the postgresql and make quries usuing my
application in c language using the libpq library.can you please tell me
how
to setup the enviromnet and where to place files so that I can run
examples
given on the libpq site.( if I use gcc compiler on linux or borland turbo
c)

Regards
The standard placing for the files is /usr/lib for libpq and 
/usr/include for the header files.


These paths should be standard search paths for gcc

I believe the linux installs have these files as part of the devel 
install - the postgresql-devel-xxx rpm - you will need to install that.


If you have done a manual setup and build from source then /usr would be 
replaced with the prefix path used (./configure --prefix=...)

eg. /usr/local/pgsql/lib is a common one.

For gcc HEADER_SEARCH_PATHS is used for headers and LIBRARY_SEARCH_PATHS 
for libs. Or -I can be used as an option to gcc and -L with ld when 
linking. eg gcc -I /usr/local/pgsql/include myprog.c


--

Shane Ambler
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org/


Quoted from: 
http://www.nabble.com/-GENERAL--libpq%2B%2B-installation-error-tf771167.html#a9284057






--

Shane Ambler
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Support for idempotent schema changes?

2007-03-04 Thread Flemming Frandsen

Peter Eisentraut wrote:

You just ignore the error if the object already exists.


I'd advice against that or at least make sure that only the thing 
already exists errors get ignored.


Because otherwise it's 100% impossible to discover any real problems 
with the scripts.


--
 Regards Flemming Frandsen - YAPH - http://dion.swamp.dk

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[GENERAL] date format

2007-03-04 Thread Garry Saddington
I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still 
rendered in the format (y,m,d) . How can I change this behaviour? 
regards
garry

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] Can I getting a unique ID from a select

2007-03-04 Thread Bruno Wolff III
On Sat, Mar 03, 2007 at 18:12:19 -0600,
  Bruno Wolff III [EMAIL PROTECTED] wrote:
 On Thu, Mar 01, 2007 at 06:16:02 -0800,
   Timasmith [EMAIL PROTECTED] wrote:
  I am using hibernate, using a view like a read only table and I need a
  primary key each time a select is issued.
  
  create view myview as
  select rownum, t1.field, t2.field
  from tableOne t1, tableTwo t2
  where t1.key = t2.fkey
  
  select * from myview
  
  But what I really need is
  
  select makemeauniquekey, t1.field, t2.field
  ...
 
 Is there some reason you can't use the join key?

To expand on this, if you are joining on fields that will return only
one record for each value, you should still be able to make a primary
key for the returned records using a combination of the primary keys
of both records being joined. If hibernate only works with primary keys
consisting of one column, than you can create a new field using a function
of the primary keys of the records being joined.

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] PG Dump 8.2

2007-03-04 Thread Leonel Nunez
 Joshua D. Drake wrote:
 Mikko Partio wrote:

 Laurent ROCHE wrote:

 Hi,

 Does anyone know if Ubuntu 6.10 (LTS) has packages for PostgreSQL 8.2,
 from a recommandable place ?

 I can not recommend my clients to use 8.2 if there's nobody supporting
 the packages (so just compiling from the source code is not an
 option).



 To my knowledge there are no 8.2 binaries for Ubuntu LTS. The best you
 could probably get is 8.1 which is a perfectly acceptable and stable
 release.

 Sincerely,

 Joshua D. Drake

 Well, there are 8.2 binaries for Ubuntu 6.10 [1], but for LTS (6.04) 8.1
 is the latest version available.

 Regards

 MP


 [1] https://launchpad.net/ubuntu/+source/postgresql-8.2

 ---(end of broadcast)---
 TIP 5: don't forget to increase your free space map settings


And that  backport  has  security updates as soon as they get fixed?

leonel




---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] date format

2007-03-04 Thread Jorge Godoy
Garry Saddington [EMAIL PROTECTED] writes:

 I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is 
 still 
 rendered in the format (y,m,d) . How can I change this behaviour? 

ISO means y-m-d...  

-- 
Jorge Godoy  [EMAIL PROTECTED]

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] postgresql vs mysql

2007-03-04 Thread Andreas 'ads' Scherbaum
On Thu, 22 Feb 2007 17:14:11 -0600
Jim Nasby [EMAIL PROTECTED] wrote:

 On Feb 20, 2007, at 11:59 PM, Adam Rich wrote:
  As of 5.0.2, the server requires that month and day values
  be legal, and not merely in the range 1 to 12 and 1 to 31,
  respectively.
 
 Yes, but any session is free to change that setting and insert  
 whatever garbage they want. AFAIK there's absolutely no way to  
 prevent that. So your data is still very much subject to getting  
 trashed.

Even if you activate the strict mode, you cannot be sure, that Mysql
will not result invalid data from the table inserted by another session
not using strict mode.


Kind regards

-- 
Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] postgresql vs mysql

2007-03-04 Thread Andreas 'ads' Scherbaum

Hello,

On Thu, 22 Feb 2007 00:16:24 +0800
Lincoln Yeoh lyeoh@pop.jaring.my wrote:

 Want transactions? Use innoDB. Want to restore a multi-gigabyte 
 database fast from backups, sure use MyISAM (too many people seem to 
 have probs doing that with innoDB).

sure you want to do this?

http://bugs.mysql.com/bug.php?id=11151

I won't trust a database who prefers speed over data integrity even if
it's named transaction.


 Want foreign keys to work? Use innoDB. MyISAM tables allow you to 
 specify foreign keys but ignores AND forgets them.

As example, you have to say 

FOREIGN KEY ... REFERENCES

cause REFERENCES itself is (was?) even in innodb just syntax sugar and
get's ignored. Standard tells, REFERENCES as an alias for the full
syntax is just fine, but in Mysql you won't even get an error.


 You can mix MyISAM tables with innoDB tables in the same database. 
 That's a minus.

Thats a feature.

You can even mix both table types in a transaction: thats a real bug.


 ** D'oh level release gotchas
 Example: Before MySQL 5.0.13, GREATEST(x,NULL) and
 LEAST(x,NULL) return x when x is a non-NULL value. As of 5.0.13,
 both functions return NULL if any argument is NULL, the same as
 Oracle.  This change can cause problems for applications that rely
 on the old behavior.

Between 5.0.24a and 5.0.27 the behaviour of SELECT COUNT(1) has changed
and now returns 1 as expected. Previous versions returned 0 but of
course behaviour changes in minor releases and no announcement was
made. This one seems easy on the first look but i was told that it is
only a result of a bigger change somewhere else in the code which
will or will not interfere with other results as well.


 Not saying Postgresql is perfect - rather that MySQL makes Postgresql 
 look really good.

Hehe, sure ;-)


Kind regards

-- 
Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] postgresql vs mysql

2007-03-04 Thread Andreas 'ads' Scherbaum

Hello all,

On Wed, 21 Feb 2007 10:02:04 -0600
Scott Marlowe [EMAIL PROTECTED] wrote:

 It swallows column level foreign key contraints and does nothing with
 them, no errors nothing, even if you're defining innodb tables.  I.e.
 this produces not errors:
 
 mysql create table a (id int primary key) engine=innodb;
 Query OK, 0 rows affected (0.02 sec)
  
 mysql create table b (a_id int references a(id)) engine=innodb;
 Query OK, 0 rows affected (0.03 sec)
  
 mysql insert into a values (1);
 Query OK, 1 row affected (0.03 sec)
  
 mysql insert into b values (1);
 Query OK, 1 row affected (0.03 sec)
  
 mysql insert into b values (2);
 Query OK, 1 row affected (0.03 sec)
  
 That last statement should fail.  Or the creation of table b should
 throw a warning.  Or something.

It will not fail, cause REFERENCES without FOREIGN KEY get's ignored :-(
Thats documented somewhere, but not really fixed, cause standard '92
says, just writing REFERENCE is ok. Oh, and no warning at all, since it
is a valid (but ignored) language thing of Mysql.


Kind regards

-- 
Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] postgresql vs mysql

2007-03-04 Thread Andreas 'ads' Scherbaum
On Fri, 23 Feb 2007 13:49:06 +1300
Andrej Ricnik-Bay [EMAIL PROTECTED] wrote:

 On 2/23/07, Jim Nasby [EMAIL PROTECTED] wrote:
  That depends greatly on what you're doing with it. Generally, as soon
  as you start throwing a multi-user workload at it, MySQL stops
  scaling. http://tweakers.net recently did a study on that.
 I think I recall that wikipedia uses MySQL ... they get quite a few
 hits, too, I believe.

Wikipedia is, like ./, heavily cached. Almost every answer you get
comes from a proxy, not from the database itself.


Kind regards

-- 
Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[GENERAL] xpath and xml namespaces

2007-03-04 Thread Peter Schonefeld

Hi, i'm having trouble getting xpath in Postgres 8.2 to recognise xml
namespaces...could someone please point me to a good reference for the xml2
lib?

Cheers
Pete


Re: [GENERAL] Configure can't find com_err on OpenBSD for --with-krb5

2007-03-04 Thread Jim Rosenberg
--On Sunday, March 4, 2007 12:40 AM -0500 Tom Lane [EMAIL PROTECTED] 
wrote:



You need to look at the config.log output to see exactly what configure
tried to do and what error it got.


Thanks, Tom, this was helpful!!

Here's the problem: when configure tries to compile the code snippet to 
check for com_err, it needs to do this with -lcrypto added, but it's not 
using that. What's the right way to fix this? I could probably get it to 
work by brutally hacking configure, but there's got to be a better way.


-Thanks, Jim

---(end of broadcast)---
TIP 6: explain analyze is your friend


[GENERAL] issue with select currval

2007-03-04 Thread Alain Roger

Hi,

I have a table photo where my primary key is name photo_id (only serial
value is stored there).

when i type :
select currval('photo_photo_id_seq');

the answer is :
ERROR:  relation photo_photo_id_seq does not exist

whereas the relation photo_photo_id_seq exists

So where is the problem ? should i specify the schema ? (schema is :
immense)

if i type :
SELECT photo_id FROM immense.photo ORDER BY photo_id DESC LIMIT 1
i get what i want (the last serial/index value used by my table)

thanks for help.

--
Alain

Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5


Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell

On 04/03/2007 12:58, Jorge Godoy wrote:

Garry Saddington [EMAIL PROTECTED] writes:

I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still 
rendered in the format (y,m,d) . How can I change this behaviour? 


ISO means y-m-d...  


The default postgresql.conf that is installed has

  datestyle = iso,mdy

though commented out - on a new installation I uncomment this line as a 
matter of course and change it to iso,dmy and it works fine.


Are you sure that PostgreSQL is presenting the dates in the wrong 
format? Could there be another layer that's swapping the month and year 
around? - try SELECTing some date values from psql and see what you get.


Ray.

---
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
---

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 15:28, Raymond O'Donnell wrote:
 On 04/03/2007 12:58, Jorge Godoy wrote:
  Garry Saddington [EMAIL PROTECTED] writes:
  I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is
  still rendered in the format (y,m,d) . How can I change this behaviour?
 
  ISO means y-m-d...

 The default postgresql.conf that is installed has

datestyle = iso,mdy

 though commented out - on a new installation I uncomment this line as a
 matter of course and change it to iso,dmy and it works fine.

 Are you sure that PostgreSQL is presenting the dates in the wrong
 format? Could there be another layer that's swapping the month and year
 around? - try SELECTing some date values from psql and see what you get.

I tried pgAdmin3 on windows to run 'select now()'  and it still does not 
return the correct datestyle.
Regards
Garry


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] issue with select currval

2007-03-04 Thread Shane Ambler

Alain Roger wrote:

Hi,

I have a table photo where my primary key is name photo_id (only serial
value is stored there).

when i type :
select currval('photo_photo_id_seq');

the answer is :
ERROR:  relation photo_photo_id_seq does not exist

whereas the relation photo_photo_id_seq exists

So where is the problem ? should i specify the schema ? (schema is :
immense)

if i type :
SELECT photo_id FROM immense.photo ORDER BY photo_id DESC LIMIT 1
i get what i want (the last serial/index value used by my table)


My guess is that your schema is not in the search path and you need to 
fully qualify the name. Try -

select currval('immense.photo_photo_id_seq');

Otherwise double check the spelling of the sequence name (any capitals?)
and the schema that it belongs to.

If you want to avoid typing your schema for everything then add it to 
your search path.

SET search_path to immense, public;

SHOW search_path; will tell you what it is currently set to if you want 
to check that you won't be removing another schema that is being used.




--

Shane Ambler
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell

On 04/03/2007 16:16, Garry Saddington wrote:

I tried pgAdmin3 on windows to run 'select now()'  and it still does not 
return the correct datestyle.


Probably a silly question, but did you remember to restart the server 
after changing the datestyle setting?


Ray.

---
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
---

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] xpath and xml namespaces

2007-03-04 Thread Nikolay Samokhvalov

On 3/4/07, Peter Schonefeld [EMAIL PROTECTED] wrote:

Hi, i'm having trouble getting xpath in Postgres 8.2 to recognise xml
namespaces...could someone please point me to a good reference for the xml2
lib?


This is FAQ-like question.
The thing is that XPath spec doesn't define any default mappings for
namespaces. It's considered as entirely user's problem -- he should
manually define namespaces mappings to use namespace prefixes in XPath
expressions.

If you use contrib/xml2 I'm afraid there is no way to use namespaces
in XPath w/o changing contib's code itself... To enable namespaces
using libxml2 one should use xmlXPathRegisterNs():
http://xmlsoft.org/html/libxml-xpathInternals.html#xmlXPathRegisterNs

I hope 8.3 will have XPath function with namespaces support in core.

--
Best regards,
Nikolay

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[GENERAL] how to pass an array to the plpgsql function from Java Code

2007-03-04 Thread Sandeep Kumar Jakkaraju

how to pass an array to the plpgsql function from Java Code ??
say from a JDBC preparedStatement 


Example :-

create or replace function test( x integer[] ) returns integer as
$BODY$
BEGIN
RETURN x[0];
END ;
language 'plpgsql'

JDBC CODE :-


int [] ar = {1,2,3};

PreparedStament pre= connection.prepareStatement(  select test(?) );

pre.setArray(1,ar};


[GENERAL] Cannot digest subscribe

2007-03-04 Thread Don Lavelle

Hi all,

I just signed up for the mailing list, but when I tried to change  
over to a digest subscription, I got an error back from the server.   
The instructions I followed were from http://archives.postgresql.org/ 
pgsql-general/ .


From the few e-mails I've gotten so far, it looks like this is a  
nice community!


Thanks,

Don

Begin forwarded message:


From: [EMAIL PROTECTED]
Date: March 4, 2007 9:28:30 AM EST
To: Don Lavelle [EMAIL PROTECTED]
Subject: Majordomo results
Reply-To: [EMAIL PROTECTED]



subscribe-digest pgsql-general

 The subscribe command did not succeed.

 The command mode digest is invalid.  The following command
 modes, separated by hyphens ('-') or equals signs ('=') are  
valid:

   noinform
   nolog
   nomessage
   nowelcome
   quiet
   rule
   set
   welcome

Valid commands processed: 1
0 succeeded, 0 stalled, and 1 failed.


Use the following command:
  sessioninfo aacb79d2f88ad99a727d23a2ec10a3bcef7c9882
to see technical information about this session.




---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote:
 On 04/03/2007 16:16, Garry Saddington wrote:
  I tried pgAdmin3 on windows to run 'select now()'  and it still does not
  return the correct datestyle.

 Probably a silly question, but did you remember to restart the server
 after changing the datestyle setting?
yes
regards
garry
 Ray.

 ---
 Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
 [EMAIL PROTECTED]
 ---

 ---(end of broadcast)---
 TIP 5: don't forget to increase your free space map settings

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] date format

2007-03-04 Thread Martijn van Oosterhout
On Sun, Mar 04, 2007 at 05:05:44PM +, Garry Saddington wrote:
 On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote:
  On 04/03/2007 16:16, Garry Saddington wrote:
   I tried pgAdmin3 on windows to run 'select now()'  and it still does not
   return the correct datestyle.
 
  Probably a silly question, but did you remember to restart the server
  after changing the datestyle setting?
 yes
 regards

Can you show us your exact output so we don't have to guess? I get
this:

# set datestyle=iso,dmy;
SET
# select now();
  now
---
 2007-03-04 18:07:54.626267+01
(1 row)

Which is precisely what I expect.

Have a nice day,
-- 
Martijn van Oosterhout   kleptog@svana.org   http://svana.org/kleptog/
 From each according to his ability. To each according to his ability to 
 litigate.


signature.asc
Description: Digital signature


Re: [GENERAL] Support for idempotent schema changes?

2007-03-04 Thread David Lowe
Within the context of a script, executing:

Begin
Statement1
Statement2
Statement3
Commit

Where I only wish to commit if the error is specific to the object
already existing, and rollback for all other errors, what's the best way
to accomplish that?


-Original Message-
From: Peter Eisentraut [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 03, 2007 11:45 PM
To: pgsql-general@postgresql.org
Cc: David Lowe
Subject: Re: [GENERAL] Support for idempotent schema changes?

David Lowe wrote:
 So how can I make statements of the form:

 *  alter table only customers add constraint
 a_previously_missed_constraint unique (a, b, c);

 *  add column points int4 not null default 0;

 idempotent?

You just ignore the error if the object already exists.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Can I getting a unique ID from a select

2007-03-04 Thread Timasmith
On Mar 3, 7:12 pm, [EMAIL PROTECTED] (Bruno Wolff III) wrote:
 On Thu, Mar 01, 2007 at 06:16:02 -0800,
  Timasmith[EMAIL PROTECTED] wrote:

  I am using hibernate, using a view like a read only table and I need a
  primary key each time a select is issued.

  create view myview as
  select rownum, t1.field, t2.field
  from tableOne t1, tableTwo t2
  where t1.key = t2.fkey

  select * from myview

  But what I really need is

  select makemeauniquekey, t1.field, t2.field
  ...

 Is there some reason you can't use the join key?

 ---(end of broadcast)---
 TIP 4: Have you searched our list archives?

http://archives.postgresql.org/


Never heard of a 'join key' but that sounds very promising.  How do I
select it?


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[GENERAL] pljava on mac

2007-03-04 Thread Eddy D. Sanchez

Someone works with pljava under postgresql on mac?

I'm trying to install on OSX 10.4.8 but I cant compile this.

Is there somebody that can copy me its compiles libraries ?

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] date format

2007-03-04 Thread Joshua D. Drake

Garry Saddington wrote:
I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still 
rendered in the format (y,m,d) . How can I change this behaviour? 
  
Did you restart PostgreSQL after making the change? You can also set it 
on the fly per session.


Joshua D. Drake





regards
garry

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly

  



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] Configure can't find com_err on OpenBSD for --with-krb5

2007-03-04 Thread Tom Lane
Jim Rosenberg [EMAIL PROTECTED] writes:
 Here's the problem: when configure tries to compile the code snippet to 
 check for com_err, it needs to do this with -lcrypto added, but it's not 
 using that. What's the right way to fix this? I could probably get it to 
 work by brutally hacking configure, but there's got to be a better way.

I think the right fix is probably to add -lcrypto to these lines in
configure.in, which are already accounting for random other possible
dependencies of libkrb5:

 AC_SEARCH_LIBS(com_err, [krb5 'krb5 -ldes -lasn1 -lroken' com_err], [],
[AC_MSG_ERROR([could not find function 'com_err' required 
for Kerberos 5])])
 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -ldes -lasn1 -lroken'], [],
[AC_MSG_ERROR([could not find function 'krb5_sendauth' 
required for Kerberos 5])])

but I'm not sure why no one else would've complained before, if that
were necessary...

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Support for idempotent schema changes?

2007-03-04 Thread Joshua D. Drake

David Lowe wrote:

Within the context of a script, executing:

Begin
Statement1
Statement2
Statement3
Commit

Where I only wish to commit if the error is specific to the object
already existing, and rollback for all other errors, what's the best way
to accomplish that?
  
You would have to put each statement into a savepoint, and catch each 
error that occured and commit or rollback to a savepoint

based on that result.

Joshua D. Drake





-Original Message-
From: Peter Eisentraut [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 03, 2007 11:45 PM

To: pgsql-general@postgresql.org
Cc: David Lowe
Subject: Re: [GENERAL] Support for idempotent schema changes?

David Lowe wrote:
  

So how can I make statements of the form:



  

*  alter table only customers add constraint
a_previously_missed_constraint unique (a, b, c);

*  add column points int4 not null default 0;



  

idempotent?



You just ignore the error if the object already exists.

  



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 17:09, Martijn van Oosterhout wrote:
 On Sun, Mar 04, 2007 at 05:05:44PM +, Garry Saddington wrote:
  On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote:
   On 04/03/2007 16:16, Garry Saddington wrote:
I tried pgAdmin3 on windows to run 'select now()'  and it still does
not return the correct datestyle.
  
   Probably a silly question, but did you remember to restart the server
   after changing the datestyle setting?
 
  yes
  regards

 Can you show us your exact output so we don't have to guess? I get
 this:

 # set datestyle=iso,dmy;
 SET
 # select now();
   now
 ---
  2007-03-04 18:07:54.626267+01
 (1 row)

 Which is precisely what I expect.
Which is precisely what I get, but I want  04-03-2007.
regards
Garry

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[GENERAL] real multi-master replication?

2007-03-04 Thread hubert depesz lubaczewski

hi,
i read about some replication system for postgresql, but - as far as i
know there is none real multi-master replication system for
postgresql.
all i have seen are based on query replication with various hacks
for specific constructions (like now()).
my question is - is there any (even fully commercial) multi-master
replication system for postgresql that will work with all possible
constructs, triggers, random data and so on?
i mean - i dont want to bother with choosing to 'note' somehow that
'this particular query' has to be replicated somehow.
i'm thinking about working solution that will allow multi-master connections.

anything? anywhere?

depesz

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] supporting 2000 simultaneous connections.

2007-03-04 Thread Joris Dobbelsteen
-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Shiva Sarna
Sent: vrijdag 2 maart 2007 6:03
To: Bill Moran; Joshua D. Drake
Cc: Shiva Sarna; pgsql-general@postgresql.org
Subject: Re: [GENERAL] supporting 2000 simultaneous connections.

Hi,

Thanks for your reply and help.

The web application I am talking about is a Learning 
Management System. 

By simultaneous users I mean that all 2000 users should be 
able to access the application and for example say take a test.

As Bill Moran already said:
You might want to take some time to investigate what simultaneous
users really means for your application.  For example, in a web
application, 2000 simultaneous users usually equates to less than 100
actual database connections, as web users spend most of their time
reading pages and very little time actually talking to the database.
This should also be true for your application too, especially since it's
a web application. You don't need a persistent connection per user, but
can rather share then between different users.

When taking tests I'm not that fast and reading, thinking and clicking
will take some seconds. Your system is well capable of storing my
answers quickly enough (and probably getting the question as well).

We are using JNDI connection pooling.

I think we have to now think about upgrading the hardware as well.

Test this first with you existing setup.
Remember, 2000 web clients is not the same as 2000 database connections!
Your question was if most likely interpreted whether postgres can
sustain 2000 connections to the database at once, rather than whether it
can handle 2000 web users.

- Joris

thanks for your time.

regards

Shiva


--- Bill Moran [EMAIL PROTECTED] wrote:

 In response to Joshua D. Drake
 [EMAIL PROTECTED]:
 
  Bill Moran wrote:
   In response to Shiva Sarna
 [EMAIL PROTECTED]:
   
   Hi,
  
   I am working on a web application where the
 front end is struts framework
   and back end is PgSQL 7.4.
  
  *cough*, you are going to greatly decrease your
 ability to scale if you
  are running anything less than 8.1.
   
   Performance _will_ degrade if all of those
 connections are busy at once, but
   that's going to happen with any shared system. 
 The disk can only read from
   one area at a time, and other system resources
 will be contended for as well.
  
  7.4 doesn't scale to what he wants, even on big
 hardware.
 
 Oops ... didn't notice that.
 
 --
 Bill Moran
 Collaborative Fusion Inc.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell

On 04/03/2007 18:56, Garry Saddington wrote:

# select now();
  now
---
 2007-03-04 18:07:54.626267+01
(1 row)

Which is precisely what I expect.

Which is precisely what I get, but I want  04-03-2007.


Ahh! Then you need to use to_char(). The datestyle setting in 
postgresql.conf differentiates *only* between European and American date 
formats - i.e. the relative order of day and month. It doesn't set the 
exact output format.


Ray.

---
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
---

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell

On 04/03/2007 19:26, Raymond O'Donnell wrote:

Ahh! Then you need to use to_char(). The datestyle setting in 


http://www.postgresql.org/docs/8.2/static/functions-formatting.html

---
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
---

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Postgres User

Hi,

I'm using this code to increment a counter table:

IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN
   UPDATE counter_tbl SET  counter_fld = counter_fld + 1
 WHERE key_fld = 'key_val';
 ELSE
   INSERT INTO counter_tbl(key_fld, counter_fld) VALUES('key_val', 1);
END IF;

Now, I assume that it's possible for another session to INSERT a row
in the microseconds that exist between the Select and Insert
statements above.

I also assume that I can wrap the above code in a transaction, and if
the transaction fails (because another session's Insert causes my
Insert to fail), then I simply need to re-execute it once. (Updates
should never fail.)

Does anyone have a simple example of the best way to code this type of
transaction- and the best way to re-execute the same code on failure?
I could use a loop but I'm not sure if that's the best solution.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Bill Moran
hubert depesz lubaczewski [EMAIL PROTECTED] wrote:

 hi,
 i read about some replication system for postgresql, but - as far as i
 know there is none real multi-master replication system for
 postgresql.
 all i have seen are based on query replication with various hacks
 for specific constructions (like now()).
 my question is - is there any (even fully commercial) multi-master
 replication system for postgresql that will work with all possible
 constructs, triggers, random data and so on?
 i mean - i dont want to bother with choosing to 'note' somehow that
 'this particular query' has to be replicated somehow.
 i'm thinking about working solution that will allow multi-master connections.
 
 anything? anywhere?

Have you looked at pgpool?

-- 
Bill Moran
http://www.potentialtech.com

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Stefan Kaltenbrunner
Bill Moran wrote:
 hubert depesz lubaczewski [EMAIL PROTECTED] wrote:
 hi,
 i read about some replication system for postgresql, but - as far as i
 know there is none real multi-master replication system for
 postgresql.
 all i have seen are based on query replication with various hacks
 for specific constructions (like now()).
 my question is - is there any (even fully commercial) multi-master
 replication system for postgresql that will work with all possible
 constructs, triggers, random data and so on?
 i mean - i dont want to bother with choosing to 'note' somehow that
 'this particular query' has to be replicated somehow.
 i'm thinking about working solution that will allow multi-master connections.

 anything? anywhere?
 
 Have you looked at pgpool?

afaik pgpool is statement based and not really multimaster either ...


Stefan

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Bill Moran
Stefan Kaltenbrunner [EMAIL PROTECTED] wrote:

 Bill Moran wrote:
  hubert depesz lubaczewski [EMAIL PROTECTED] wrote:
  hi,
  i read about some replication system for postgresql, but - as far as i
  know there is none real multi-master replication system for
  postgresql.
  all i have seen are based on query replication with various hacks
  for specific constructions (like now()).
  my question is - is there any (even fully commercial) multi-master
  replication system for postgresql that will work with all possible
  constructs, triggers, random data and so on?
  i mean - i dont want to bother with choosing to 'note' somehow that
  'this particular query' has to be replicated somehow.
  i'm thinking about working solution that will allow multi-master 
  connections.
 
  anything? anywhere?
  
  Have you looked at pgpool?
 
 afaik pgpool is statement based and not really multimaster either ...

Well, it's multi-master to the degree that all servers are read/write,
and therefore any server can take over.

How would you define multi-master?

-- 
Bill Moran
http://www.potentialtech.com

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Stefan Kaltenbrunner
Bill Moran wrote:
 Stefan Kaltenbrunner [EMAIL PROTECTED] wrote:
 Bill Moran wrote:
 hubert depesz lubaczewski [EMAIL PROTECTED] wrote:
 hi,
 i read about some replication system for postgresql, but - as far as i
 know there is none real multi-master replication system for
 postgresql.
 all i have seen are based on query replication with various hacks
 for specific constructions (like now()).
 my question is - is there any (even fully commercial) multi-master
 replication system for postgresql that will work with all possible
 constructs, triggers, random data and so on?
 i mean - i dont want to bother with choosing to 'note' somehow that
 'this particular query' has to be replicated somehow.
 i'm thinking about working solution that will allow multi-master 
 connections.

 anything? anywhere?
 Have you looked at pgpool?
 afaik pgpool is statement based and not really multimaster either ...
 
 Well, it's multi-master to the degree that all servers are read/write,
 and therefore any server can take over.

not sure I follow - pgpool will simply replay the queries to each
backend-server that are going through it.
You cannot directly write to the servers (well you can - but that will
likely cause inconsistent data) - and you have all the problems with
non-determinstic queries as well as problems of getting a node back in
sync after a downtime or connection loss.

 
 How would you define multi-master?

for true multimaster one would expect to be able to write to all the
nodes and keep the data consistent/sync or have some sort of conflict
resolution for an async solution.

Stefan

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Devrim GÜNDÜZ
Hi,

On Sun, 2007-03-04 at 20:18 +0100, hubert depesz lubaczewski wrote:
 anything? anywhere?

PGCluster may be the thing that you are looking for. However, if you are
looking at something that is similar to Oracle's RAC, it is the
PGCluster-II that you are looking for, which is under heavy development
right now.

Regards,
-- 
Devrim GÜNDÜZ
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/




signature.asc
Description: This is a digitally signed message part


Re: [GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Berend Tober

Postgres User wrote:

I'm using this code to increment a counter table:

IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN
   UPDATE counter_tbl SET  counter_fld = counter_fld + 1
 WHERE key_fld = 'key_val';
 ELSE
   INSERT INTO counter_tbl(key_fld, counter_fld) VALUES('key_val', 1);
END IF;

Now, I assume that it's possible for another session to INSERT a row
in the microseconds that exist between the Select and Insert
statements above.

I also assume that I can wrap the above code in a transaction, and if
the transaction fails (because another session's Insert causes my
Insert to fail), then I simply need to re-execute it once. (Updates
should never fail.)

Does anyone have a simple example of the best way to code this type of
transaction- and the best way to re-execute the same code on failure?
I could use a loop but I'm not sure if that's the best solution.


I think I would try the INSERT first. If it fails, then trap the 
exception and do the UPDATE



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Postgres User

The best answer: RTFM!

I found this example in the docs, although it should really exit the
Loop after 10 failed attempts instead of going indefinitely:

CREATE FUNCTION merge_db(key INT, data TEXT) RETURNS VOID AS
$$
BEGIN
   LOOP
   UPDATE db SET b = data WHERE a = key;
   IF found THEN
   RETURN;
   END IF;

   BEGIN
   INSERT INTO db(a,b) VALUES (key, data);
   RETURN;
   EXCEPTION WHEN unique_violation THEN
   -- do nothing
   END;
   END LOOP;
END;
$$
LANGUAGE plpgsql;


On 3/4/07, Berend Tober [EMAIL PROTECTED] wrote:

Postgres User wrote:
 I'm using this code to increment a counter table:

 IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN
UPDATE counter_tbl SET  counter_fld = counter_fld + 1
  WHERE key_fld = 'key_val';
  ELSE
INSERT INTO counter_tbl(key_fld, counter_fld) VALUES('key_val', 1);
 END IF;

 Now, I assume that it's possible for another session to INSERT a row
 in the microseconds that exist between the Select and Insert
 statements above.

 I also assume that I can wrap the above code in a transaction, and if
 the transaction fails (because another session's Insert causes my
 Insert to fail), then I simply need to re-execute it once. (Updates
 should never fail.)

 Does anyone have a simple example of the best way to code this type of
 transaction- and the best way to re-execute the same code on failure?
 I could use a loop but I'm not sure if that's the best solution.

I think I would try the INSERT first. If it fails, then trap the
exception and do the UPDATE




---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


[GENERAL] plpgsql and insert

2007-03-04 Thread Jamie Deppeler

Hi,

Have a quick question is possible to record a primary from a insert stament

eg

xprimary :=  insert into schema.table(.,.,.,.) VALUES ();


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] plpgsql and insert

2007-03-04 Thread Andrej Ricnik-Bay

Please say that again in English?

On 3/5/07, Jamie Deppeler [EMAIL PROTECTED] wrote:

Hi,

Have a quick question is possible to record a primary from a insert stament

eg

xprimary :=  insert into schema.table(.,.,.,.) VALUES ();


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster




--
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Joshua D. Drake

hubert depesz lubaczewski wrote:

hi,
i read about some replication system for postgresql, but - as far as i
know there is none real multi-master replication system for
postgresql.
all i have seen are based on query replication with various hacks
for specific constructions (like now()).
my question is - is there any (even fully commercial) multi-master
replication system for postgresql that will work with all possible
constructs, triggers, random data and so on?

Not that I know of no.

Sincerely,

Joshua D. Drake



i mean - i dont want to bother with choosing to 'note' somehow that
'this particular query' has to be replicated somehow.
i'm thinking about working solution that will allow multi-master 
connections.


anything? anywhere?

depesz

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings




---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Joshua D. Drake



Well, it's multi-master to the degree that all servers are read/write,
and therefore any server can take over.

How would you define multi-master?

  
Per the original posts consideration, pgpool would have to be able to 
deal with constants such as now() and current_date.

Can it?

Joshua D. Drake





---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] Cannot digest subscribe

2007-03-04 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


 I just signed up for the mailing list, but when I tried to change  
 over to a digest subscription, I got an error back from the server.   
 The instructions I followed were from http://archives.postgresql.org/ 
 pgsql-general/ .

It looks like the directions on that page are incorrect - I'll see about 
getting them fixed. I've set your subscription to digest manually. For 
the record, the correct command to subscribe in digest mode is:

subscribe-set pgsql-general digest


Thanks for letting us know about the problem.

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

-BEGIN PGP SIGNATURE-

iD8DBQFF63UNvJuQZxSWSsgRA6WQAJ9PhmXeuuxgfggMklXfo/Ph5A0qJQCeJgcN
TxaPV7RU5ETVBflXpRbcEB4=
=5qbK
-END PGP SIGNATURE-



---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[GENERAL] COPY from and NULL values for double precisions fields

2007-03-04 Thread Andrej Ricnik-Bay

Hi Guys,

I'm currently mucking around w/ importing TAB-delimited files;
how can I import empty values into a double precision field?

COPY complains about nothing between the TABS, about \N
and other variations, as being
invalid input syntax for type double precision:

What *is* valid syntax for this?  Can't find it for the life of me.


Cheers,
Andrej

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] COPY from and NULL values for double precisions fields

2007-03-04 Thread Walter Vaughan

Andrej Ricnik-Bay wrote:


I'm currently mucking around w/ importing TAB-delimited files;
how can I import empty values into a double precision field?

COPY complains about nothing between the TABS, about \N
and other variations, as being
invalid input syntax for type double precision:


For best help it would be good to include your copy statement. As a guess, I'd 
say you need to include the following in the statement...


NULL ''

--
Walter

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Bill Moran
Stefan Kaltenbrunner [EMAIL PROTECTED] wrote:

 Bill Moran wrote:
  Stefan Kaltenbrunner [EMAIL PROTECTED] wrote:
  Bill Moran wrote:
  hubert depesz lubaczewski [EMAIL PROTECTED] wrote:
  hi,
  i read about some replication system for postgresql, but - as far as i
  know there is none real multi-master replication system for
  postgresql.
  all i have seen are based on query replication with various hacks
  for specific constructions (like now()).
  my question is - is there any (even fully commercial) multi-master
  replication system for postgresql that will work with all possible
  constructs, triggers, random data and so on?
  i mean - i dont want to bother with choosing to 'note' somehow that
  'this particular query' has to be replicated somehow.
  i'm thinking about working solution that will allow multi-master 
  connections.
 
  anything? anywhere?
  Have you looked at pgpool?
  afaik pgpool is statement based and not really multimaster either ...
  
  Well, it's multi-master to the degree that all servers are read/write,
  and therefore any server can take over.
 
 not sure I follow - pgpool will simply replay the queries to each
 backend-server that are going through it.

I guess I'm comparing it to Slony, which has a clear delineation between
master and slave.  With pgpool, you don't have the failover procedure in
the same way, in that each server can be read/write at all times.

 You cannot directly write to the servers (well you can - but that will
 likely cause inconsistent data) - and you have all the problems with
 non-determinstic queries as well as problems of getting a node back in
 sync after a downtime or connection loss.

Right.

  How would you define multi-master?
 
 for true multimaster one would expect to be able to write to all the
 nodes and keep the data consistent/sync or have some sort of conflict
 resolution for an async solution.

Something more like pgcluster II.

-- 
Bill Moran
http://www.potentialtech.com

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] COPY from and NULL values for double precisions fields

2007-03-04 Thread Andrej Ricnik-Bay

On 3/5/07, Walter Vaughan [EMAIL PROTECTED] wrote:


For best help it would be good to include your copy statement. As a guess, I'd
say you need to include the following in the statement...

NULL ''

Thanks Walter, I found the cause of my troubles;  it wasn't copy,
it was the data.  I didn't check the structure, and copy fell over
the stupid line-feeds (^M) in the file.


Cheers,
Andrej

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


[GENERAL] Postgres Replication

2007-03-04 Thread Mageshwaran

Hi ,

Is there any way to do replication in postgres.. Please give me any idea 
to do replication...




Regards
J Mageshwaran


** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail  notify us 
immediately at [EMAIL PROTECTED]



Watch the latest updates on Mumbai, with video coverage of news, events,
Bollywood, live darshan from Siddhivinayak temple and more, only on
www.mumbailive.in

Watch the hottest videos from Bollywood, Fashion, News and more only on
www.sifymax.com


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Steve Atkins


On Mar 4, 2007, at 11:18 AM, hubert depesz lubaczewski wrote:


hi,
i read about some replication system for postgresql, but - as far as i
know there is none real multi-master replication system for
postgresql.
all i have seen are based on query replication with various hacks
for specific constructions (like now()).
my question is - is there any (even fully commercial) multi-master
replication system for postgresql that will work with all possible
constructs, triggers, random data and so on?
i mean - i dont want to bother with choosing to 'note' somehow that
'this particular query' has to be replicated somehow.
i'm thinking about working solution that will allow multi-master  
connections.


I don't believe there is, or can be, any asynchronous multi-master
replication system for any database that will work with all possible
general purpose constructs.

Given that, you might need to be more specific about your
needs (and rethink your application architecture based on the
reality of the issue), unless the constraints of synchronous
replication work for you particular problem space.

Cheers,
  Steve


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] real multi-master replication?

2007-03-04 Thread Tom Lane
Steve Atkins [EMAIL PROTECTED] writes:
 On Mar 4, 2007, at 11:18 AM, hubert depesz lubaczewski wrote:
 i read about some replication system for postgresql, but - as far as i
 know there is none real multi-master replication system for
 postgresql.

 I don't believe there is, or can be, any asynchronous multi-master
 replication system for any database that will work with all possible
 general purpose constructs.

Even more to the point: there is no universally applicable replication
solution.  If something such as the OP asks for existed, its overhead
would be so extreme that hardly anyone would use it for real-world
cases.  So compromise is always the order of the day.

 Given that, you might need to be more specific about your
 needs (and rethink your application architecture based on the
 reality of the issue),

Exactly.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[GENERAL] Query timing

2007-03-04 Thread Naz Gassiep
Using EXPLAIN ANALYZE I can get the execution time of a query. Is there 
a command I can use to get the execution time without the planning 
information? I just need to time lots of queries that have complex plans 
and it'd be easier if I didn't have pages and pages of planning info 
between tries. The queries themselves are one line each, but refer to 
views, which make the plans pretty complex. Being able to see several 
times in one terminal window would be easier.


Thanks,
- Naz.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] Query timing

2007-03-04 Thread Jorge Godoy
Naz Gassiep [EMAIL PROTECTED] writes:

 Using EXPLAIN ANALYZE I can get the execution time of a query. Is there a
 command I can use to get the execution time without the planning information?
 I just need to time lots of queries that have complex plans and it'd be easier
 if I didn't have pages and pages of planning info between tries. The queries
 themselves are one line each, but refer to views, which make the plans pretty
 complex. Being able to see several times in one terminal window would be
 easier.

Write the queries in a file, run them with psql -f and grep for the desired
lines only.

-- 
Jorge Godoy  [EMAIL PROTECTED]

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] Postgres Replication

2007-03-04 Thread Joshua D. Drake

Mageshwaran wrote:

Hi ,

Is there any way to do replication in postgres.. Please give me any 
idea to do replication...



entering postgresql replication into google brings up:

www.commandprompt.com
www.greenplum.com (kind of different but sure)

And don't forget:

www.slony.info

And PITR.

Lastly, perhaps the documentation would service you.

Joshua D. Drake





Regards
J Mageshwaran


** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity 
to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable 
law. If this is a forwarded message, the content of this E-MAIL may 
not have been sent with the authority of the Company. If you are not 
the intended recipient, an agent of the intended recipient or a  
person responsible for delivering the information to the named 
recipient,  you are notified that any use, distribution, transmission, 
printing, copying or dissemination of this information in any way or 
in any manner is strictly prohibited. If you have received this 
communication in error, please delete this mail  notify us 
immediately at [EMAIL PROTECTED]



Watch the latest updates on Mumbai, with video coverage of news, events,
Bollywood, live darshan from Siddhivinayak temple and more, only on
www.mumbailive.in

Watch the hottest videos from Bollywood, Fashion, News and more only on
www.sifymax.com


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match




---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] Query timing

2007-03-04 Thread A. Kretschmer
am  Mon, dem 05.03.2007, um 15:28:29 +1100 mailte Naz Gassiep folgendes:
 Using EXPLAIN ANALYZE I can get the execution time of a query. Is there 
 a command I can use to get the execution time without the planning 

Within psql, the command-line-interface, you can use \timing to switch
on/off reporting the execution time.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] date format

2007-03-04 Thread Tino Wildenhain

Garry Saddington schrieb:
I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still 
rendered in the format (y,m,d) . How can I change this behaviour? 
regards

garry


See my answer on the Zope list. The style however influences the way
dates are parsed by default, so you need to take care when you
feed dates from your application to database.
You should also use to_date() to make it explicit.

Regards
Tino

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] Query timing

2007-03-04 Thread Naz Gassiep
That's not quite as fast as I would like to do it, that throws in a few 
more steps which slow down the development process. However if there is 
no way I will persevere with the method I have now.

Thanks,
- Naz.

Jorge Godoy wrote:

Naz Gassiep [EMAIL PROTECTED] writes:

  

Using EXPLAIN ANALYZE I can get the execution time of a query. Is there a
command I can use to get the execution time without the planning information?
I just need to time lots of queries that have complex plans and it'd be easier
if I didn't have pages and pages of planning info between tries. The queries
themselves are one line each, but refer to views, which make the plans pretty
complex. Being able to see several times in one terminal window would be
easier.



Write the queries in a file, run them with psql -f and grep for the desired
lines only.

  


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster