Re: [GENERAL] Identical command-line command will not work with \i metacommand and filename

2010-04-22 Thread John Gage
Yeesh. What the ding-dong is this? JohnGage:EFNWebsite johngage$ od -a CopySql.sql 000? ? ? s e l e c t sp * sp f r o m 020 sp m e s h _ d e s c r i p t o r 040s ; nl nl What are the ?'s. Mon Dieu, what is goin

Re: [GENERAL] Identical command-line command will not work with \i metacommand and filename

2010-04-22 Thread John Gage
Oh, I should add. Everything, the database, vim, is UTF-8. On Apr 22, 2010, at 3:34 AM, Scott Mead wrote: run: od -a CopySql.sql Look at the beginning, that'll show you character by character what's in there (should reveal anything hidden). -- Sent via pgsql-general mailing lis

Re: [GENERAL] installation on vista

2010-04-22 Thread Dave Page
On Thu, Apr 22, 2010 at 1:47 AM, Craig Ringer wrote: > On 22/04/2010 1:05 AM, Watson, Nathaniel wrote: >> >> I have downloaded the one click installer on Vista. > > From where? What version? > >> I right click on >> the executable and select run as administrator, and an empty dialog box >> appears

Re: [GENERAL] Identical command-line command will not work with \i metacommand and filename

2010-04-22 Thread Richard Huxton
On 22/04/10 08:24, John Gage wrote: Yeesh. What the ding-dong is this? JohnGage:EFNWebsite johngage$ od -a CopySql.sql 000 ? ? ? s e l e c t sp * sp f r o m 020 sp m e s h _ d e s c r i p t o r 040 s ; nl nl What are the ?'s. Mon Dieu, what is going on? http://en.wikipedia.org/wi

Re: [GENERAL] Identical command-line command will not work with \i metacommand and filename

2010-04-22 Thread John Gage
http://en.wikipedia.org/wiki/Byte_order_mark Tends to get added if you go through a Windows system. Useless for utf-8 afaik. Confuse the hell out of you because various tools parse and hide them then you pipe the file to a script and everything falls over. Bunch of scripts available here

Re: [GENERAL] Embedded Postgres

2010-04-22 Thread Ognjen Blagojevic
John R Pierce wrote: Ognjen Blagojevic wrote: Is there a way to run Postgres in embedded mode? More precisely, to run it without using TCP/IP port, and without installing as a service? I am aware of Unix-domain sockets, but is there something similar for Windows? on unix, as you imply, it can

Re: [GENERAL] Syntax error in trigger

2010-04-22 Thread Jignesh Shah
Thanks Anreas but I think that's not a issue. The issue is something to do with "$1". I don't know how to get rid of it. techdb=# INSERT INTO log_table(id) SELECT 5 EXCEPT SELECT id FROM log_table WHERE id = 5; INSERT 0 1 techdb=# select * from log_table; id | txid | txtime +-

Re: [GENERAL] Embedded Postgres

2010-04-22 Thread Massa, Harald Armin
Ognjen, > Is there a way to run Postgres in embedded mode? More precisely, to run it >>> without using TCP/IP port, and without installing as a service? >>> I am aware of Unix-domain sockets, but is there something similar for >>> Windows? >>> >> >> on unix, as you imply, it can be run with unix

Re: [GENERAL] Syntax error in trigger

2010-04-22 Thread Jignesh Shah
I got it resolved. I just need to put below statement into single quote instead of double quote. :) my $query ='INSERT INTO log_table(id) SELECT $1 EXCEPT SELECT id FROM log_table WHERE id = $1;'; Thanks, Jignesh On Thu, Apr 22, 2010 at 2:02 PM, Jignesh Shah wrote: > Thanks Anreas but I think t

[GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread John Gage
Well, well, well. Guess who the culprit is... I edited the file both in Vim and in pgAdmin3 (1.10.2, Mar 9 2010, rev 8217), and the BOM shows up after saving the file with pgAdmin3. I don't know if pgAdmin3 wants to keep this feature... Thank everyone again for the excellent help. John O

Re: [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread Wappler, Robert
On 2010-04-22, John Gage wrote: > Well, well, well. Guess who the culprit is... > > I edited the file both in Vim and in pgAdmin3 (1.10.2, Mar 9 > 2010, rev > 8217), and the BOM shows up after saving the file with pgAdmin3. > > I don't know if pgAdmin3 wants to keep this feature... > > Thank

[GENERAL] Getting the typename of a polymorphic function's magical $0 variable

2010-04-22 Thread Peter Geoghegan
Hello, I've written the following function: CREATE OR REPLACE FUNCTION indifferent_cast(literal_value text, type_specification anyelement) RETURNS anyelement AS $function_body$ -- This function is used when writing migrating scripts and the like. -- It attempts to cast to the datatype specified b

Re: [GENERAL] Getting the typename of a polymorphic function's magical $0 variable

2010-04-22 Thread Pavel Stehule
Hello you can use pg_typeof(some) function Regards Pavel Stehule 2010/4/22 Peter Geoghegan : > Hello, > > I've written the following function: > > CREATE OR REPLACE FUNCTION indifferent_cast(literal_value text, > type_specification anyelement) RETURNS anyelement AS > $function_body$ > -- This fu

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread John Gage
This may be germane: Filename: trunk/pgadmin3/src/ui/pgadmin3.lng Revision 2954 - (view) (download) - [select for diffs] Modified Sun Nov 30 20:13:28 2003 GMT (6 years, 4 months ago) by andreas File length: 1301 byte(s) Diff to previous 2840 adding UTF-8 BOM I do not think that it is a feature.

[GENERAL] Issue in Improving the performance using prepared plan

2010-04-22 Thread Jignesh Shah
Hi, I have written following trigger and trying to improve the performance by using prepared query everytime. I have used spi_prepare to prepare the query and $_SHARED global hash to persist the prepared plan but it doesn't seem to work. Though $query will be same always in following trigger, it p

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread Dave Page
On Thu, Apr 22, 2010 at 10:41 AM, John Gage wrote: > This may be germane: > > Filename: trunk/pgadmin3/src/ui/pgadmin3.lng > Revision 2954 - (view) (download) - [select for diffs] > Modified Sun Nov 30 20:13:28 2003 GMT (6 years, 4 months ago) by andreas > File length: 1301 byte(s) > Diff to previ

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread John Gage
I think I should clarify my original "problem" and what I see as the difficulty in general. I saved a UTF-8 file with the pgAdmin Query tool, which added the BOM to the beginning of the file during the save. I then attempted to run the file using psql with the \i meta command. I got a synt

Re: [GENERAL] Getting the typename of a polymorphic function's magical $0 variable

2010-04-22 Thread Peter Geoghegan
> Hello > > you can use pg_typeof(some) function > > Regards > Pavel Stehule That's great Pavel, thanks a lot. Regards, Peter Geoghegan -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread Magnus Hagander
On Thu, Apr 22, 2010 at 12:02, John Gage wrote: > I think I should clarify my original "problem" and what I see as the > difficulty in general. > > I saved a UTF-8 file with the pgAdmin Query tool, which added the BOM to the > beginning of the file during the save. > > I then attempted to run the

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread John Gage
Additionally, if the Vim option "bomb" is set to "nobomb" it will strip the BOM. This solves my "problem" by permitting editing files in both Vim and pgAdmin3 Query tool and then being able to run the files in psql. :set nobomb [in Vim] On Apr 22, 2010, at 12:12 PM, Magnus Hagander wro

Re: [GENERAL] Performance impact of hundreds of partitions

2010-04-22 Thread Leonardo F
> The thing that takes the longest is planning queries. I made THAT problem > just > go away for the most part by using cached queries (only works within the same > database connection, but thats no problem for me). What do you mean by "cached queries"? Prepared statements? -- Sent via

[GENERAL] How to read the execution Plan

2010-04-22 Thread akp geek
Hi all - I would request, If any one has document on how to read and interpret the postgres execution plan, can you please share it? Regards

Re: [GENERAL] Embedded Postgres

2010-04-22 Thread Ognjen Blagojevic
John R Pierce wrote: Ognjen Blagojevic wrote: Is there a way to run Postgres in embedded mode? More precisely, to run it without using TCP/IP port, and without installing as a service? I am aware of Unix-domain sockets, but is there something similar for Windows? on unix, as you imply, it can

[GENERAL] pg 8.3 windows, DB curruption, out of space

2010-04-22 Thread maksim.likharev
Hi, Having very difficult decision to make, data drive ran out of space, startup recovery says: - LOG: 58P01: could not open file "pg_xlog/000100A50016" (log file 165, segment 22): No such file or directory - last one is: 000100A50015 what is m

Re: [GENERAL] Specific database vars, again...

2010-04-22 Thread Glus Xof
Thanks to all that replied my question ! I'll implement the Thomas Kellerer's. Glus -- 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] Issue in Improving the performance using prepared plan

2010-04-22 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I have written following trigger and trying to improve the performance by > using prepared query everytime. I have used spi_prepare to prepare the query > and $_SHARED global hash to persist the prepared plan but it doesn't seem to > work. Tho

Re: [GENERAL] How to read the execution Plan

2010-04-22 Thread Ben Chobot
On Apr 22, 2010, at 5:43 AM, akp geek wrote: > Hi all - > > I would request, If any one has document on how to read and interpret > the postgres execution plan, can you please share it? http://wiki.postgresql.org/wiki/Using_EXPLAIN -- Sent via pgsql-general mailing list (pgsql-general@

Re: [GENERAL] How to read the execution Plan

2010-04-22 Thread Jaime Casanova
On Thu, Apr 22, 2010 at 7:43 AM, akp geek wrote: > Hi all - >         I would request, If any one has document on how to read and > interpret the postgres execution plan, can you please share it? http://wiki.postgresql.org/wiki/Introduction_to_VACUUM%2C_ANALYZE%2C_EXPLAIN%2C_and_COUNT http://wiki

[SPAM] Re: [GENERAL] Best way to replicate to large number of nodes

2010-04-22 Thread Ben Chobot
On Apr 21, 2010, at 1:41 PM, Brian Peschel wrote: > I have a replication problem I am hoping someone has come across before and > can provide a few ideas. > > I am looking at a configuration of on 'writable' node and anywhere from 10 to > 300 'read-only' nodes. Almost all of these nodes will b

Re: [GENERAL] How to read the execution Plan

2010-04-22 Thread Scott Marlowe
On Thu, Apr 22, 2010 at 6:43 AM, akp geek wrote: > Hi all - >         I would request, If any one has document on how to read and > interpret the postgres execution plan, can you please share it? > Regards start here: http://explain.depesz.com/ -- Sent via pgsql-general mailing list (pgsql-gen

Re: [GENERAL] Best way to replicate to large number of nodes

2010-04-22 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I am looking at a configuration of on 'writable' node and anywhere from > 10 to 300 'read-only' nodes. Almost all of these nodes will be across a > WAN from the writable node (some over slow VPN links too). I am looking > for a way to rep

Re: [pgadmin-support] [GENERAL] Byte order mark added by (the envelope please...) pgAdmin3 !!

2010-04-22 Thread Fernando Hevia
You could also disable "Read and write Unicode UTF-8 files" in Options->Preferences. It will not write a BOM but you will not have UTF-8 either. On Thu, Apr 22, 2010 at 07:29, John Gage wrote: > Additionally, if the Vim option "bomb" is set to "nobomb" it will strip the > BOM. This solves my "

Re: [GENERAL] Embedded Postgres

2010-04-22 Thread John R Pierce
Massa, Harald Armin wrote: on unix, as you imply, it can be run with unix domain sockets, but not on Windows as they simply don't have this interface. and, it can be started as an application rather than as a system service, but it still runs as a separate proc

[GENERAL] Multicolumn primary key with null value

2010-04-22 Thread Szymon Guz
Does any SQL standard allows for a multicolumn primary key where in one record there is a null in on of the primary key columns? regards Szymon Guz

[GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Morgan Taschuk
Hi, I hope someone can help me. When running psql from the command line with the PGHOST environment variable or the -h command line host set, it throws a segmentation fault. $ psql -U morgan -d cid -h localhost Segmentation fault $ export PGHOST=rhyme.ncl.ac.uk $ psql -U morgan -d cid Segmentati

Re: [GENERAL] Multicolumn primary key with null value

2010-04-22 Thread Said Ramirez
Primary keys are defined as 'unique not null' even if they are composite. So I believe postgres would not let you do that: 5.3.4. Primary Keys Technically, a primary key constraint is simply a combination of a unique constraint and a not-null constraint. A primary key indicates that a c

Re: [GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Tom Lane
Morgan Taschuk writes: > I hope someone can help me. When running psql from the command line with > the PGHOST environment variable or the -h command line host set, it > throws a segmentation fault. > $ psql -U morgan -d cid -h localhost > Segmentation fault Huh. Can you get a stack trace from

Re: [GENERAL] Error installing postgresql version higher than 8.1 on centos 5.4 linux 2.6.18-164.el5

2010-04-22 Thread MadTh
2010/4/22 Devrim GÜNDÜZ > Can we please get a > > rpm -qa|grep postgresql > > first? > Here is it : r...@server1 [~]# r...@server1 [~]# rpm -qa|grep postgresql postgresql-8.1.18-2.el5_4.1 postgresql-devel-8.1.18-2.el5_4.1 postgresql-libs-8.1.18-2.el5_4.1 postgresql-libs-8.1.18-2.el5_4.1 postg

[GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Morgan Taschuk
Hi, I hope someone can help me. When running psql from the command line with the PGHOST environment variable or the -h command line host set, it throws a segmentation fault. $ psql -U morgan -d cid -h localhost Segmentation fault $ export PGHOST=rhyme.ncl.ac.uk $ psql -U morgan -d cid Segment

Re: [GENERAL] Performance impact of log streaming replication

2010-04-22 Thread Thomas Kellerer
Andy, 21.04.2010 01:44: No I haven't. I'm using MySQL right now. But I want to learn more about Postgresql's Hot Standby and see if it offers a better replication solution. Can anyone share their experience about Postgresql replication performance impact? Thanks. You might be interested in thi

Re: [SPAM] Re: [GENERAL] Best way to replicate to large number of nodes

2010-04-22 Thread Brian Peschel
On 04/22/2010 10:12 AM, Ben Chobot wrote: On Apr 21, 2010, at 1:41 PM, Brian Peschel wrote: I have a replication problem I am hoping someone has come across before and can provide a few ideas. I am looking at a configuration of on 'writable' node and anywhere from 10 to 300 'read-only'

Re: [GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Morgan Taschuk
Hi, stack traces and other paraphernalia below: $ psql -U morgan -d cid -h localhost Segmentation fault Huh. Can you get a stack trace from that? $ gdb psql ... Reading symbols from /usr/lib/postgresql/8.4/bin/psql...(no debugging symbols found)...done. (gdb) run -U morgan -d cid -h local

Re: [GENERAL] how to debug the codes in the PostgresMain() from the begining of this function to the "for (;;)" loop that handles the connection?

2010-04-22 Thread Alvaro Herrera
sunpeng escribió: > how to debug the codes in the PostgresMain() from the begining of this > function to the "for (;;)" loop that handles the connection? > if i use eclipse cdt to attach the postgres process forked by postmaster, > this part of codes from the begining of this PostgresMain() to the

Re: [GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Richard Huxton
On 22/04/10 20:06, Morgan Taschuk wrote: Program received signal SIGSEGV, Segmentation fault. 0xb7bbb4eb in X509_VERIFY_PARAM_inherit () from /lib/i686/cmov/libcrypto.so.0.9.8 (gdb) bt #0 0xb7bbb4eb in X509_VERIFY_PARAM_inherit () from /lib/i686/cmov/libcrypto.so.0.9.8 #1 0xb7f9b61a in ssl_verify

[GENERAL] I/O error during autovacuum

2010-04-22 Thread Devrim GÜNDÜZ
I recently started seeing the following in the logs: ERROR: could not read block 46 of relation pg_tblspc/16385/8578554/11521501: Input/output error CONTEXT: automatic vacuum of table "foo.pg_toast.pg_toast_8578780" This is a Slony-I 1.2.21 slave, which runs 8.4.3 on RHEL 5.5. This toast rela

Re: [GENERAL] trying to write a bit of logic as one query, can't seem to do it under 2

2010-04-22 Thread Jonathan Vanasco
On Apr 21, 2010, at 9:38 PM, Glen Parker wrote: Not if qty_requested_available needs to be <= qty_available... indeed, i'm an idiot this week. thanks a ton. this really helped me out! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

[GENERAL] Creating indexes?

2010-04-22 Thread Bjørn T Johansen
What is the best approach for PostgreSQL when creating indexes? E.g I have two fields in a table that I want indexed, is it best to create one index combining the two fields or creating one for each field? If I create one for each field, will the search when using both fields be slower that a com

Re: [GENERAL] Creating indexes?

2010-04-22 Thread Greg Smith
Bjørn T Johansen wrote: What is the best approach for PostgreSQL when creating indexes? E.g I have two fields in a table that I want indexed, is it best to create one index combining the two fields or creating one for each field? If I create one for each field, will the search when using both f

[GENERAL] Foreign Key

2010-04-22 Thread Bob Pawley
Hi I don't understand what the following error means. I am trying to add a foreign key to table image, that holds column device_id. This is to be controlled by column devices_id in table devices. ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses (address

Re: [GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Tom Lane
Richard Huxton writes: > I'd guess the root cause is here though. You seem to be picking up some > libraries from psqlODBC rather than your main package. I'm betting it's > got some incompatible changes. Uninstall psqlodbc for a minute and see > if that solves your problem. Yeah, the fact that

Re: [GENERAL] Foreign Key

2010-04-22 Thread Szymon Guz
2010/4/23 Bob Pawley > Hi > > I don't understand what the following error means. > > I am trying to add a foreign key to table image, that holds column > device_id. This is to be controlled by column devices_id in table devices. > > ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (add

Re: [GENERAL] I/O error during autovacuum

2010-04-22 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= writes: > I recently started seeing the following in the logs: > ERROR: could not read block 46 of relation > pg_tblspc/16385/8578554/11521501: Input/output error > CONTEXT: automatic vacuum of table "foo.pg_toast.pg_toast_8578780" > Is this *definitely* a di

Re: [GENERAL] Error installing postgresql version higher than 8.1 on centos 5.4 linux 2.6.18-164.el5

2010-04-22 Thread Tom Lane
MadTh writes: > creating conversions ... FATAL: could not load library > "/usr/pgsql-9.0/lib/utf8_and_johab.so": > /usr/pgsql-9.0/lib/utf8_and_johab.so: failed to map segment from shared > object: Cannot allocate memory > STATEMENT: CREATE OR REPLACE FUNCTION johab_to_utf8 (INTEGER, INTEGER, > C

Re: [GENERAL] I/O error during autovacuum

2010-04-22 Thread Alvaro Herrera
Devrim GÜNDÜZ wrote: > > I recently started seeing the following in the logs: > > ERROR: could not read block 46 of relation > pg_tblspc/16385/8578554/11521501: Input/output error > CONTEXT: automatic vacuum of table "foo.pg_toast.pg_toast_8578780" > > This is a Slony-I 1.2.21 slave, which run

Re: [GENERAL] Creating indexes?

2010-04-22 Thread Martin Gainty
concatenated indexes deliver faster results as concatenated indexes do not require the resultsets to be merged provided the more selective column of the concatenated index is first and least selective column of the concatenated index is last http://webglobalnet.net/support/index.php?topic=864.0

Re: [GENERAL] PSQL segmentation fault after setting host

2010-04-22 Thread Craig Ringer
On 23/04/2010 2:06 AM, Tom Lane wrote: On Red Hat systems the thing to do is install the postgresql-debuginfo RPM that matches your postgresql RPMs, but I'm not sure exactly how Ubuntu packages that information. Though it turns out to be unnecessary for this person's question, for future refe

[GENERAL] Postgresql.conf - What is the default value for log_min_message?

2010-04-22 Thread Wang, Mary Y
Hi, I've two questions. (1) I updated logging_collector = true in postgresql.conf because I want to rotate the logs. I'd also like to set the log_min_message to 'debug5' so that I can better debug the code for now and will change it back to a lower level when it's in production. I'm looking at

Re: [GENERAL] Multicolumn primary key with null value

2010-04-22 Thread Craig Ringer
On 23/04/2010 1:42 AM, Said Ramirez wrote: Primary keys are defined as 'unique not null' even if they are composite. So I believe postgres would not let you do that You can, however, add a UNIQUE constraint on the column set as a whole. PostgreSQL does *not* enforce non-null in this case, so s

Re: [GENERAL] Postgresql.conf - What is the default value for log_min_message?

2010-04-22 Thread Greg Smith
Wang, Mary Y wrote: (1) I updated logging_collector = true in postgresql.conf because I want to rotate the logs. I'd also like to set the log_min_message to 'debug5' so that I can better debug the code for now and will change it back to a lower level when it's in production. I'm looking at t

Re: [GENERAL] I/O error during autovacuum

2010-04-22 Thread Devrim GÜNDÜZ
On Thu, 2010-04-22 at 18:47 -0400, Tom Lane wrote: > > Is this *definitely* a disk error, or could it be related to > PostgreSQL > > itself? > > "Input/output error" is pretty much always indicative of a hardware > problem. If it's always associated with attempts to access a specific > disk block