Re: [GENERAL] Connect to a database in a .sql file

2005-11-07 Thread Assad Jarrahian
Hi,     Lets say the script is called myDBSetup.sql And the script contains: //CREATE DATABASE section //CREATE USERS SECTION //COnnect to db //CREATE TABLES, FUNCTIONS etc. this script will be called from psql. The user will log connect to template1 and then run my script. What I really need is

[GENERAL] odbc in postgresql and php

2005-11-07 Thread Bob Powell
Hello everyone,   Has anyone installed the postgres php driver.  I would like to know how to install it on Linux and then what the proper way to access it is from a php web page.  I have been unable to find actual code for php and doing this.  Please help.  Tha

Re: [GENERAL] [HACKERS] Help with Array Function in C language...

2005-11-07 Thread Cristian Prieto
Thanks a lot, but I still getting an error message like this: ERROR: cache lookup failed for type 0 What is wrong? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Lane Sent: Lunes, 07 de Noviembre de 2005 05:17 p.m. To: Cristian Prieto Cc: pgsql-gener

Re: [GENERAL] [HACKERS] Help with Array Function in C language...

2005-11-07 Thread Tom Lane
"Cristian Prieto" <[EMAIL PROTECTED]> writes: > Datum > test_array(PG_FUNCTION_ARGS) > { > ArrayType *v = PG_GETARG_ARRAYTYPE_P(1); > Datum element; > Oidarray_type = get_array_type(v); I think you want get_element_type, instead. And you definitely ought to be check

Re: [GENERAL] Perl::DBI and interval syntax

2005-11-07 Thread Tom Lane
Allen <[EMAIL PROTECTED]> writes: > SELECT count(*) from post where post_ts >= current_date - interval ? This is not right, and never has been right, even though it may have accidentally failed to fail with some client libraries. Try CAST(? as interval) (SQL standard)

[GENERAL] Help with Array Function in C language...

2005-11-07 Thread Cristian Prieto
Hello, I'm doing a very simple C language function in PostgreSQL but I can't figure out why this is not working, the documentation about the PostgreSQL internals is not so good about arrays and I couldn't find a suitable example of the use of some kind of array functions inside the pgsql source tre

[GENERAL] Perl::DBI and interval syntax

2005-11-07 Thread Allen
Hi again! I have a perl program running a query on FreeBSD under PostgreSQL 7.4.8 that has worked for some time. Converting the program to Linux under PostgreSQL 8.0.3 returns a database error. The interval clause is the issue. SELECT count(*) from post where post_ts >= current_date - interv

[GENERAL] [OTAnn] Feedback

2005-11-07 Thread shenanigans
I was interested in getting feedback from current mail group users.We have mirrored your mail list in a new application that provides a more aggregated and safe environment which utilizes the power of broadband.Roomity.com v 1.5 is a web 2.01 community webapp. Our newest version adds broadcast vide

Re: [GENERAL] Question about 8.1 release news

2005-11-07 Thread Marko Kreen
On Sun, Nov 06, 2005 at 04:35:24PM -0400, Marc G. Fournier wrote: > Once released, the more visibility, the better :) Release is schedualed > right now for Tuesday morning ... Just a nitpick - should the version be 8.1.0 or 8.1? 'configure.in' says ATM '8.1.0' but the usual would be '8.1'... --

[GENERAL] Get One item from an array..

2005-11-07 Thread Cristian Prieto
Hi! I have a little trouble with a SP written in C language, I have a function which get an array as parameter, I know I could get the array using ArrayType *elements = PG_GETARG_ARRAY_P(n) but what about if I only want to get just the N element from the array? For example the 3 element of this arr

[GENERAL] CA spins off Ingres to a new company

2005-11-07 Thread Ned Lilly
This has been in the works for some time, but it's finally official: http://www.infoworld.com/article/05/11/07/CHNcaspinsingres_1.html http://www.ingres.com/ Ingres CEO: "Our goal is to become the leading business open-source database supplier to the enterprise community." Cheers, Ned -

Re: [GENERAL] Programmatic method to determine currently installed Windows PostrgreSQL version

2005-11-07 Thread Will Wright
--- Magnus Hagander <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm in the process of creating an Windows > installation > > package for a product that uses PostgreSQL. > > > > During the installation I would like to check if > PostgreSQL > > is installed and if it is, which version. > > > > I

Re: [GENERAL] Programmatic method to determine currently installed Windows PostrgreSQL version

2005-11-07 Thread Magnus Hagander
> Hi, > > I'm in the process of creating an Windows installation > package for a product that uses PostgreSQL. > > During the installation I would like to check if PostgreSQL > is installed and if it is, which version. > > I think that I can infer that PostgreSQL is installed by > searching f

Re: [GENERAL] Changing ids conflicting with serial values?

2005-11-07 Thread Scott Marlowe
On Fri, 2005-11-04 at 15:49, Marc Boucher wrote: > At 11:49 04/11/2005 -0500, Alex Turner wrote: > > I think he meant > > > > create sequence test_seq; > > select setval('test_seq',(select max(primary_key_id) from my_table)); > > > > not max value of a serial type. > > What I understand, and from

Re: [GENERAL] Setting max_fsm_pages

2005-11-07 Thread Carlos Oliva
Hi Jim, Thank you for your help. We are going to increase the max_fxm_pages according to the test I have been running through out the week. If we increase the max_fsm_pages, do we need to bump up the shared_buffers and the size of the shared memory segment of the Linux kernel(shmmax)? -Origi

[GENERAL] Programmatic method to determine currently installed Windows PostrgreSQL version

2005-11-07 Thread Will Wright
Hi, I'm in the process of creating an Windows installation package for a product that uses PostgreSQL. During the installation I would like to check if PostgreSQL is installed and if it is, which version. I think that I can infer that PostgreSQL is installed by searching for the \HKLM\SOFTWARE\P

Re: [GENERAL] How to create a virtual column

2005-11-07 Thread Jim C. Nasby
On Mon, Nov 07, 2005 at 07:05:14AM +0100, A. Kretschmer wrote: > am 06.11.2005, um 22:54:15 + mailte Chris folgendes: > > Andreas Kretschmer spamfence.net> writes: > > > Chris gmail.com> schrieb: > > > > > > > How do I create a virtaul column? > > > > > > A view. Example: > > > > Is a vie

Re: [GENERAL] Setting max_fsm_pages

2005-11-07 Thread Jim C. Nasby
On Sun, Nov 06, 2005 at 08:05:29PM -0500, Carlos Oliva wrote: > Thank you for your response Tom. > > Should I set the max_fsm_pages to the "total pages needed" obtained from a > full vacuum or from a analize vacuum? When I run a vacuum analyze (vacuumdb > -z -v), I get a smaller number of pages n

Re: [GENERAL] PROBLEM: Function does not exist

2005-11-07 Thread Douglas McNaught
[EMAIL PROTECTED] writes: > Hello, > >I have problem that I can't to call function because postgres > can't to find this function with specified parameters and I receive > following error: > > Caused by: java.sql.SQLException: ERROR: function > update_bf_domain(integer, character varying, char

Re: [GENERAL] PROBLEM: Function does not exist

2005-11-07 Thread Tom Lane
[EMAIL PROTECTED] writes: > Caused by: java.sql.SQLException: ERROR: function update_bf_domain(integer, > character varying, > character varying, timestamp with time > zone) does not exist > CREATE OR REPLACE FUNCTION UPDATE_BF_DOMAIN > ( >

[GENERAL] PROBLEM: Function does not exist

2005-11-07 Thread juleni
Hello, I have problem that I can't to call function because postgres can't to find this function with specified parameters and I receive following error: Caused by: java.sql.SQLException: ERROR: function update_bf_domain(integer, character varying, characte

Re: [GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Martijn van Oosterhout
On Mon, Nov 07, 2005 at 09:47:21AM -0500, Tom Lane wrote: > Guido Neitzer <[EMAIL PROTECTED]> writes: > > I have linked the LC_COLLATE for de_DE.UTF-8 to the same LC_COLLATE > > file that works fine with ISO8859-1. > > Um ... why would you expect that to work at all? Aren't the collation > file

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > On Nov 7, 2005, at 23:24 , Tom Lane wrote: >> Strictly speaking, you need this: >> select bar_id, array_accum(foo_value) from >> (select * from ordered_foo order by bar_id, foo_pos) as ss >> group by bar_id order by bar_id; >> ie, sort

Re: [GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Tom Lane
Guido Neitzer <[EMAIL PROTECTED]> writes: > I have linked the LC_COLLATE for de_DE.UTF-8 to the same LC_COLLATE > file that works fine with ISO8859-1. Um ... why would you expect that to work at all? Aren't the collation files very dependent on the encoding? regards, to

Re: [GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Martijn van Oosterhout
On Mon, Nov 07, 2005 at 02:28:05PM +0100, Guido Neitzer wrote: > I think I was the one who asked. > > I worked on my locale problem on the weekend and was able to build a > LC_COLLATE file, that actually works with ISO locales, but not with > UTF-8 (50% progress ... ;-)). Guess the problem is

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Michael Glaesemann
On Nov 7, 2005, at 23:24 , Tom Lane wrote: Strictly speaking, you need this: select bar_id, array_accum(foo_value) from (select * from ordered_foo order by bar_id, foo_pos) as ss group by bar_id order by bar_id; ie, sort the subselect by the grouping key of the outer q

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Michael Glaesemann wrote: >> I'm trying to concatenate strings in variable orders using a custom >> aggregate. > Just use a subselect -- you're looking for this, correct? > regression=# select bar_id, array_accum(foo_value) from (select * from > ordere

Re: [GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Guido Neitzer
On 07.11.2005, at 14:07 Uhr, Martijn van Oosterhout wrote: We had this question earlier this week. Mac OS X uses the locales from FreeBSD, and neither support UTF-8 collation at all. You'll see exactly the same results from other UNIX utilities. I think I was the one who asked. I worked on

Re: [GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Martijn van Oosterhout
On Mon, Nov 07, 2005 at 12:50:18PM +0100, Guido Neitzer wrote: > Hi. > > I have a problem with PostgreSQL and UTF-8 on my Mac OS X Powerbook. > > > - System is Mac OS X Client 10.4.3, PostgreSQL 8.1beta3 > > - initdb was called with -E UTF-8 --locale=de_DE.UTF-8 We had this question earlier th

[GENERAL] PostgreSQL, UTF-8 and Mac OS X

2005-11-07 Thread Guido Neitzer
Hi. I have a problem with PostgreSQL and UTF-8 on my Mac OS X Powerbook. - System is Mac OS X Client 10.4.3, PostgreSQL 8.1beta3 - initdb was called with -E UTF-8 --locale=de_DE.UTF-8 I have successfully build a LC_COLLATE file for ISO8859-15, and ordering works there if I do the initdb wit

Re: [GENERAL] I just can't get it:record_in, record_out(I know i try to do something postgres is not developed for but there are many 'buts')

2005-11-07 Thread Peter Filipov
I figured out how to do it, myself. Just wondering why nobody answers me, maybe I ask dumb questions Cheers! -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the pl

[GENERAL] Recuperate each line of a result into a variable ?

2005-11-07 Thread ctobini
Hello, I would like to know how to recuperate the results of a request. I read the O'Reilly book about Postgresql and and know there are 2 ways in PL/pgSQL to do that : 1. declare variable type; select into variable column for table where... 2. declare variable table%ROWTYPE for variable in sel

Re: [GENERAL] Oracle 10g Express - any danger for Postgres?

2005-11-07 Thread Mariusz Czułada
On Sunday 30 of October 2005 20:17, Bruce Momjian wrote: > Nikolay Samokhvalov wrote: > > http://www.oracle.com/technology/software/products/database/xe/index.html > > http://news.zdnet.com/2100-3513_22-5920796.html > > > > 'Oracle intends to release a free version of its database, a reaction > > t

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Roger Hand
On Monday, November 07, 2005 12:12 AM Michael Glaesemann wrote: > > select bar_id, array_accum(foo_value) > from ordered_foo > group by bar_id > order by bar_id; > bar_id | array_accum > +- >1 | {delta,alpha,charlie,bravo} >2 | {C,B,A,D}

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Michael Glaesemann
On Nov 7, 2005, at 17:40 , Roger Hand wrote: On Monday, November 07, 2005 12:12 AM Michael Glaesemann wrote: select bar_id, array_accum(foo_value) from ordered_foo group by bar_id order by bar_id; bar_id | array_accum +- 1 | {delta,alpha,char

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Joe Conway
Michael Glaesemann wrote: I'm trying to concatenate strings in variable orders using a custom aggregate. However, I'm having a difficult time figuring out the SQL I need to use to accomplish this. Here's a test case that shows the error I'm getting. select bar_id, array_accum(foo_value) f

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread David Fetter
On Mon, Nov 07, 2005 at 05:12:05PM +0900, Michael Glaesmann wrote: > I'm trying to concatenate strings in variable orders using a custom > aggregate. However, I'm having a difficult time figuring out the > SQL I need to use to accomplish this. How about using the ARRAY() constructor as below? >

Re: [GENERAL] Using native win32 psql.exe using alternative cygwin

2005-11-07 Thread Richard van den Berg
Bill Bartlett wrote: > I hit this exact same problem, and my initial reaction was the same as > yours -- psql was "hanging". After much head-banging, I discovered that > it is not in fact hanging, but is instead getting confused by being run > from inside Putty, Cygwin, xterm, rxvt terminal, etc.

Re: [GENERAL] Using native win32 psql.exe using alternative cygwin

2005-11-07 Thread Richard van den Berg
Reid Thompson wrote: > ala http://www.cygwin.com/ml/cygwin/2003-03/msg01457.html perhaps...??? Yes, indeed. It seems like a generic problem with running native windows appplications with buffered output under a cygwin terminal emulator. It's good to know the root of the problem, so I can still use

[GENERAL] Aggregates, group, and order by

2005-11-07 Thread Michael Glaesemann
I'm trying to concatenate strings in variable orders using a custom aggregate. However, I'm having a difficult time figuring out the SQL I need to use to accomplish this. Here's a test case that shows the error I'm getting. select version();