Re: [GENERAL] Error: column "host" does not exist

2009-01-08 Thread A. Kretschmer
In response to Mayuresh Nirhali : > Hello, > > I am working with 8.1.4 pgsql as my database backend. I have a function > written in plpgsql language, that queries a particular table as below, > > select host from table_host where ip_address = ip_array[i] and port = > port_array[i]; > > The que

Re: [GENERAL] Error: column "host" does not exist

2009-01-08 Thread Mayuresh Nirhali
No. there are no name clashes. I actually changed the names in posted text a bit. The arguments, declared variables and column names, all have their unique prefixes. Thanks Mayuresh Reg Me Please wrote: IS there any name clash with a function argument? -- Fahrbahn ist ein graues Band weisse

Re: [GENERAL] Error: column "host" does not exist

2009-01-08 Thread Reg Me Please
Please post is possible the code (DDL and function). Otherwise it'd be much more difficult. And if you change the names, please check whether the error is still there. -- Fahrbahn ist ein graues Band weisse Streifen, grüner Rand On Thursday 08 January 2009 09:15:05 Mayuresh Nirhali wrote: > No. t

Re: [GENERAL] Error: column "host" does not exist

2009-01-08 Thread Peter Eisentraut
A. Kretschmer wrote: Not sure, but host is a reserved word, see: http://www.postgresql.org/docs/8.1/interactive/sql-keywords-appendix.html That list says that HOST is reserved in SQL:1999, but not in PostgreSQL. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

Re: [GENERAL] to_tsquery, plainto_... avoiding bad input, injections. Is there a builtin function for this ? Escaping?

2009-01-08 Thread Mohamed
. any one? On Wed, Jan 7, 2009 at 8:07 PM, Mohamed wrote: > Hi, I am wondering whether or not there exists any built in function for > making sure a query/textinput is not harmful or one that escapes them. If > not, what kind of things should I watch out for ? > As of now, I get errors on th

Re: [GENERAL] to_tsquery, plainto_... avoiding bad input, injections. Is there a builtin function for this ? Escaping?

2009-01-08 Thread Reg Me Please
Maybe I'm missing the point, but have read about quote_ident() and quote_literal() at chapter 9.4 "String Functions and Operators"? BR -- Fahrbahn ist ein graues Band weisse Streifen, grüner Rand On Thursday 08 January 2009 09:52:29 Mohamed wrote: > . any one? > > On Wed, Jan 7, 2009 at 8:0

Re: [GENERAL] RCA for MemoryContextAlloc: invalid request size(Known Issue)

2009-01-08 Thread Yogvinder Singh
What I am looking for is the version in which this problem has been resolved. I can't find it anywhere in the documentation. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David Fetter Sent: January 07, 2009 8:32 PM To

Re: [GENERAL] RCA for MemoryContextAlloc: invalid request size(Known Issue)

2009-01-08 Thread Stefan Kaltenbrunner
Yogvinder Singh wrote: What I am looking for is the version in which this problem has been resolved. I can't find it anywhere in the documentation. well there was by far not enough information in your original mail(not even the exact version you are on) to even verify that this is a data cor

[GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Thom Brown
Hi, I have a server running 8.3.1 with 16Gb of memory and 8x2.5Ghz cores. The max_connections was set to 100 (the default), but we were getting denied connections because it had exceeded the max. We increased this to a modest 250, stopped the service, and then tried to start. It wouldn't. We s

Re: [GENERAL] Adding Arabic dictionary for TSearch2.. to_tsvector('arabic'...) doesn't work..

2009-01-08 Thread Mohamed
Ok, thank you all for your help. It has been very valuable. I am starting to get the hang of it and almost read the whole chapter 12 + extras but I still need a little bit of guidance. I have now these files : - A arabic Hunspell rar file (OpenOffice version) wich includes : - ar.dic

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Harald Armin Massa
Thom, > I have a server running 8.3.1 with 16Gb of memory and 8x2.5Ghz cores. The > max_connections was set to 100 (the default), but we were getting denied > connections because it had exceeded the max. We increased this to a modest > 250, stopped the service, and then tried to start. It would

Re: [GENERAL] RCA for MemoryContextAlloc: invalid request size(Known Issue)

2009-01-08 Thread Yogvinder Singh
PostgreSQL Version PostgreSQL Release 7.3.19 installed on RHEL4. " It could simply be a query(or the OS) running out of memory." I have checked for the above situation. It's not the case. Moreover I have multiple same configuration servers. The same "select * from table" query runs on a much la

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Thom Brown
It is running on 64-bit Gentoo 2.6.25. You might be right about needing to increase the shared buffers. Thanks for the suggestion. I'll have to give that a try 2009/1/8 Harald Armin Massa > Thom, > > > I have a server running 8.3.1 with 16Gb of memory and 8x2.5Ghz cores. > The > > max_connec

Re: [GENERAL] RCA for MemoryContextAlloc: invalid request size(Known Issue)

2009-01-08 Thread Yogvinder Singh
Correcting myself: Here is the version details template1=# select version(); version --- PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gc

Re: [GENERAL] SPI_ERROR_CONNECT in plperl function

2009-01-08 Thread Christian Schröder
Tom Lane wrote: Hmph ... looks like plperl is shy a few SPI_push/SPI_pop calls. I've applied a patch for this --- it'll be in the next set of update releases. Great. Thanks a lot! The whole PostgreSQL stuff is really amazing! :-) Regards, Christian -- Deriva GmbH

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Richard Huxton
Thom Brown wrote: > It is running on 64-bit Gentoo 2.6.25. > > You might be right about needing to increase the shared buffers. Thanks for > the suggestion. I'll have to give that a try If shared_buffers was so small that you can't handle the connections you might benefit from one of the links

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Thom Brown
This database server is currently serving 3 very very busy multi-core web servers, and we're about to add another 3 to help deal with the load. I'm afraid that upgrading is not an option at present because it's in production. I've taken the suggestion of increasing shared buffers and now got max_

[GENERAL] Question about COPY command

2009-01-08 Thread Josh Harrison
Hi, A basic question about the COPY command syntax This is the syntax in the postgres manual. COPY *tablename* [ ( *column* [, ...] ) ] FROM { '*filename*' | STDIN } .. . What is the difference between copying from 'filename' and copying from 'stdin' ??? Thanks Josh

Re: [GENERAL] Question about COPY command

2009-01-08 Thread A. Kretschmer
In response to Josh Harrison : > Hi, > A basic question about the COPY command syntax > This is the syntax in the postgres manual. > > COPY tablename [ ( column [, ...] ) ] > > FROM { 'filename' | STDIN } > .. > . > > What is the difference between copying from 'filename' and cop

Re: [GENERAL] Question about COPY command

2009-01-08 Thread Raymond O'Donnell
On 08/01/2009 13:39, Josh Harrison wrote: > What is the difference between copying from 'filename' and copying from > 'stdin' ??? You'll see COPY from stdin in pg_dump scripts - when restoring via psql, the entire input to psql is coming from stdin, so COPY FROM stdin tells it to expect the dat

Re: [GENERAL] RCA for MemoryContextAlloc: invalid request size(Known Issue)

2009-01-08 Thread Scott Marlowe
On Thu, Jan 8, 2009 at 4:10 AM, Yogvinder Singh wrote: > Correcting myself: > > Here is the version details > > template1=# select version(); >version > > >

[GENERAL] selecting recs based on a tmp tbl vals that are wildcarded ?

2009-01-08 Thread Gauthier, Dave
I have a temp table containg wildcarded strings and I want to select values froma different table using "like" against all those wildcarded values. Here's the example... create temporary table match_these (val varchar(32)); insert into match_these (val) values ('jo%'); insert into match_these

Re: [GENERAL] Question about COPY command

2009-01-08 Thread Josh Harrison
On Thu, Jan 8, 2009 at 8:52 AM, A. Kretschmer < andreas.kretsch...@schollglas.com> wrote: > In response to Josh Harrison : > > Hi, > > A basic question about the COPY command syntax > > This is the syntax in the postgres manual. > > > > COPY tablename [ ( column [, ...] ) ] > > > > FROM {

Re: [GENERAL] selecting recs based on a tmp tbl vals that are wildcarded ?

2009-01-08 Thread Tom Lane
"Gauthier, Dave" writes: > select * from footable where name in (select val from match_these) > ... won't work because "in" implies equality. I want something like... > select * from footable where name like (select val from match_these) What you need is select * from footable where name ~~

[GENERAL] SQL state: 22P02 Error during a COPY FROM a CSV file

2009-01-08 Thread Sherman Brown
I am new to PostgresSQL and I am trying to populate a table with data from a CSV file. I have PostgresSQL loaded on a windows XP machine with multiple hard drives. The CSV file was generated from Excel 2007. I have a couple of fields with embedded commas as show in the second line of the data.

[GENERAL] version number between pgdump and server

2009-01-08 Thread Laurent ROCHE
Hello, I am trying to backup a single table using pgdump. However the command fails because pgdump considers there's a mismatch between the server version (8.3.3) and the pgdump version (8.3.0) version. I get the following message: pg_dump.exe -h my_server -p 5432 -U postgres -F p -v -f "C:\Proje

Re: [GENERAL] to_tsquery, plainto_... avoiding bad input, injections. Is there a builtin function for this ? Escaping?

2009-01-08 Thread Christopher Swingley
Greetings! > Wed, Jan 7, 2009 at 8:07 PM, Mohamed > > Hi, I am wondering whether or not there exists any built in > > function for making sure a query/textinput is not harmful or one > > that escapes them. If not, what kind of things should I watch out > > for ? > > * Reg Me Please [2009-Jan-08

Re: [GENERAL] version number between pgdump and server

2009-01-08 Thread Harald Armin Massa
Laurent, > Will it not be more reasonable to abort only if the first two numbers > mismatch but not the last one which is (AFAIK) only a patch number and does > not change the features ? it corrects bugs. Not only security vulnerabilities, but also bugs. And it may be that there is also a fixed

Re: [GENERAL] selecting recs based on a tmp tbl vals that are wildcarded ?

2009-01-08 Thread Harald Fuchs
In article <482e80323a35a54498b8b70ff2b8798003e5ac7...@azsmsx504.amr.corp.intel.com>, "Gauthier, Dave" writes: > I have a temp table containg wildcarded strings and I want to select values > froma different table using ?like? against all those wildcarded values. > Here?s > the example... > cr

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Richard Huxton
Thom Brown wrote: > This database server is currently serving 3 very very busy multi-core web > servers, and we're about to add another 3 to help deal with the load. > > I'm afraid that upgrading is not an option at present because it's in > production. Upgrading within the 8.3 series should invo

Re: [GENERAL] to_tsquery, plainto_... avoiding bad input, injections. Is there a builtin function for this ? Escaping?

2009-01-08 Thread Mohamed
Yeah, would Python protect you from that ? I am using Groovy on Grails and not sure how these things work here. Most of the time I use GORM to do my queries, but now I am stuck with SQL because of fulltext search with Postgres. Perhaps there is some similiar things in Groovy to run, I will check in

Re: [GENERAL] SQL state: 22P02 Error during a COPY FROM a CSV file

2009-01-08 Thread Richard Huxton
Sherman Brown wrote: > CREATE TABLE mp3.songs > ( > "Name" character varying[] NOT NULL, > "Artist" character varying[] NOT NULL, > "Composer" character varying[], > "Album" character varying[] NOT NULL, ... > Here are the first 4 lines from my CSV file: > Name,Artist,Composer,Album,Groupi

Re: [GENERAL] SQL state: 22P02 Error during a COPY FROM a CSV file

2009-01-08 Thread Tom Lane
Sherman Brown writes: > This is the table structure: > CREATE TABLE mp3.songs > ( > "Name" character varying[] NOT NULL, > "Artist" character varying[] NOT NULL, > "Composer" character varying[], I'll bet a large amount of money that what you want is just plain "character varying", not arra

Re: [GENERAL] version number between pgdump and server

2009-01-08 Thread Tom Lane
Laurent ROCHE writes: > I get the following message: > pg_dump.exe -h my_server -p 5432 -U > postgres -F p -v -f "C:\Projects\table.sql" -t > "\"public\".\"my_table\"" my_db > pg_dump: server version: 8.3.3; pg_dump version: 8.3.0 > pg_dump: aborting because of version mismatch (Use the -i option

Re: [GENERAL] Re: multi recordset and data type check was: Re: PL/pgSQL stored procedure returning multiple result sets (SELECTs)?

2009-01-08 Thread Bruce Momjian
Added to TODO: Add support for returning multiple result sets? * http://archives.postgresql.org/pgsql-general/2008-10/msg00454.php --- Pavel Stehule wrote: > Hello > > 2008/10/15 Bruce Momjian : > > V

Re: [GENERAL] Slow Vacuum was: vacuum output question

2009-01-08 Thread Dan Armbrust
On PostgreSQL 8.1, while a long vacuum is running, the output of vmstat 10 looks like this (sorry, can't format this very will in this e-mail client): r b swpd free buff cache si sobi bo in cs us sy id wa st 5 2112 53732 4388 116340400 13524 13

[GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Andrus
Commands: create temp table test ( id int, baas char(10) ); create temp table lisa ( id int, baas char(10) ); alter table lisa drop column id; INSERT INTO test SELECT * FROM lisa; drop table lisa; Cause error ERROR: column "id" is of type integer but expression is of type character HINT: You

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Alan Hodgson
On Thursday 08 January 2009, "Andrus" wrote: > Commands: > > create temp table test ( id int, baas char(10) ); > create temp table lisa ( id int, baas char(10) ); > alter table lisa drop column id; > INSERT INTO test SELECT * FROM lisa; > How to fix ? INSERT INTO test (baas) SELECT baas FROM l

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Raymond O'Donnell
On 08/01/2009 19:04, Andrus wrote: > create temp table test ( id int, baas char(10) ); > create temp table lisa ( id int, baas char(10) ); > alter table lisa drop column id; > INSERT INTO test SELECT * FROM lisa; > drop table lisa; > > Cause error > > ERROR: column "id" is of type integer but e

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Tom Lane
"Raymond O'Donnell" writes: > I've no idea, in any case, whether you can expect SELECTing two columns > into a one-column table to work. It won't, but the other error happens to be detected first. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@p

Re: [GENERAL] to_tsquery, plainto_... avoiding bad input, injections. Is there a builtin function for this ? Escaping?

2009-01-08 Thread Will Rutherdale (rutherw)
I'm not familiar with Python, but I have used the Perl DBI library for a long time. The DBI library gives you a database specific quote() function, and also something much stronger: prepare() and execute(). This works well with most applications, but I'm not sure how it would tie into fulltex

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Gregory Williamson
Thom Brown wrote: <...> > I actually mentioned pgPool II to my boss earlier, and it's something we > will have to seriously consider, but will have to do some research first. We had an application ported from Informix which initially required 1000+ connections to handle peak load (one of 4 server

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Joshua D. Drake
On Thu, 2009-01-08 at 12:51 -0700, Gregory Williamson wrote: > Thom Brown wrote: > <...> > > I actually mentioned pgPool II to my boss earlier, and it's > something we > > will have to seriously consider, but will have to do some research > first. > > We had an application ported from Informix whi

Re: [GENERAL] Cannot restart postgresql when increasing max_connections

2009-01-08 Thread Gregory Williamson
Joshua D. Drake spaketh: > On Thu, 2009-01-08 at 12:51 -0700, Gregory Williamson wrote: > > Thom Brown wrote: > > <...> > > > I actually mentioned pgPool II to my boss earlier, and it's > > something we > > > will have to seriously consider, but will have to do some research > > first. <...> > > U

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Andrus
Thank you. Well, you've dropped the integer column from test, so now the INSERT command is trying to stuff the char(10) value from test into the integer column in lisa - which is what the error message is telling you. INSERT INTO test SELECT * FROM lisa; I need that test table primary key col

[GENERAL] dblink between oracle and postgres?

2009-01-08 Thread Josh Harrison
Hi, Is there any utility like (oracle's dblink etc) that can establish connection between oracle and postgres database? Thanks Josh

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Andrus
Richard, Don't use SELECT * - list the columns you want to insert. I can't think why you would do that (you'll end up with nulls in the id column) but it will work. In real table id is defined as id serial primary key so I excpect that it will be populated with correct values. List of column

Re: [GENERAL] dblink between oracle and postgres?

2009-01-08 Thread Joshua D. Drake
On Thu, 2009-01-08 at 15:12 -0500, Josh Harrison wrote: > Hi, > Is there any utility like (oracle's dblink etc) that can establish > connection between oracle and postgres database? dbi-link > Thanks > Josh -- PostgreSQL Consulting, Development, Support, Training 503-667-4564 - http://www.

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Richard Huxton
Andrus wrote: > Richard, > >> Don't use SELECT * - list the columns you want to insert. I can't think >> why you would do that (you'll end up with nulls in the id column) but it >> will work. > > In real table id is defined as > > id serial primary key > > so I excpect that it will be populated

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Raymond O'Donnell
On 08/01/2009 20:10, Andrus wrote: > Thank you. > >> Well, you've dropped the integer column from test, so now the INSERT >> command is trying to stuff the char(10) value from test into the integer >> column in lisa - which is what the error message is telling you. > > INSERT INTO test SELECT * F

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Andrus
There isn't one. That's not how SQL works. You need to know what columns your tables have. If you want to update the primary key just do something like: INSERT INTO t1 SELECT * FROM t2; UPDATE t1 SET id = DEFAULT; Although if you don't know what your columns are called I can't see how you can f

Re: [GENERAL] dblink between oracle and postgres?

2009-01-08 Thread Filip Rembiałkowski
2009/1/8 Joshua D. Drake > On Thu, 2009-01-08 at 15:12 -0500, Josh Harrison wrote: > > Hi, > > Is there any utility like (oracle's dblink etc) that can establish > > connection between oracle and postgres database? > > dbi-link > In the opposite direction, you can use Oracle's feature described

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Andrus
Ray, I don't think you can - here's what the docs[1] for INSERT say: The target column names can be listed in any order. If no list of column names is given at all, the default is all the columns of the table in their declared order; or the first N column names, if there are only N columns sup

Re: [GENERAL] Question about COPY command

2009-01-08 Thread Andrej
2009/1/9 Josh Harrison : > My question is is it possible to read the oracle data from the oracle > database and copy them into postgresql database directly by using COPY > command instead of jdbc preparedstatement(INSERT command) ? Should be possible; just got to make sure that you have all the for

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Richard Huxton
Andrus wrote: >> There isn't one. That's not how SQL works. You need to know what columns >> your tables have. >> >> If you want to update the primary key just do something like: >> >> INSERT INTO t1 SELECT * FROM t2; >> UPDATE t1 SET id = DEFAULT; >> >> Although if you don't know what your columns

Re: [GENERAL] column "id" is of type integer but expression is of type character

2009-01-08 Thread Richard Huxton
Andrus wrote: > Commands: > > create temp table test ( id int, baas char(10) ); > create temp table lisa ( id int, baas char(10) ); > alter table lisa drop column id; > INSERT INTO test SELECT * FROM lisa; > drop table lisa; > > Cause error > > ERROR: column "id" is of type integer but expressi

[GENERAL] Thanx for 8.3

2009-01-08 Thread Jeremiah Jahn
Just wanted to say thank you for version 8.3. The ordered indexing has dropped some of my search times from over 30 seconds to 3. I've been beating my head against this issue for over 8 years. I will drink to you tonight. thanx again, -jj- -- When you're dining out and you suspect something's

Re: [GENERAL] Slow Vacuum was: vacuum output question

2009-01-08 Thread Scott Marlowe
On Thu, Jan 8, 2009 at 10:43 AM, Dan Armbrust wrote: > On PostgreSQL 8.1, while a long vacuum is running, the output of > vmstat 10 looks like this (sorry, can't format this very will in this > e-mail client): > > r b swpd free buff cache si sobi bo > in cs us

Re: [GENERAL] Thanx for 8.3

2009-01-08 Thread Reg Me Please
On Friday 09 January 2009 00:10:53 Jeremiah Jahn wrote: > Just wanted to say thank you for version 8.3. > > The ordered indexing has dropped some of my search times from over 30 > seconds to 3. I've been beating my head against this issue for over 8 > years. I will drink to you tonight. > > thanx a

Re: [GENERAL] Adding Arabic dictionary for TSearch2.. to_tsvector('arabic'...) doesn't work..

2009-01-08 Thread Mohamed
no one ? / Moe On Thu, Jan 8, 2009 at 11:46 AM, Mohamed wrote: > Ok, thank you all for your help. It has been very valuable. I am starting > to get the hang of it and almost read the whole chapter 12 + extras but I > still need a little bit of guidance. > > I have now these files : > >- A a