Re: [GENERAL] [PL/pgSQL] Commit every N rows. Is it possible ?

2006-11-11 Thread Richard Huxton
Jeremiasz Miedzinski wrote: 2006/11/9, Richard Huxton : It's not clear to me why your function does what it does anyway. I can't see why you wouldn't just do this as standard queries. As it was mentioned on http://orafaq.com/faqplsql.htm Contrary to popular believe, one should *COMMIT less f

Re: [GENERAL] how & from where to start & admin pgsql on red hat

2006-11-11 Thread Richard Huxton
jatrojoomla wrote: Hi Group! I am trying to work & connect php wirh PGSQL on Red Hat ES 3. I got some Important path like: /usr/share/pgsql/contrib /usr/include/pgsql /usr/bin But I don't know how to start/stop pgsql server, 1. Buy a book on Linux/Red Hat server admin 2. Read it, payin

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Andrus
> CREATE OR REPLACE FUNCTION f_v_same_day_overlaps(date, > date, date, date, out overlaps bool) as > $_$ > SELECT (($3 between $1 and $2) or ($4 between $1 and $2)); > $_$ language sql; Thank you. In my application second and fourth parameters can be NULL which means forever. So I tried the

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Jorge Godoy
"Andrus" <[EMAIL PROTECTED]> writes: > This causes error > > ERROR: syntax error at or near "IF" > SQL state: 42601 > Character: 109 SQL has no "IF". Use plpgsql instead. > How many times this is slower than expression in where clause? You can time it. :-) But I don't believe it will be too s

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Richard Huxton
Andrus wrote: CREATE OR REPLACE FUNCTION f_v_same_day_overlaps(date, date, date, date, out overlaps bool) as $_$ SELECT (($3 between $1 and $2) or ($4 between $1 and $2)); $_$ language sql; Thank you. In my application second and fourth parameters can be NULL which means forever. No it

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Richard Broersma Jr
> In my application second and fourth parameters can be NULL which means > forever. > It this best solution ? > How many times this is slower than expression in where clause? I am not sure if this would work for you, but instead of using NULL to represent infinity, why not use 'infinity' to repr

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Jorge Godoy
Richard Broersma Jr <[EMAIL PROTECTED]> writes: >> In my application second and fourth parameters can be NULL which means >> forever. >> It this best solution ? >> How many times this is slower than expression in where clause? > > I am not sure if this would work for you, but instead of using NUL

[SOLVED] Re: [GENERAL] authentication question

2006-11-11 Thread Craig White
Just in case others follow in my footsteps - this may prove to be helpful. Summary of problem: CentOS 4.4 - SELinux enabled - authorizing pam based users ### Created file /etc/pam.d/postgresql (I'm using LDAP) [*] # cat /etc/pam.d/postgresql #%PAM-1.0 auth required pam_stack.so service=

[GENERAL] SQL syntax additions for 8.2

2006-11-11 Thread Richard Broersma Jr
Does anyone know of a link that I can read about newly added SQL syntax for 8.2. Currently,n I want to see if 8.2 will allow row constructors in update statements like: update foo set (a,b,c) = (1,2,3); Regards, Richard Broersma Jr. ---(end of broadcast)---

Re: [GENERAL] SQL syntax additions for 8.2

2006-11-11 Thread A. Kretschmer
am Sat, dem 11.11.2006, um 10:44:54 -0800 mailte Richard Broersma Jr folgendes: > Does anyone know of a link that I can read about newly added SQL syntax for > 8.2. Currently,n I > want to see if 8.2 will allow row constructors in update statements like: How about the release notes? http://deve

Re: [GENERAL] SQL syntax additions for 8.2

2006-11-11 Thread Richard Broersma Jr
> am Sat, dem 11.11.2006, um 10:44:54 -0800 mailte Richard Broersma Jr > folgendes: > > Does anyone know of a link that I can read about newly added SQL syntax for > > 8.2. Currently,n > I > > want to see if 8.2 will allow row constructors in update statements like: > > How about the release n

[GENERAL] encoding advice requested

2006-11-11 Thread Rick Schumeyer
My database locale is en_US, and by default my databases are UTF8. My application code allows the user to paste text into a box and submit it to the database. Sometimes the pasted text contains non UTF8 characters, typically the "fancy" forms of quotes and apostrophes. The database does not

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Andrus
In my application second and fourth parameters can be NULL which means forever. No it doesn't. NULL means "unknown". You're just using it to represent "forever". My table represents employee absence starting and ending dates. If end day is not yet known, it is represented by NULL value. My qu

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Andrus
If he casts all his dates to timestamps then this might be a good option. Thank you. where (a::timestamp, coalesce(b, '1231')::timestamp) overlaps (c::timestamp, coalesce(d, '1231')::timestamp) would be simplest solution. However select (date '20050101'::timestamp, date '20060101'::

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Andrus
I am not sure if this would work for you, but instead of using NULL to represent infinity, why not use 'infinity' to represent infinity? Infinity dehaves differenty than ordinal dates and nulls. If both b and d are infinity then comparison fails: select timestamp 'infinity':: date<=timestamp 'i

[GENERAL] Speed of postgres compared to ms sql, is this article/comment off?

2006-11-11 Thread novnov
In an interview "An interview with Adam Machanic" at http://www.simple-talk.com/sql/sql-server-2005/sql-server,-postgressql-and-fish-curry/ at the bottom of the page is a post by Andrew Clarke that says pgsql is much slower in comparison to ms sql. I've read a fair number of posts recently debun

Re: [GENERAL] encoding advice requested

2006-11-11 Thread Martijn van Oosterhout
On Sat, Nov 11, 2006 at 02:45:00PM -0500, Rick Schumeyer wrote: > My database locale is en_US, and by default my databases are UTF8. > > My application code allows the user to paste text into a box and submit > it to the database. Sometimes the pasted text contains non UTF8 > characters, typica

Re: [GENERAL] Speed of postgres compared to ms sql, is this article/comment off?

2006-11-11 Thread Tom Lane
novnov <[EMAIL PROTECTED]> writes: > http://www.simple-talk.com/sql/sql-server-2005/sql-server,-postgressql-and-fish-curry/ > at the bottom of the page is a post by Andrew Clarke that says pgsql is much > slower in comparison to ms sql. With no details, it's hard to rate that as anything but conte

Re: [GENERAL] Speed of postgres compared to ms sql, is this

2006-11-11 Thread novnov
I agree with what you say. And I'd still be interesting in hearing of first hand experience with the speed of the two databases from someone who is 'good' at both. The article commentor was obviously not a pgsql expert. I've heard recently that pgsql is as fast as mysql, so it seems odd that ms sq

Re: [GENERAL] Speed of postgres compared to ms sql, is this

2006-11-11 Thread Josh Rovero
From: novnov [mailto:[EMAIL PROTECTED]To: pgsql-general@postgresql.orgSent: Sat, 11 Nov 2006 20:15:08 -0500Subject: Re: [GENERAL] Speed of postgres compared to ms sql, is this I agree with what you say. And I'd still be interesting in hearing of first hand experience with the speed of the two d

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-11 Thread novnov
Re this part of what you wrote: "For column names, I recommend using whatever is natural in the decribing a field, irrespective of what the field is actually pointing towards. For example, a table representing an object with a creator attribute pointing to a user would have a column "cre

Re: [GENERAL] wildcard alias

2006-11-11 Thread Dawid Kuroczko
On 11/10/06, Matthew Terenzio <[EMAIL PROTECTED]> wrote: I suppose I should have named things differently but is there a way to join two tables with a bunch of identical column names and rather than explicitly alias each column just use some sort of wildcard like: SELECT tablename.* AS alias.*

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Richard Broersma Jr
> My table represents employee absence starting and ending dates. > If end day is not yet known, it is represented by NULL value. > My query should threat unknown value as never ending absence to return > estimated number of work days. > Infinity date value is missing in SQL standard. > I do'nt kn

Re: [GENERAL] Automatically Creating INSERT/UPDATE/DELETE Rules on Views

2006-11-11 Thread Robert Treat
On Friday 10 November 2006 18:39, Matt Miller wrote: > I'm converting a large Oracle DB that uses hundreds of updatable views. > ora2pg is quite useful, but it looks like it doesn't do anything to > create the rules that are needed to make the views updatable. Under > Oracle simple views like "sel

Re: [GENERAL] Using GIN indexes on 8.2

2006-11-11 Thread Robert Treat
On Friday 10 November 2006 14:41, Jeff Davis wrote: > On Fri, 2006-11-10 at 20:39 +0300, Teodor Sigaev wrote: > > >> Use @>, <@ operations instead of @ and ~ > > >> Look for discussions in -hackers for reasons of changing names > > > > > > Ah, many thanks. How about updating those web pages? :) > >

Re: [GENERAL] Utility to Convert MS SQL Server to Postgres

2006-11-11 Thread Robert Treat
On Saturday 11 November 2006 01:26, novnov wrote: > Any recommondations for a util that helps with conversion of MS SQL Server > databases to Postgres? Constraints, triggers, etc? > > Thanks There are a couple of articles on this at http://www.postgresql.org/docs/techdocs.3, which I believe have

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-11 Thread Dawid Kuroczko
On 11/8/06, novnov <[EMAIL PROTECTED]> wrote: I am very curious to hear the various conventions folks here have arrived at. I don't expect there to be consensus, but the various rationales might help me arrive at an approach that works well for me. Personally I use all lower caps names a typica

[GENERAL] DB Designer??

2006-11-11 Thread kbajwa
Hello List:   There is a DB Designer for mySQL. Is there a similar DB designer for postgreSQL?   Kirt

Re: [GENERAL] Why overlaps is not working

2006-11-11 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > apparently date doesn't know anything about infinity. It doesn't, but we have a TODO item to make it do so, which would presumably include making the timestamp-to-date cast do something more sensible with an infinity timestamp.

Re: [GENERAL] Using GIN indexes on 8.2

2006-11-11 Thread Oleg Bartunov
On Sat, 11 Nov 2006, Robert Treat wrote: On Friday 10 November 2006 14:41, Jeff Davis wrote: On Fri, 2006-11-10 at 20:39 +0300, Teodor Sigaev wrote: Use @>, <@ operations instead of @ and ~ Look for discussions in -hackers for reasons of changing names Ah, many thanks. How about updating tho

Re: [GENERAL] DB Designer??

2006-11-11 Thread Shoaib Mir
You can try one of these: 1. DBVisualiser   http://minq.se 2. PostgreSQL Autocad   http://www.rbt.ca/autodoc/index.html 3. Druid   http://sourceforge.net/projects/druid 4. SQLManager   http://sqlmanager.net/en/products/postgresql 5. Aqua Data Studio   http://www.aquafold.com/index-postgresql.ht

Re: [GENERAL] Utility to Convert MS SQL Server to Postgres

2006-11-11 Thread Shoaib Mir
You can use the DTS of SQL Server by specifying ODBC source for PostgreSQL.Thanks,---Shoaib MirEnterpriseDB (www.enterprisedb.com) On 11/12/06, Robert Treat <[EMAIL PROTECTED]> wrote: On Saturday 11 November 2006 01:26, novnov wrote:> Any recommondations for a util that helps with conversion of