Re: Materialized views (Was Re: [HACKERS] Improving count(*))

2005-11-23 Thread Josh Berkus
Guys, I'm not going to get the university research up before American Thanksgiving. Sorry. Look for it next week. -- Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [HACKERS] MERGE vs REPLACE

2005-11-23 Thread Martijn van Oosterhout
On Wed, Nov 23, 2005 at 12:24:24AM +0100, Petr Jelinek wrote: > Btw about that keys, oracle gives error on many-to-one or many-to-many > relationship between the source and target tables. The standard has something called a "cardinality violation" if the to-be-merged table doesn't match 1-1 with

[HACKERS] PL/php in pg_pltemplate

2005-11-23 Thread Alvaro Herrera
Hackers, Is anybody opposed to having PL/php in pg_pltemplate in the 8.1 branch? If not, I will add it on monday. (I plan to add it to 8.2 at the same time.) -- Alvaro Herrerahttp://www.advogato.org/person/alvherre "Always assume the user will do much worse than the stup

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-23 Thread Christopher Kings-Lynne
Is anybody opposed to having PL/php in pg_pltemplate in the 8.1 branch? If not, I will add it on monday. (I plan to add it to 8.2 at the same time.) With non-forced initdb? Chris ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-23 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: >> Is anybody opposed to having PL/php in pg_pltemplate in the 8.1 branch? >> If not, I will add it on monday. (I plan to add it to 8.2 at the same >> time.) > With non-forced initdb? It's too late to be making catalog changes in the 8.1 branch

[HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Fredrik Olsson
Hi. In the course of porting a database from Microsoft SQL Server to PostgreSQL I have rewritten a few of the date and string functions in pl/pgSQL. Started with just datepart, datediff and soundex, but once started I continued and rewrote all date/time and string functions supported by MS SQ

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Bill Bartlett
I'd be _very_ interested. I'll also volunteer to help out on this if you need assistance -- we have somewhat of a mixed environment here, so I already have a few (simple) functions that allow some compatibility between MS SQL Server and PostgreSQL (supporting "nextval" on SQL Server, etc.), but it

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Pollard, Mike
If this gets added as a contrib, here's a version of uniqueidentifier and newid() I wrote that maintains the same format as the SQL Server version: CREATE SCHEMA sqlserver AUTHORIZATION postgres; GRANT ALL ON SCHEMA sqlserver TO public; CREATE SEQUENCE sqlserver.uniqueidentifier0 INCREMENT 1

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Devrim GUNDUZ
Hi, On Wed, 23 Nov 2005, Fredrik Olsson wrote: I guess I am not the only one moving from MS SQL Server, so is there interest for others to use my work, as a contrib perhaps. And how should I continue from here in that case? I'd start a new project at pgfoundry and then would begin talking

[HACKERS] core dump on 8.1 and no dump on REL8_1_STABLE

2005-11-23 Thread Teodor Sigaev
Hi! Attached dump cause core on 8.1 release and works fine on REL8_1_STABLE and HEAD. Am I missed some fixes/commits? PS dump in KOI8, db should be initialized as initdb -E KOI8-R --locale ru_RU.KOI8-R -D $DIR and it should be installed ltree and tsearch2 modules. PPS gdb output: Program rec

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Fredrik Olsson
Devrim GUNDUZ wrote: Hi, On Wed, 23 Nov 2005, Fredrik Olsson wrote: I guess I am not the only one moving from MS SQL Server, so is there interest for others to use my work, as a contrib perhaps. And how should I continue from here in that case? I'd start a new project at pgfoundry and the

Re: [HACKERS] core dump on 8.1 and no dump on REL8_1_STABLE

2005-11-23 Thread Tom Lane
Teodor Sigaev <[EMAIL PROTECTED]> writes: > Attached dump cause core on 8.1 release and works fine on REL8_1_STABLE and > HEAD. > Am I missed some fixes/commits? In HEAD I get \i tsearch2.sql ... \i ltree.sql ... \i tsearch2_crash.dump CREATE TABLE ALTER TABLE psql:tsearch2_crash.dump:86: ERROR:

Re: [HACKERS] MERGE vs REPLACE

2005-11-23 Thread Lyubomir Petrov
Martijn, Here is a quick test (Oracle 10.1.0.3/Linux): SQL> select banner from v$version; BANNER Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Prod PL/SQL Release 10.1.0.3.0 - Production CORE10.1.0.3.0 Produ

Re: [HACKERS] Returning multiple result sets

2005-11-23 Thread Bruce Momjian
Tom Lane wrote: > Martijn van Oosterhout writes: > > libpq supports it just fine. You do a PQsendQuery() and then as many > > PQgetResult()s as it takes to get back the results. This worked for a > > while AFAIK. > > That only works if the caller is prepared to read each result serially, > and no

Re: [HACKERS] core dump on 8.1 and no dump on REL8_1_STABLE

2005-11-23 Thread Oleg Bartunov
On Wed, 23 Nov 2005, Tom Lane wrote: Teodor Sigaev <[EMAIL PROTECTED]> writes: Attached dump cause core on 8.1 release and works fine on REL8_1_STABLE and HEAD. Am I missed some fixes/commits? In HEAD I get \i tsearch2.sql ... \i ltree.sql ... \i tsearch2_crash.dump CREATE TABLE ALTER TABLE

Re: [HACKERS] someone working to add merge?

2005-11-23 Thread Jan Wieck
On 11/11/2005 2:20 PM, Tom Lane wrote: Peter Eisentraut <[EMAIL PROTECTED]> writes: Tom Lane wrote: Surely they require a unique constraint --- else the behavior isn't even well defined, is it? They require that the merge condition does not match for more than one row, but since the merge c

[HACKERS] 8.0 -> 8.1 migration issue with ROLEs ... maybe?

2005-11-23 Thread Marc G. Fournier
I just setup a test 8.1 server, to see how things work as far as the new roles system is concerned, as it relates to migrating from 8.0->8.1 ... specifically since there doesn't appear to be anything in HISTORY concerning migrating up to 8.1 from 8.0 concerning this ... As expected: templat

Re: [HACKERS] 8.0 -> 8.1 migration issue with ROLEs ... maybe?

2005-11-23 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > template1=# create user a_test_group in group a_test_group; > ERROR: role "a_test_group" already exists > So, if I have a group that happens to have a userid matching it, in the > old system, its going to fail to load? Groups and users are the sa

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Christopher Kings-Lynne
I just started a MySQL compatibility functions project on pgfoundry.org. I suggest starting an MSSQL one as well. I'd be interested if you could mail me your code for your functions so far because many of the MySQL functions are copied from MSSQL... Chris Fredrik Olsson wrote: Hi. In the

[HACKERS] comment doesn't accept expressions returning text

2005-11-23 Thread Michael Glaesemann
I've been trying to be better at documentation in general and have been trying to take advantage of PostgreSQL's COMMENT ON functionality to provide a little more information in the DDL itself. I usually write my DDL in a text file and load it into the database using psql. To make it (a lit

Re: [HACKERS] comment doesn't accept expressions returning text

2005-11-23 Thread Andrew Dunstan
To change this would involve changing the grammar. You could possibly write a stored proc that manipulated pg_description directly. cheers andrew Michael Glaesemann said: > I've been trying to be better at documentation in general and have > been trying to take advantage of PostgreSQL's COMMEN

Re: [HACKERS] comment doesn't accept expressions returning text

2005-11-23 Thread Michael Glaesemann
Thanks for the feedback, Andrew. On Nov 24, 2005, at 12:02 , Andrew Dunstan wrote: To change this would involve changing the grammar. I thought it might—and am thinking it might be all that would need changing. You could possibly write a stored proc that manipulated pg_description direct

Re: [HACKERS] comment doesn't accept expressions returning text

2005-11-23 Thread Andrew Dunstan
Michael Glaesemann said: > > On Nov 24, 2005, at 12:02 , Andrew Dunstan wrote: > >> To change this would involve changing the grammar. > > I thought it might—and am thinking it might be all that would need > changing. > No, you'd have to have code to get the expression evaluated. cheers andrew

Re: [HACKERS] comment doesn't accept expressions returning text

2005-11-23 Thread Michael Glaesemann
On Nov 24, 2005, at 12:29 , Andrew Dunstan wrote: Michael Glaesemann said: On Nov 24, 2005, at 12:02 , Andrew Dunstan wrote: To change this would involve changing the grammar. I thought it might—and am thinking it might be all that would need changing. No, you'd have to have code to g

Re: [HACKERS] [PATCHES] drop database if exists

2005-11-23 Thread Bruce Momjian
Christopher Kings-Lynne wrote: > > > here's a patch for "drop database if exists". Barring objections I will > > apply it in a day or two. > > Should we use the IF EXISTS syntax in pg_dump output? For all DROP > commands in clean mode? Yes, I was thinking it should be used for pg_dump --clean

[HACKERS] Private email requests

2005-11-23 Thread Bruce Momjian
I often get private requests from users for answers to questions. Instead of replying with the answer, I send this reply, which I keep in a file that can be easily included in an email message. The only replies I have gotten to it are thanks (no complaints). Feel free to use this idea for privat

Re: [HACKERS] someone working to add merge?

2005-11-23 Thread Martijn van Oosterhout
On Wed, Nov 23, 2005 at 04:55:25PM -0500, Jan Wieck wrote: > The largest problem I see with MERGE is the question of BEFORE triggers. > Consider a BEFORE INSERT trigger that modifies a third table, after > which the constraint or whatever post-heap_insert-attempt we might use > detects a conflic

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-23 Thread Pavel Stehule
Hello DB2, MySQL and MsSQL has shared group of function (date, time, strings). You can do it a bit complex - use variable which direct behavior, but there isn't bigger differences, I hope. Please (for start), use mycode, orafunc from pgfoundry. Regards Pavel Stehule From: Christopher