[GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread mona attariyan
Hi,I statically compiled my postgres and I got the following message when I ran initdb: creating conversions ... FATAL:  could not load library "/usr/local/pgsql/lib/ascii_and_mic.so": /usr/local/pgsql/lib/ascii_and_mic.so: undefined symbol: pg_ascii2micSTATEMENT:  CREATE OR REPLACE FUNCTION as

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Dmitriy Igrishin
Hey Chris, The suggestion of using for > update is a good one, but it doesn't entirely get rid of the problem, > which is inherent in ensuring gapless numbering in a system with > concurrent transactions. > Why not? I mean the following solution: CREATE TABLE myseq(tabnm text not null, lastid in

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Chris Travers
On Fri, Jul 1, 2011 at 1:16 AM, Dmitriy Igrishin wrote: > Hey Chris, > >> The suggestion of using for >> update is a good one, but it doesn't entirely get rid of the problem, >> which is inherent in ensuring gapless numbering in a system with >> concurrent transactions. > > Why not? Just because

Re: [GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread Craig Ringer
On 1/07/2011 3:28 PM, mona attariyan wrote: Hi, I statically compiled my postgres and I got the following message when I ran initdb: How did you compile Pg statically? Please show your configure command line, any environment variables you set, etc. You've also left out a huge amount of info

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Dmitriy Igrishin
2011/7/1 Chris Travers > On Fri, Jul 1, 2011 at 1:16 AM, Dmitriy Igrishin > wrote: > > Hey Chris, > > > >> The suggestion of using for > >> update is a good one, but it doesn't entirely get rid of the problem, > >> which is inherent in ensuring gapless numbering in a system with > >> concurrent

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Craig Ringer
On 1/07/2011 4:21 PM, Chris Travers wrote: means a possibility of deadlocks and performance issues. These issues are inherent in gapless numbering because you can't get a gapless sequence when things roll back without such locks. Actually, another approach that allows parallel transactions is

[GENERAL] Anonymous record type and inner types.

2011-07-01 Thread Ronan Dunklau
Hello. Sorry if this question has already been asked, but I couldn't find the answer anywhere. When I execute a statement such as "Select (an_int, a_varchar) as a_record from test, the type returned for a_record is "record" (oid 2249). Is the "inner type" information propagated somehow (that a

[GENERAL] Anonymous record type and inner types.

2011-07-01 Thread rdunklau
This message has been digitally signed by the sender. _GENERAL__Anonymous_record_type_and_inner_types_.eml Description: Binary data - Hi-Tech Gears Ltd, Gurgaon, India -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread mona attariyan
Sorry about the incomplete question. I'm compiling postgres 9.0.4 from source code and I got the tar ball from here: http://www.postgresql.org/ftp/source/v9.0.4/ I'm using Postgres to evaluate a research tool and the tool doesn't work with dynamic libraries. That's why I need to compile it stati

[GENERAL] pg_rman in Windows - is it possible?

2011-07-01 Thread AI Rumman
Could anyone please tell me whether I can use pg_rman in my Windows environment? Or is there any similar type of application for windoes Postgresql?

Re: [GENERAL] pg_rman in Windows - is it possible?

2011-07-01 Thread Fujii Masao
On Fri, Jul 1, 2011 at 6:18 PM, AI Rumman wrote: > Could anyone please tell me whether I can use pg_rman in my Windows > environment? http://code.google.com/p/pg-rman/wiki/Platforms According to the above page, you cannot use it on Windows. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHO

Re: [GENERAL] pg_rman in Windows - is it possible?

2011-07-01 Thread Tomonari Katsumata
Hi, sorry, pg_rman can not use for windows environment. This is an issue for a long time, but I can not revise it for some reasons. (If you can make patch for revising them, welcome.) (2011/07/01 18:18), AI Rumman wrote: Could anyone please tell me whether I can use pg_rman in my Windows enviro

[GENERAL] roles

2011-07-01 Thread salah jubeh
I have two databases, I need to insure that both databases has the same roles. tables, schemas, views must have the same permissions and privileges. you can say and Identical clones. I can synchronise the roles using these statments SELECT DISTINCT 'CREATE USER '||usename||';' FROM pg_user

Re: [GENERAL] roles

2011-07-01 Thread salah jubeh
Hello, I have two databases, I need to insure that both databases has the same roles. tables, schemas, views must have the same permissions and privileges. you can say and Identical clones. I can synchronize the roles using these statements SELECT DISTINCT 'CREATE USER '||usename||';' FRO

Re: [GENERAL] roles

2011-07-01 Thread Rob Richardson
As I understand things, roles are not specific to databases. In PGAdmin, when I connect to a server, I see five collections of objects: databases, tablespaces, jobs, group roles, and login roles. Roles are separate from databases. So, for a given server, login and group roles apply to all databa

Re: [GENERAL] roles

2011-07-01 Thread Chris Travers
On Fri, Jul 1, 2011 at 5:06 AM, salah jubeh wrote: > > Hello, > > I have two databases, I need to insure that both databases has the same > roles.  tables, schemas, views must have the same permissions and > privileges. you can say and Identical clones. I can synchronize the roles > using these st

Re: [GENERAL] pg_rman in Windows - is it possible?

2011-07-01 Thread AI Rumman
But is there any similar kind of application for Windows Postgresql Backup? On Fri, Jul 1, 2011 at 3:39 PM, Tomonari Katsumata < katsumata.tomon...@po.ntts.co.jp> wrote: > Hi, > > sorry, pg_rman can not use for windows environment. > This is an issue for a long time, but I can not revise it for s

Re: [GENERAL] question about query

2011-07-01 Thread David Johnston
-Original Message- i have created the union to get all the records (giving payments negative sign) but what i don't know how to do it is use a window function to create the column with the running total, any short example of syntax please? >> You'll need to check the documentation

Re: [GENERAL] Anonymous record type and inner types.

2011-07-01 Thread Adrian Klaver
On Friday, July 01, 2011 1:37:44 am Ronan Dunklau wrote: > Hello. > > Sorry if this question has already been asked, but I couldn't find the > answer anywhere. > > When I execute a statement such as "Select (an_int, a_varchar) as a_record > from test, the type returned for a_record is "record" (o

[GENERAL] \i command in dblink

2011-07-01 Thread AI Rumman
I have a file as follows: \set counter 10 \set name_test 'abc' This file is used to set some psql client variables. My problem is that, how I can call this file from dblink connection. That is, I need to use \i in dblink connection. Any idea please. -- Sent via pgsql-general mailing list (pgs

[GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-01 Thread Olivier LEVESQUE
Hi, I am currently testing pg_upgrade (in copy mode)  to migrate a 8.4.4 old cluster to a new 9.0.3 one. It runs fine except when databases contain tablespaces $pg_upgrade -d /pgqdata/pgserver01/data -D /pgqdata/pgserver02/data -b /opt/pgsql/na/8.4.4/bin -B /opt/pgsql/na/9.0.3/bin -p 5432 -P 543

Re: [GENERAL] Anonymous record type and inner types.

2011-07-01 Thread Daniele Varrazzo
On Fri, Jul 1, 2011 at 9:37 AM, Ronan Dunklau wrote: > When I execute a statement such as "Select (an_int, a_varchar) as a_record > from test, the type returned for a_record is "record" (oid 2249). > > Is the "inner type" information propagated somehow (that an_int is an integer, > and a_varchar

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-01 Thread Guillaume Lelarge
On Fri, 2011-07-01 at 16:24 +0200, Olivier LEVESQUE wrote: > Hi, > > I am currently testing pg_upgrade (in copy mode) to migrate a 8.4.4 > old cluster to a new 9.0.3 one. > It runs fine except when databases contain tablespaces > > > $pg_upgrade -d /pgqdata/pgserver01/data -D /pgqdata/pgserver0

Re: [GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread Craig Ringer
On 1/07/2011 5:11 PM, mona attariyan wrote: > CFLAGS="-O0 -I/[PATH]/glibc-2.5.1-custom/prefix/include -static Yeah, it's not as simple as that, because Pg expects to be dynamically linked and to be able to dlopen() libraries and dlsym() resolve function pointers from them at runtime. > creat

Re: [GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread Tom Lane
Craig Ringer writes: > On 1/07/2011 5:11 PM, mona attariyan wrote: >> I'm using Postgres to evaluate a research tool and the tool doesn't work >> with dynamic libraries. That's why I need to compile it statically. > For your purposes, you'll have to modify PostgreSQL to support being > built sta

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-01 Thread Olivier LEVESQUE
Guillaume, Thank you for your answer, >> Creating databases in the new cluster >> psql:/opt/pgsql/bin/pg_upgrade_dump_globals.sql:38: ERROR:  directory >> "/pgqdata/pgserver01/data/tbs_ptest/PG_9.0_201008051" already in use >> as a tablespace >> > > That would mean that you have a 9.0 tablespace

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-01 Thread Guillaume Lelarge
On Fri, 2011-07-01 at 18:30 +0200, Olivier LEVESQUE wrote: > Guillaume, > > Thank you for your answer, > > > >> Creating databases in the new cluster > >> psql:/opt/pgsql/bin/pg_upgrade_dump_globals.sql:38: ERROR: directory > >> "/pgqdata/pgserver01/data/tbs_ptest/PG_9.0_201008051" already in u

[GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Rich Shepard
I've examined the 9.0 manual page on alter table without seeing how to add a foreign key constraint to a column. I needed to make changes on a couple of existing tables which could be accomplished only by dropping the foreign key constraint. That, and changing the table structure, column name

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Adrian Klaver
On Friday, July 01, 2011 2:00:38 pm Rich Shepard wrote: >I've examined the 9.0 manual page on alter table without seeing how to > add a foreign key constraint to a column. > >I needed to make changes on a couple of existing tables which could be > accomplished only by dropping the foreign

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Joshua D. Drake
On 07/01/2011 02:00 PM, Rich Shepard wrote: I've examined the 9.0 manual page on alter table without seeing how to add a foreign key constraint to a column. I needed to make changes on a couple of existing tables which could be accomplished only by dropping the foreign key constraint. That, and

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Thom Brown
On 1 July 2011 22:00, Rich Shepard wrote: >  I've examined the 9.0 manual page on alter table without seeing how to add > a foreign key constraint to a column. > >  I needed to make changes on a couple of existing tables which could be > accomplished only by dropping the foreign key constraint. Th

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Rich Shepard
On Fri, 1 Jul 2011, Joshua D. Drake wrote: alter table bar add foreign key (id) references foo(id); Thanks, Josh. I was close, but not exact. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Thom Brown
On 1 July 2011 22:00, Rich Shepard wrote: >  I've examined the 9.0 manual page on alter table without seeing how to add > a foreign key constraint to a column. > >  I needed to make changes on a couple of existing tables which could be > accomplished only by dropping the foreign key constraint. Th

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread Rich Shepard
On Fri, 1 Jul 2011, Thom Brown wrote: By the way, rather than dropping the foreign key then recreating it, you could always do this: ALTER TABLE tablename DISABLE TRIGGER ALL; Then it would ignore the foreign key trigger and you could put in mischievous values... but remember to enable it agai

Re: [GENERAL] Adding Foreign Key Constraint To Existing Table

2011-07-01 Thread David Johnston
A foreign key is a kind of constraint. Section 5.5.3 has example syntax to add constraints, including a foreign key constraint. In alter table the part "ADD table_constraint" is what you want to follow (it leads you to the create table page for the formal syntax to use). David J. On Jul 1, 20

Re: [GENERAL] statically compiling postgres and problem with initdb

2011-07-01 Thread Craig Ringer
On 1/07/2011 11:48 PM, Tom Lane wrote: It might be easier to rip out the functionality that expects loadable libraries to work. I think you could probably get through initdb if you just disabled creation of encoding-conversion functions and text search dictionaries (try #ifdef'ing out the relev

[GENERAL] dblink and insert?

2011-07-01 Thread Andrew Shved
I want to ghave a driger from host1, database1, table1 to host2, database2, table2. To insert the same row into table2 only if the row matches certain conditions. I am not clear how to write dblink function to do that. Can someone ofer a piece of code to put inside of my trigger function on hos