Re: [GENERAL] PQexec(), what should I do for the "NULL in command" problem?

2007-11-12 Thread Martijn van Oosterhout
On Tue, Nov 13, 2007 at 10:52:09AM +0800, yang zhenyu wrote: > > > But there exist "\0" in some data filed, and I found PQexec() failed > > > on such situation. > > Thanks for reply :-) > But would you please give me more details or some references? > > > Two ways: > > - out of line parameters >

Re: [GENERAL] Calculation for Max_FSM_pages : Any rules of thumb?

2007-11-12 Thread Ow Mun Heng
On Thu, 2007-11-08 at 12:02 -0500, Bill Moran wrote: > Frequently, when people ask for help because they've exceed max_fsm*, > it's because they're not paying attention to their systems, and therefore > the problem has been occurring for a while before it got so bad that > they couldn't ignore it.

Re: [GENERAL] Accessing a db with pgAdmin

2007-11-12 Thread Albe Laurenz
Kent Miller wrote: > Background - I am having a problem accessing a remote postgreSQL db > from my laptop using an ssh tunnel and pgAdmin. I had postgreSQL > loaded on my computer for use as a test db, but removed it. Including > deleting the postgeSQL, and pgadmin directories after using the > win

Re: [GENERAL] Using generate_series to create a unique ID in a query?

2007-11-12 Thread Pavel Stehule
Hello use temporary sequence instead. postgres=#create temp sequence a; CREATE SEQUENCE postgres=# select nextval('a'), b FROM (values(1),(2),(10),(20)) b(b); nextval | b -+ 1 | 1 2 | 2 3 | 10 4 | 20 (4 rows) Regards Pavel Stehule On 13/11/2007, Sarah D

Re: [GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Robert Treat
On Tuesday 13 November 2007 00:07, Greg Smith wrote: > On Mon, 12 Nov 2007, Mason Hale wrote: > > After the wal segment file is copied by the restore_command script, is > > it safe to delete it from my archive? > > While I believe you can toss them immediately, you should considering > keeping thos

Re: [GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Merlin Moncure
On Nov 12, 2007 11:03 PM, Mason Hale <[EMAIL PROTECTED]> wrote: > > your i/o must be really random to be seeing numbers that lousy (10 > > seconds to replay a file is 1.6 megabytes/sec), or there is some other > > unexplained problem with your server. is your raid controller > > properly caching w

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread hubert depesz lubaczewski
On Mon, Nov 12, 2007 at 05:18:28PM -0500, Tom Lane wrote: > regression=# select '00123'::text like '0%'; > ?column? > -- > t > (1 row) > regression=# select '00123'::int4 like '0%'; > ?column? > -- > f > (1 row) i think it's definitelly ok - '00123'::text is *not equal* to '0

Re: [GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Greg Smith
On Mon, 12 Nov 2007, Mason Hale wrote: After the wal segment file is copied by the restore_command script, is it safe to delete it from my archive? While I believe you can toss them immediately, you should considering keeping those around for a bit regardless as an additional layer of disast

Re: [GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Mason Hale
> your i/o must be really random to be seeing numbers that lousy (10 > seconds to replay a file is 1.6 megabytes/sec), or there is some other > unexplained problem with your server. is your raid controller > properly caching wites? have you benchmarked the volume with bonnie++ > or similar tool (

Re: [GENERAL] PQexec(), what should I do for the "NULL in command" problem?

2007-11-12 Thread yang zhenyu
On Nov 12, 2007 11:13 PM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Thu, Nov 08, 2007 at 06:39:23PM -0800, jason wrote: > > As you know the interface of PQexec(): > > PGresult *PQexec(PGconn *conn, const char *command); > > > > "command" contains some SQL statements. > > > > But there

Re: [GENERAL] FreeBSD portupgrade of 8.1 -> 8.2

2007-11-12 Thread Decibel!
You can force the pkg_delete with -f (or maybe -F). You'll want to delete all the postgresql (ie: postgresql-*) packages as well, and then re-install them after you install 8.2. On Nov 12, 2007, at 5:39 PM, Steve Manes wrote: I've got 8.1 running fine. I want to upgrade to 8.2. Problem is,

Re: [GENERAL] Updated .vim file

2007-11-12 Thread Decibel!
On Oct 31, 2007, at 9:33 AM, Filip Rembiałkowski wrote: 2007/10/30, Decibel! <[EMAIL PROTECTED]>: Does anyone have a .vim file that takes dollar quoting into account? I've tried the one mentioned at http://archives.postgresql.org/pgsql-general/2006-04/ msg01266.php , but it doesn't appear to u

Re: [GENERAL] FreeBSD portupgrade of 8.1 -> 8.2

2007-11-12 Thread Steve Manes
Steve Manes wrote: What's the portupgrade process in FreeBSD?? (Fixed. The answer is to use pg_delete -f on the old package to force the delete) ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archive

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Craig White
On Fri, 2007-11-09 at 23:55 -0500, Mark Niedzielski wrote: > Our developers run on MacBook Pros w/ 2G memory and our production > hardware is dual dual-Core Opterons w/ 8G memory running CentOS 5. The > Macs perform common and complex Postgres operations in about half the > time of our unloaded pr

Re: [GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Merlin Moncure
On Nov 12, 2007 6:59 PM, Mason Hale <[EMAIL PROTECTED]> wrote: > I am setting up a warm standby configuration as described here: > > http://www.postgresql.org/docs/8.2/static/warm-standby.html > > Using PostgreSql 8.2.5 > > My production server is archiving 16MB wal segment files at a rate of 1 > e

[GENERAL] PITR and warm standby setup questions

2007-11-12 Thread Mason Hale
I am setting up a warm standby configuration as described here: http://www.postgresql.org/docs/8.2/static/warm-standby.html Using PostgreSql 8.2.5 My production server is archiving 16MB wal segment files at a rate of 1 every 5 to 10 seconds My standby server is processing the wal segment files a

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Sam Mason
On Mon, Nov 12, 2007 at 05:02:52PM -0500, Vivek Khera wrote: > On Nov 12, 2007, at 12:29 PM, Sam Mason wrote: > >You only need a 64bit address space when each process wants to see > >more than ~3GB of RAM. > > And how exactly do you get that on a 32-bit CPU? I didn't mean to suggest you could. Yo

[GENERAL] FreeBSD portupgrade of 8.1 -> 8.2

2007-11-12 Thread Steve Manes
I've got 8.1 running fine. I want to upgrade to 8.2. Problem is, FreeBSD's portupgrade utility only wants to upgrade my existing 8.1 installation. So I grabbed the latest ports collection, which includes postgresql82-client and postgresql82-server. Running 'make install' on postgresql82-cl

[GENERAL] Using generate_series to create a unique ID in a query?

2007-11-12 Thread Sarah Dougherty
Hello, I am trying to create a view that will contain a generated sequence (unique ID), and am running into problems doing so. For some context, I am trying to create a report that provides a list of client charges and payments and a "running balance" after each transaction. Because we ofte

Re: [GENERAL] update record with two-column primary key

2007-11-12 Thread Scott Marlowe
OK, a followup. The problem is that your where clause in your update rule isn't selective enough, so you're actually trying to update all the rows that match just the one column in your where clause. Here's an example: Note that I've disabled your pk so you can see what's happening: drop table

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes: > Any recommendations on how one might go about generating a list of all of the > removed implicit casts? Compare 8.2 and 8.3 contents of pg_cast? regards, tom lane ---(end of broadcast)

Re: [GENERAL] update record with two-column primary key

2007-11-12 Thread Scott Marlowe
Please keep replies on the list, it's more likely to find an answer with many eyes on the problem. On Nov 12, 2007 4:13 PM, Charles Mortell <[EMAIL PROTECTED]> wrote: > Thanks for your response, Scott. > The primary keys of projectdata.business_list are item_id and business. They > are from the tw

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Tom Lane
hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > On Mon, Nov 12, 2007 at 11:26:09AM -0500, Tom Lane wrote: >> hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: >>> on the other hand. while i know and understand why there can't be "=" >>> operator for text and int, i think that "like" cou

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-12 Thread Tom Lane
=?ISO-8859-1?Q?Christian_Schr=F6der?= <[EMAIL PROTECTED]> writes: > [ ongoing saga ] Hah, I've got it. (Should have searched Red Hat's bugzilla sooner.) What you are hitting is a glibc bug, as explained here: http://sources.redhat.com/ml/libc-hacker/2007-10/msg00010.html If libpthread is loaded a

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Vivek Khera
On Nov 12, 2007, at 12:01 PM, Greg Smith wrote: Not the Mac OS BSD. Last time I looked into this OS X was still dramatically slower than Linux on things like process creation. On MacOS X, that's the Mach kernel doing process creation, not anything BSD-ish at all. The BSD flavor of MacOS

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Vivek Khera
On Nov 12, 2007, at 12:29 PM, Sam Mason wrote: You only need a 64bit address space when each process wants to see more than ~3GB of RAM. And how exactly do you get that on a 32-bit CPU? Even with PAE (shudders from memories of expanded/extended RAM in the DOS days), you still have a 32

Re: [GENERAL] Duplicating a table row while honouring key constraints

2007-11-12 Thread Alvaro Herrera
Gordon wrote: > At first I thought INSERT INTO table_name SELECT * from table_name > where primary_key = unique_value would do it, but that would obviously > violate the primary key uniqueness constraint. I'm wondering if > there's a way to do this where I only grab the data to be copied and > le

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Robert Treat
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > > On Mon, Nov 12, 2007 at 02:46:50PM +0100, Karsten Hilbert wrote: > >> It surely makes sense - in your environment - but it's not > >> the only interpretation so PG tries to be impartial and > >> makes both of us say clearly what we want. > > >

Re: [GENERAL] WAL segments size

2007-11-12 Thread Greg Smith
On Mon, 12 Nov 2007, Bruno Almeida do Lago wrote: One of our PostgreSQL databases is generating archive logs too frequently, since the number of transactions/s (inserts & updates) is very high. If the problem is that the archive logs are too frequent, then suggestions so far like increasing c

Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?

2007-11-12 Thread Andrew Dunstan
Andrew Dunstan wrote: Ugh, in testing I see some nastiness here without any explicit require. It looks like there's an implicit require if the text contains certain chars. I'll see what I can do to fix the bug, although I'm not sure if it's possible. Looks like it's going to be very h

Re: [GENERAL] reverse strpos?

2007-11-12 Thread hubert depesz lubaczewski
On Mon, Nov 12, 2007 at 10:54:53AM -0500, Gauthier, Dave wrote: > Is there a function that'll return the position of the last occurance of > a char in a string? > For Example, in the string 'abc/def/ghi' I want the position of the 2nd > '/'. # select length(substring('abc/def/ghi' from '^(.*/)'

Re: [GENERAL] WAL segments size

2007-11-12 Thread Scott Marlowe
On Nov 12, 2007 2:14 PM, Bruno Almeida do Lago <[EMAIL PROTECTED]> wrote: > Hi, > > One of our PostgreSQL databases is generating archive logs too frequently, > since the number of transactions/s (inserts & updates) is very high. > > I was looking for a parameter on postgresql.conf to increase the

Re: [GENERAL] WAL segments size

2007-11-12 Thread Andrew Sullivan
On Mon, Nov 12, 2007 at 05:14:24PM -0300, Bruno Almeida do Lago wrote: > I was looking for a parameter on postgresql.conf to increase the WAL > segments size, but according to documentation this can only be changed while > building PostgreSQL. You mean this: http://www.postgresql.org/docs/8.2/sta

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread hubert depesz lubaczewski
On Mon, Nov 12, 2007 at 11:26:09AM -0500, Tom Lane wrote: > hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > > on the other hand. while i know and understand why there can't be "=" > > operator for text and int, i think that "like" could be readded as it is > > really clear about how it work

Re: [GENERAL] Open Source GIS System

2007-11-12 Thread mgainty
have you had a chance to look at University of Minn Mapping Server? http://www.esri.com/software/arcgis/arcgismobile/index.html M-- - Original Message - Wrom: OQKEDOTWFAOBUZXUWLSZLKBRNVW To: Sent: Thursday, November 08, 2007 3:14 PM Subject: [GENERAL] Open Source GIS System > Hi, > >

[GENERAL] WAL segments size

2007-11-12 Thread Bruno Almeida do Lago
Hi, One of our PostgreSQL databases is generating archive logs too frequently, since the number of transactions/s (inserts & updates) is very high. I was looking for a parameter on postgresql.conf to increase the WAL segments size, but according to documentation this can only be changed while bui

Re: [HACKERS] [GENERAL] Is "query" a reserved word in 8.3 plpgsql?

2007-11-12 Thread Todd A. Cook
Tom Lane wrote: It turned out to be a very easy change, so it's done: QUERY isn't a reserved word anymore. Thanks for your help. :) -- todd ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 12 Nov 2007 10:47:29 -0700 Steve Wampler <[EMAIL PROTECTED]> wrote: > Sam Mason wrote: > > And what's the performance hit of using native 64bit code? I'd > > guess similar, moving twice as much data around with each pointer > > has got to aff

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Sam Mason
On Mon, Nov 12, 2007 at 11:46:12AM -0600, Scott Marlowe wrote: > On Nov 12, 2007 11:37 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > > And what's the performance hit of using native 64bit code? I'd guess > > similar, moving twice as much data around with each pointer has got to > > affect things. >

Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?

2007-11-12 Thread Andrew Dunstan
Andrew Dunstan wrote: Greg Sabino Mullane wrote: Yes, we might want to consider making utf8 come pre-loaded for plperl. There is no direct or easy way to do it (we don't have finer-grained control than the 'require' opcode), but we could probably dial back restrictions, 'use' it, and th

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Douglas McNaught
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > On Nov 12, 2007 11:37 AM, Sam Mason <[EMAIL PROTECTED]> wrote: >> And what's the performance hit of using native 64bit code? I'd guess >> similar, moving twice as much data around with each pointer has got to >> affect things. > > That's not been my

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Steve Wampler
Sam Mason wrote: And what's the performance hit of using native 64bit code? I'd guess similar, moving twice as much data around with each pointer has got to affect things. That's probably difficult to predict. Since the architecture is 64-bits, it shouldn't cost any more to move a 64-bit poin

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Scott Marlowe
On Nov 12, 2007 11:37 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > On Mon, Nov 12, 2007 at 11:31:59AM -0600, Scott Marlowe wrote: > > On Nov 12, 2007 11:29 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > > > You don't need a 32bit kernel to support 8GB of memory should you? As > > > long as the kernel sup

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Steve Wampler
Scott Marlowe wrote: On Nov 12, 2007 11:29 AM, Sam Mason <[EMAIL PROTECTED]> wrote: You don't need a 32bit kernel to support 8GB of memory should you? As long as the kernel supports PAE that should be enough to make use of it. You only need a 64bit address space when each process wants to see mo

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Sam Mason
On Mon, Nov 12, 2007 at 11:31:59AM -0600, Scott Marlowe wrote: > On Nov 12, 2007 11:29 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > > You don't need a 32bit kernel to support 8GB of memory should you? As > > long as the kernel supports PAE that should be enough to make use of it. > > You only need a

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Scott Marlowe
On Nov 12, 2007 11:29 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > On Mon, Nov 12, 2007 at 10:14:46AM -0700, Steve Wampler wrote: > > Also, what kernel are you using with CentOS 5 - a 32-bit (with hugemem > > to support the 8GB) or a 64-bit? And which was PostgreSQL compiled for? > > You don't need

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Sam Mason
On Mon, Nov 12, 2007 at 10:14:46AM -0700, Steve Wampler wrote: > Also, what kernel are you using with CentOS 5 - a 32-bit (with hugemem > to support the 8GB) or a 64-bit? And which was PostgreSQL compiled for? You don't need a 32bit kernel to support 8GB of memory should you? As long as the kerne

Re: [GENERAL] Filter tables

2007-11-12 Thread Reg Me Please
Il Monday 12 November 2007 18:10:40 Osvaldo Rosario Kussama ha scritto: > Try: > SELECT DISTINCT t1.id FROM t1 > WHERE NOT EXISTS (SELECT f1.t FROM f1 > WHERE NOT EXISTS (SELECT x1.t FROM t1 x1 > WHERE f1.t = x1.t >

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 09 Nov 2007 23:55:59 -0500 Mark Niedzielski <[EMAIL PROTECTED]> wrote: > > Our developers run on MacBook Pros w/ 2G memory and our production > hardware is dual dual-Core Opterons w/ 8G memory running CentOS 5. > The Macs perform common and c

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Steve Wampler
On Fri, 9 Nov 2007, Mark Niedzielski wrote: The Macs perform common and complex Postgres operations in about half the time of our unloaded production hardware. Also, what kernel are you using with CentOS 5 - a 32-bit (with hugemem to support the 8GB) or a 64-bit? And which was PostgreSQL compi

Re: [GENERAL] Filter tables

2007-11-12 Thread Osvaldo Rosario Kussama
Reg Me Please escreveu: Il Monday 12 November 2007 17:05:18 Dimitri Fontaine ha scritto: Hi, Le lundi 12 novembre 2007, Reg Me Please a écrit : What I'd need to do is to "filter" t1 against f1 to get only the rows ( 'field1',1 ) and ( 'field2',1 ). select * from t1 natural join f1 where t1.id

Re: [GENERAL] reverse strpos?

2007-11-12 Thread Pavel Stehule
On 12/11/2007, Gauthier, Dave <[EMAIL PROTECTED]> wrote: > > > > > Is there a function that'll return the position of the last occurance of a > char in a string? > > Hello simply install and use orafce http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29 Regards Pavel Stehule > > For E

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Greg Smith
On Fri, 9 Nov 2007, Mark Niedzielski wrote: The Macs perform common and complex Postgres operations in about half the time of our unloaded production hardware. Are they write intensive? If so, it may be possible that the Macs are buffering disk writes while production server isn't. It's oft

Re: [GENERAL] reverse strpos?

2007-11-12 Thread A. Kretschmer
am Mon, dem 12.11.2007, um 8:48:29 -0800 mailte David Fetter folgendes: > > > Is there a function that?ll return the position of the last > > > occurance of a char in a string? > > > > > > > write a function to revert the string and use strpos(). > > > > create or replace function rev(varchar

Re: [GENERAL] update record with two-column primary key

2007-11-12 Thread Scott Marlowe
On Nov 12, 2007 10:41 AM, Charles Mortell <[EMAIL PROTECTED]> wrote: > Using PG 8.0 on Windows, I have a table 'business_list' with a two column > primary key. It's a linking table and it's primary keys are the keys from > the two tables I am linking: item_id and business. > Should I be able to upd

Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?

2007-11-12 Thread Andrew Dunstan
Greg Sabino Mullane wrote: Yes, we might want to consider making utf8 come pre-loaded for plperl. There is no direct or easy way to do it (we don't have finer-grained control than the 'require' opcode), but we could probably dial back restrictions, 'use' it, and then reset the Safe contain

Re: [GENERAL] reverse strpos?

2007-11-12 Thread Gauthier, Dave
Great suggestions (I have just GOT to get the IS people around here to install plperl). Leveraging what Andreas sent, I created my own strrpos create or replace function strrpos(varchar,varchar) returns int as $$ declare _count int; begin for _count in reverse length($1)..1 loop

Re: [GENERAL] reverse strpos?

2007-11-12 Thread David Fetter
On Mon, Nov 12, 2007 at 05:19:25PM +0100, A. Kretschmer wrote: > am Mon, dem 12.11.2007, um 10:54:53 -0500 mailte Gauthier, Dave folgendes: > > Is there a function that?ll return the position of the last > > occurance of a char in a string? > > > > For Example, in the string ?abc/def/ghi? I want

Re: [GENERAL] plperl and regexps with accented characters - incompatible?

2007-11-12 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 hubert depesz lubaczewski writes: ... > return (shift =~ /[a-z0-9_-]+/i) || 0; ... > 'require' trapped by operation mask at line 15. > > it looks strange - what "require"? As you guessed, it's trying to do load the utf8 pragma, and failing as

[GENERAL] update record with two-column primary key

2007-11-12 Thread Charles Mortell
Using PG 8.0 on Windows, I have a table 'business_list' with a two column primary key. It's a linking table and it's primary keys are the keys from the two tables I am linking: item_id and business. Should I be able to update one of those primary key fields? Here is the SQL: UPDATE projectdata.bus

[GENERAL] Strange error while working with derived table

2007-11-12 Thread Erwin Moller
Hi, Working on postgres8.1 in PHP, I came in the situation I needed to create a derived table. Consider the following query: SELECT tempwordstable.zoekwoord, CV.categoryvalueid, CV.categoryid, CV.shortdesc FROM tblcategoryvalues AS CV, ( (SELECT 'mark' AS zoekwoord) UNION (SELECT 'test' AS

Re: [GENERAL] Filter tables

2007-11-12 Thread Reg Me Please
Il Monday 12 November 2007 17:05:18 Dimitri Fontaine ha scritto: > Hi, > > Le lundi 12 novembre 2007, Reg Me Please a écrit : > > What I'd need to do is to "filter" t1 against f1 to get only the rows > > ( 'field1',1 ) and ( 'field2',1 ). > > select * from t1 natural join f1 where t1.id = 1; >t

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Tom Lane
hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > on the other hand. while i know and understand why there can't be "=" > operator for text and int, i think that "like" could be readded as it is > really clear about how it works. Really? regression=# select '8.12345678901234567890' ~~ '%678

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Erik Jones
On Nov 12, 2007, at 10:18 AM, Tom Lane wrote: Martijn van Oosterhout <[EMAIL PROTECTED]> writes: On Mon, Nov 12, 2007 at 02:46:50PM +0100, Karsten Hilbert wrote: It surely makes sense - in your environment - but it's not the only interpretation so PG tries to be impartial and makes both of us

Re: [GENERAL] reverse strpos?

2007-11-12 Thread A. Kretschmer
am Mon, dem 12.11.2007, um 10:54:53 -0500 mailte Gauthier, Dave folgendes: > Is there a function that?ll return the position of the last occurance of a > char > in a string? > > > > For Example, in the string ?abc/def/ghi? I want the position of the 2^nd ?/?. write a function to revert the

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Mon, Nov 12, 2007 at 02:46:50PM +0100, Karsten Hilbert wrote: >> It surely makes sense - in your environment - but it's not >> the only interpretation so PG tries to be impartial and >> makes both of us say clearly what we want. > If people w

Re: [GENERAL] Filter tables

2007-11-12 Thread Erik Jones
On Nov 12, 2007, at 9:43 AM, Reg Me Please wrote: Hi all. I have this sample setup: CREATE table t1 ( t text, id int ); CREATE TABLE f1 ( t text ); INSERT INTO t1 VALUES ( 'field1',1 ), ( 'field2',1 ), ( 'field3',1 ), ( 'field1',2 ), ( 'field3',3 ) ; INSERT INTO f1 VALUES ( 'fiel

Re: [GENERAL] pg_tables and temp tables

2007-11-12 Thread Tom Lane
"Gauthier, Dave" <[EMAIL PROTECTED]> writes: > How user specific is pg_tables when it comes to temporary tables? regression=# \d pg_tables ... View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, t.spcname AS tablespace, c.relhasind

Re: [GENERAL] Filter tables

2007-11-12 Thread Dimitri Fontaine
Hi, Le lundi 12 novembre 2007, Reg Me Please a écrit : > What I'd need to do is to "filter" t1 against f1 to get only the rows > ( 'field1',1 ) and ( 'field2',1 ). select * from t1 natural join f1 where t1.id = 1; t| id + field1 | 1 field2 | 1 (2 lignes) I'm not sure abou

[GENERAL] reverse strpos?

2007-11-12 Thread Gauthier, Dave
Is there a function that'll return the position of the last occurance of a char in a string? For Example, in the string 'abc/def/ghi' I want the position of the 2nd '/'. Thanks in Advance.

[GENERAL] Filter tables

2007-11-12 Thread Reg Me Please
Hi all. I have this sample setup: CREATE table t1 ( t text, id int ); CREATE TABLE f1 ( t text ); INSERT INTO t1 VALUES ( 'field1',1 ), ( 'field2',1 ), ( 'field3',1 ), ( 'field1',2 ), ( 'field3',3 ) ; INSERT INTO f1 VALUES ( 'field1' ), ( 'field2' ) ; What I'd need to do is to "f

Re: [GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Scott Marlowe
On Nov 9, 2007 10:55 PM, Mark Niedzielski <[EMAIL PROTECTED]> wrote: > > Our developers run on MacBook Pros w/ 2G memory and our production > hardware is dual dual-Core Opterons w/ 8G memory running CentOS 5. The > Macs perform common and complex Postgres operations in about half the > time of our

Re: [GENERAL] PQexec(), what should I do for the "NULL in command" problem?

2007-11-12 Thread Martijn van Oosterhout
On Thu, Nov 08, 2007 at 06:39:23PM -0800, jason wrote: > As you know the interface of PQexec(): > PGresult *PQexec(PGconn *conn, const char *command); > > "command" contains some SQL statements. > > But there exist "\0" in some data filed, and I found PQexec() failed > on such situation. Two wa

Re: [GENERAL] float to int

2007-11-12 Thread Edoardo Panfili
Charles.Hou ha scritto: > how can i get the int value using the sql language? like this, > > "select cost from my_money_table " , the data type of cost is float. > take a look at http://www.postgresql.org/docs/8.2/static/sql-expressions.html CAST ( expression AS type ) expression::type Edoardo

[GENERAL] How to uninstall the geometry package?

2007-11-12 Thread Ken Winter
While installing PostgreSQL (8.1) recently, I was offered the option to install the geometry functions. "Why not?" I said to myself, and to the installer I said yes. Well, the answer to "Why not?" is that I have a couple hundred functions that I'll probably never use junking up my installatio

[GENERAL] float to int

2007-11-12 Thread Charles.Hou
how can i get the int value using the sql language? like this, "select cost from my_money_table " , the data type of cost is float. ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/f

[GENERAL] Linux v.s. Mac OS-X Performance

2007-11-12 Thread Mark Niedzielski
Our developers run on MacBook Pros w/ 2G memory and our production hardware is dual dual-Core Opterons w/ 8G memory running CentOS 5. The Macs perform common and complex Postgres operations in about half the time of our unloaded production hardware. We've compared configurations and the producti

[GENERAL] Open Source GIS System

2007-11-12 Thread Yancho
Hi, I am preparing to build up a GIS system as part of my University Masters Thesis. My final aim is to build a system where the user inputs (or via GPS) inputs the location where he is and the location where he want to go and gets the route planned. My main concern will be that the driver can dec

[GENERAL] Duplicating a table row while honouring key constraints

2007-11-12 Thread Gordon
I'm developing a web application in PHP and Postgres that will basically serve as a CMS. I want to implement a feature to allow users to make copies of documents or folders, so this will require the appropriate rows to be duplicated. If possible I'd like to do this with SQL queries and avoid SELE

[GENERAL] PQexec(), what should I do for the "NULL in command" problem?

2007-11-12 Thread jason
Hello: As you know the interface of PQexec(): PGresult *PQexec(PGconn *conn, const char *command); "command" contains some SQL statements. But there exist "\0" in some data filed, and I found PQexec() failed on such situation. Something like this: PQexec(conn, "INSERT INTO ('t', 'abc\0

Re: [GENERAL] INSERT performance deteriorates quickly during a large import

2007-11-12 Thread Julio Cesar Sánchez González
El jue, 08-11-2007 a las 13:01 -0500, Tom Lane escribió: > "Krasimir Hristozov \(InterMedia Ltd\)" <[EMAIL PROTECTED]> writes: > > We need to import data from a relatively large MySQL database into an > > existing PostgreSQL database, using a PHP5 script that SELECTs from MySQL > > and INSERTs in

Re: [GENERAL] strange infinite loop in plpgsql

2007-11-12 Thread Vyacheslav Kalinin
Isn't "EXTRACT(dow FROM day) IN (0,6)" always true thus making select return a row every time? On 11/10/07, rihad <[EMAIL PROTECTED]> wrote: > > I've been reading the online docs, but... code like this somehow ends up > in an indefinite loop: > > CREATE OR REPLACE FUNCTION foo() RETURNS int AS $$

[GENERAL] Accessing a db with pgAdmin

2007-11-12 Thread Kent Miller
Background - I am having a problem accessing a remote postgreSQL db from my laptop using an ssh tunnel and pgAdmin. I had postgreSQL loaded on my computer for use as a test db, but removed it. Including deleting the postgeSQL, and pgadmin directories after using the windows applications removal too

Re: [GENERAL] Usúario Conectados

2007-11-12 Thread Christian Rengstl
Hi, you could use "select usename from pg_stat_activity;" PS. this is an english-speaking list, so for the future please write your mails in english. Christian Rengstl M.A. Klinik und Poliklinik für Innere Medizin II Kardiologie - Forschung Universitätsklinikum Regensburg B3 1.388 Franz-Josef-S

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Martijn van Oosterhout
On Mon, Nov 12, 2007 at 02:46:50PM +0100, Karsten Hilbert wrote: > On Mon, Nov 12, 2007 at 02:19:21PM +0100, Patric Bechtel wrote: > > > Just guess: We have bigint id's through the system, so I want to give > > the users the convenience of typing only the last 4-5 digits (which most > > of the tim

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Karsten Hilbert
On Mon, Nov 12, 2007 at 02:19:21PM +0100, Patric Bechtel wrote: > Just guess: We have bigint id's through the system, so I want to give > the users the convenience of typing only the last 4-5 digits (which most > of the time is enough). So the query we issue really is > ... like "%$userinput" > >

Re: [GENERAL] Duplicating a table row while honouring key constraints

2007-11-12 Thread Lars Haugseth
* Gordon <[EMAIL PROTECTED]> wrote: > > I'm developing a web application in PHP and Postgres that will > basically serve as a CMS. I want to implement a feature to allow > users to make copies of documents or folders, so this will require the > appropriate rows to be duplicated. > > If possible

[GENERAL] Usúario Conectados

2007-11-12 Thread Cristiano Panvel
Oi Rapazeada, Existe alguma função do PostgreSQL para eu listar os usúarios que estão conectados ao banco, minha aplicação autentica com os usúarios diretamente do banco. Cris ---(end of broadcast)--- TIP 4: Have you searched our list archives?

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread hubert depesz lubaczewski
On Mon, Nov 12, 2007 at 02:19:21PM +0100, Patric Bechtel wrote: > Just guess: We have bigint id's through the system, so I want to give > the users the convenience of typing only the last 4-5 digits (which most > of the time is enough). So the query we issue really is > ... like "%$userinput" > Mak

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Patric Bechtel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas Pundt schrieb am 12.11.2007 13:18: > Hi, > > On Montag, 12. November 2007, Karsten Hilbert wrote: > | On Mon, Nov 12, 2007 at 12:46:58AM +0100, Patric Bechtel wrote: > | > select * from bla where a like '8%' > | > | Patrick, I'm not sure what y

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Patric Bechtel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Karsten Hilbert schrieb am 12.11.2007 13:07: > On Mon, Nov 12, 2007 at 12:46:58AM +0100, Patric Bechtel wrote: > >> select * from bla where a like '8%' > > Patrick, I'm not sure what you expect to come back: > > 8 ? 0.08 ? > > 8% of each of bla.a's

Re: [GENERAL] Verison 8.3 PL/pgSQL debugger Question

2007-11-12 Thread John DeSoi
Tony, On Nov 10, 2007, at 4:34 PM, Tony Caduto wrote: Is there any documentation for developers on how to use the new debugger in 8.3? Specifically on how it works and general guidelines on integration into 3rd party GUI applications. The API documentation is in the source file pldbgapi.c.

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Thomas Pundt
Hi, On Montag, 12. November 2007, Karsten Hilbert wrote: | On Mon, Nov 12, 2007 at 12:46:58AM +0100, Patric Bechtel wrote: | > select * from bla where a like '8%' | | Patrick, I'm not sure what you expect to come back: | | 8 ? 0.08 ? | | 8% of each of bla.a's values ? | | do 7% or 9% count, too ?

Re: [GENERAL] Regression in 8.3?

2007-11-12 Thread Karsten Hilbert
On Mon, Nov 12, 2007 at 12:46:58AM +0100, Patric Bechtel wrote: > select * from bla where a like '8%' Patrick, I'm not sure what you expect to come back: 8 ? 0.08 ? 8% of each of bla.a's values ? do 7% or 9% count, too ? ("a like '8%'" seems to say "well, about 8% of a, or close, anyways"). I

Re: [GENERAL] Verison 8.3 PL/pgSQL debugger Question

2007-11-12 Thread Simon Riggs
On Sat, 2007-11-10 at 15:34 -0600, Tony Caduto wrote: > Is there any documentation for developers on how to use the new debugger > in 8.3? > Specifically on how it works and general guidelines on integration into > 3rd party GUI applications. The debugger is a plug-in, available from pgfoundry.