Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Brent Wood
I agree with David's comment. The business I work for recently proposed a FOSS 
based solution for a client, but were told no FOSS solutions would be 
considered. We had a subcontractor offer a support contract for an application 
based on the same FOSS components, but with a support contract. 

This was perfectly acceptable to our client, who now has a working solution, 
for which they pay annual maintenance, in return for a lack of internal 
liability.

For many businesses, risk avoidance is a core driver. What they require is 
someone else to blame if things go wrong, hence the companies making a living 
with contracts for Postgres support. 


Cheers,
  
  Brent Wood


Brent Wood
DBA/GIS consultant
NIWA, Wellington
New Zealand
>>> David Fetter <[EMAIL PROTECTED]> 09/01/08 6:09 PM >>>
On Sun, Aug 31, 2008 at 10:44:38PM -0400, Guy Rouillier wrote:
> M2Y wrote:
>>
>> Why most enterprises prefer Oracle than Postgres even though it is
>> free and has a decent enough user community.
>
> Databases are a critical part of many companies' business.  I work
> for  telecom company, and if we were to lose our databases, we'd be
> out of  business, period.  So, "free and decent enough" are not good
> enough.  If  you are going to bet your business on anything, you
> want to be as sure  as possible that "it" is reliable and that you
> can expect quick action  if "it" should break.

What they want to have is a huge entity they can blame when everything
goes wrong.  They're not interested in the actual response times or
even in the much more important time-to-fix because once they've
blamed Oracle, they know the responsibility is no longer on their
shoulders.

Cheers,
David.
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Assistance with SQL

2008-09-01 Thread hubert depesz lubaczewski
On Sun, Aug 31, 2008 at 11:31:32PM -0400, Aaron Burnett wrote:
> table1 has 25 columns
> table2 is a subset of table1 (create table2 as select
> id,field1,field2,field3,field4,field5,field6 from table1) with just 7
> columns
> There is a primary key on ID
> table2 was exported to a CSV, truncated, then the ³cleaned² CSV was
> re-imported to table2
> In a nutshell I need to find the difference between the 6 columns in table2
> vs table1 and update table1, again, with the ID column being the pk.

update table1 as t1
set
field1 = t2.field1,
field2 = t2.field2,
field3 = t2.field3,
field4 = t2.field4,
field5 = t2.field5,
field6 = t2.field6
from
table2 t2
where
t1.id = t2.id
and (
( t1.field1 is distinct from t2.field1 ) OR
( t1.field2 is distinct from t2.field2 ) OR
( t1.field3 is distinct from t2.field3 ) OR
( t1.field4 is distinct from t2.field4 ) OR
( t1.field5 is distinct from t2.field5 ) OR
( t1.field6 is distinct from t2.field6 )
);

should work.

Best regards,

depesz

-- 
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: [EMAIL PROTECTED] / aim:depeszhdl / skype:depesz_hdl / gg:6749007

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Henry
On Sun, August 31, 2008 10:44 pm, Scott Marlowe wrote:
> The other thing that holds back PostgreSQL right now is a lack of
> experienced pgsql DBAs and application developers.  That will change
> over time.

And built-in, simple to use, reliable, flexible and fast replication. 
Many a Pg admin or implementer has looked on with envy at what Oracle does
"out of the box" in terms of replication alone.  Yes, there are
third-party options (Slony, etc), but they're *third party*, and nowhere
near as reliable and robust as Pg itself.   (thank heavens for Skytools,
btw)

This is /finally/ being addressed, although (very) belatedly.  The Pg core
dev team always argued that replication was an add-on and should not form
part of the core (ie, similar nonsense excuses the MySQL team used for
"add-ons" such as triggers, etc).

Leaving this one vital issue so late has caused damage to Pg's reputation
in my view.

Come on Tom, how about talking to the Command Prompt folks (who are
?about? to release Mammoth Replicator as Open Source) and look at possibly
merging their Pg-mod replication work into Pg itself?  If it's doable and
conforms to the Pg requirements, it will make up - and save - a mountain
of time.  The alternative will be a few years of stabilising any new
replication code before it's considered safe to adopt in production.

Their.  I've had my moan for the day, and I feel much better :-)

Cheers
Henry


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Henry
On Mon, September 1, 2008 4:09 am, Craig Ringer wrote:
> Right now, PostgreSQL has network-based master-to-slave(s) clustering
> using Slony that permits slaves to operate online read-only as reporting
> servers etc. It also covers failover with the use of an external
> heartbeat/STONITH setup. However, it's not completely transparent to the
> application and it's not seen as "part of postgresql".
>
> There are some other options that I'm largely unfamiliar with out there,
> but right now it seems that Slony is the way to go with Pg.

...and Skytools (as used by Skype, I believe, which is now Open Source),
which is far simpler to use and in my experience far more reliable.

Cheers
Henry


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] warning: libssl.so.4, needed by

2008-09-01 Thread Marco Bizzarri
On Fri, Aug 29, 2008 at 2:39 PM, J Welcomecert <[EMAIL PROTECTED]> wrote:


It looks like you haven't openssl installed on your system, or you
didn't provided the right switches for compiling it?

Regards
Marco

-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Thomas Kellerer

Scott Marlowe, 31.08.2008 22:44:

I think some of it is inertia.  We've always used Oracle, let's just
keep on using it.  The more conservative the IT department is, the
less likely they are to take chances with new technology.

It used to be there was about an 80/20 split between what things you
could do with either postgresql or oracle, and the other 20% was
oracle only land. I think that number is dropping quickly, and we're
into the 1 or 2% club of what Oracle can do that PostgreSQL isn't fast
enough for.


For me (personally) the ratio is more like 70/30, because we are making extensive usage of Oracle's windowing functions (and ability to easily deal with hierarchical data using CONNECT BY). 

The lack of windowing functions is a bit frustrating as I'm otherwise a big Postgres fan! 


Regards
Thomas


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] temp schemas

2008-09-01 Thread Dave Page
On Fri, Aug 29, 2008 at 2:07 PM, Dave Page <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 1:40 PM, Roberts, Jon <[EMAIL PROTECTED]> wrote:
>
> Oh, that's weird - that code is filtering out system objects client
> side for some reason. I'll look at that.

I've committed a change to filter out temp schemas server-side if
'show system objects' is turned off. That should help optimise this
oddity in the way GP is creating the schemas.

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgre connect on Postgre

2008-09-01 Thread Asko Oja
If you are using functions take a look at plProxy. We created it after
finding out that dblink wasn't good enough for us in oltp environments.
There are also some security issues related to dblink that should be given
serious consideration.

As for replication SkyTools and Londiste are alternatives to Slony. SkyTools
should provide less management headaches.

http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/

regards
Asko


On Wed, Aug 27, 2008 at 8:09 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Anderson dos Santos Donda wrote:
>
>> Thanks man!!
>>
>> I'll study this module!!
>>
>
> You should also be aware that sometimes instead of
> connecting two separate databases via dblink or similar,
> two schemas in one database can be used instead.
>
> It really depends on what you are really doing if
> there are even more solutions (like slony for example).
>
> Regards
> Tino
>
> PS: the database likes to be called Postgresql or Postgres :-)
>
>  On Tue, Aug 26, 2008 at 11:19 PM, Christophe <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote:
>>
>>
>>On Aug 26, 2008, at 7:10 PM, Anderson dos Santos Donda wrote:
>>
>>How I can connect a postgre database on another postgre
>>database, and manipulate the datas on both database?
>>
>>
>>There is a module in contrib just for such a purpose:
>>
>>   http://www.postgresql.org/docs/8.3/interactive/dblink.html
>>
>>--Sent via pgsql-general mailing list (
>> pgsql-general@postgresql.org
>>)
>>To make changes to your subscription:
>>http://www.postgresql.org/mailpref/pgsql-general
>>
>>
>>
>


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Tino Wildenhain

Henry wrote:

On Sun, August 31, 2008 10:44 pm, Scott Marlowe wrote:

The other thing that holds back PostgreSQL right now is a lack of
experienced pgsql DBAs and application developers.  That will change
over time.


And built-in, simple to use, reliable, flexible and fast replication. 
Many a Pg admin or implementer has looked on with envy at what Oracle does

"out of the box" in terms of replication alone.  Yes, there are


Well actually it appears a lot of DBAs are not satisfied with Oracles
"out of the box" solution and buy third party stuff when it comes
to replication. So this argument doesn't really bite.

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [GENERAL] Assistance with SQL

2008-09-01 Thread Aaron Burnett

Thank you.

I was making it way too over-complicated.

Works perfectly


On 9/1/08 3:39 AM, "hubert depesz lubaczewski" <[EMAIL PROTECTED]> wrote:

> On Sun, Aug 31, 2008 at 11:31:32PM -0400, Aaron Burnett wrote:
>> table1 has 25 columns
>> table2 is a subset of table1 (create table2 as select
>> id,field1,field2,field3,field4,field5,field6 from table1) with just 7
>> columns
>> There is a primary key on ID
>> table2 was exported to a CSV, truncated, then the ³cleaned² CSV was
>> re-imported to table2
>> In a nutshell I need to find the difference between the 6 columns in table2
>> vs table1 and update table1, again, with the ID column being the pk.
> 
> update table1 as t1
> set
> field1 = t2.field1,
> field2 = t2.field2,
> field3 = t2.field3,
> field4 = t2.field4,
> field5 = t2.field5,
> field6 = t2.field6
> from
> table2 t2
> where
> t1.id = t2.id
> and (
> ( t1.field1 is distinct from t2.field1 ) OR
> ( t1.field2 is distinct from t2.field2 ) OR
> ( t1.field3 is distinct from t2.field3 ) OR
> ( t1.field4 is distinct from t2.field4 ) OR
> ( t1.field5 is distinct from t2.field5 ) OR
> ( t1.field6 is distinct from t2.field6 )
> );
> 
> should work.
> 
> Best regards,
> 
> depesz


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] indexes on functions and create or replace function

2008-09-01 Thread Peter Eisentraut

Matthew Dennis wrote:
Given table T(c1 int) and function F(arg int) create an index on T using 
F(c1).  It appears that if you execute "create or replace function F" 
and provide a different implementation that the index still contains the 
results from the original implementation, thus if you execute something 
like "select * from T where F(c1)" after replacing the function that it 
now misses rows that should be returned.  In other words, the index 
isn't aware the function is now returning different values.  That's not 
the correct/expected behavior is it?  I would have expected that 
replacing the function would have caused any indexes that depend on that 
function to be reindexed/recreated with the new function implementation.


I have added a Todo item about this.  But as you see, the problem is 
quite large and involved.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] SQL optimization - WHERE SomeField STARTING WITH ...

2008-09-01 Thread Peter Eisentraut

Bill wrote:
The SQL database servers I have worked with cannot use and index for a 
SELECT of the form


SELECT * FROM ATABLE
WHERE AFIELD LIKE ?

because there is no way to know the location of the wild card until the 
parameter value is known. InterBase and Firebird allow


SELECT * FROM ATABLE
WHERE AFIELD STARTING WITH ?

which is equivalent to LIKE  'ABC%' and will use an index on AFIELD. Is 
there a similar syntax in PostgreSQL?


One workaround might be to rewrite the query using some string function 
(substring, position, or write your own) and index over that function.



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] determining existence of database and language

2008-09-01 Thread Peter Eisentraut

Chris Sano wrote:

I'm trying to build a SQL script that will create a database if it
doesn't already exist. I've looked everywhere and haven't been able to
find anything. Am I missing something? Thanks.


SELECT * FROM pg_database will tell you what databases exist.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] ERROR: relation . . . does not exist

2008-09-01 Thread Peter Eisentraut

Albretch Mueller wrote:

PostgreSQL has 60+ types and many look like eachother. How do you propose to 
differentiate?

~
 Data Types are basically about value ranges (how many bits do you
need to hold the value) and formatting.


That is exactly wrong, at least in the PostgreSQL approach to the type 
system.  Data types are about functions and operators associated with 
them.  So it is not about what the data looks like, but what kind of 
processing you want to do with it.  Guessing that information from a 
dump of data seems pretty much impossible.



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread David Fetter
On Mon, Sep 01, 2008 at 10:31:25AM +0200, Thomas Kellerer wrote:
> Scott Marlowe, 31.08.2008 22:44:
>> I think some of it is inertia.  We've always used Oracle, let's
>> just keep on using it.  The more conservative the IT department is,
>> the less likely they are to take chances with new technology.
>>
>> It used to be there was about an 80/20 split between what things
>> you could do with either postgresql or oracle, and the other 20%
>> was oracle only land. I think that number is dropping quickly, and
>> we're into the 1 or 2% club of what Oracle can do that PostgreSQL
>> isn't fast enough for.
>
> For me (personally) the ratio is more like 70/30,

It's about to increase :)

> because we are making extensive usage of Oracle's windowing
> functions

http://umitanuki.net/pgsql/wfv04/design.html

> (and ability to easily deal with hierarchical data using CONNECT BY). 

It's even more fun with CTEs.


> The lack of windowing functions is a bit frustrating as I'm
> otherwise a big Postgres fan! 

Those will both be fixed, at least to a large degree, in 8.4 :)

Cheers,
David.
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] refcursor

2008-09-01 Thread mike stanton

Hello all,
I've got a problem I can't get round. I want to declare a refcursor variable in 
a  C program and call a function which returns a refcursor portal to the main C 
program.
When I compile the C program, I get a refcursor doesn´t exist message. Has 
anyone got a  C program which uses a refcursor variable?
Hope you can help.

Cheers
Mike Stanton, Santiago Chile




Michael Stanton W.
Depto. Informática

Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Thomas Kellerer

David Fetter, 01.09.2008 16:08:

because we are making extensive usage of Oracle's windowing
functions


http://umitanuki.net/pgsql/wfv04/design.html


I knew there was work going on regarding this, but I didn't know how definite 
the decision was to integrate that into 8.4

It's too bad lead(), lag() won't make it


It's even more fun with CTEs.



Recursive CTE are quite cool, and a valid "replacement" for CONNECT BY. 
I've used it already with SQL Server 2005 and once you get the idea it's really nice. 


Those will both be fixed, at least to a large degree, in 8.4 :)


What exactly means "large degree" :)


Regards
Thomas




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread David Fetter
On Mon, Sep 01, 2008 at 04:39:09PM +0200, Thomas Kellerer wrote:
> David Fetter, 01.09.2008 16:08:
>>> because we are making extensive usage of Oracle's windowing
>>> functions
>>
>> http://umitanuki.net/pgsql/wfv04/design.html
>
> I knew there was work going on regarding this, but I didn't know how
> definite the decision was to integrate that into 8.4
>
> It's too bad lead(), lag() won't make it

It's not certain they won't make it, only that they're not in the
current patch.

>> It's even more fun with CTEs.
>> 
>
> Recursive CTE are quite cool, and a valid "replacement" for CONNECT
> BY.  I've used it already with SQL Server 2005 and once you get the
> idea it's really nice. 

It's also standard, where Oracle's syntax is proprietary.  In
PostgreSQL, when there's a choice between the two, the standard wins.

>> Those will both be fixed, at least to a large degree, in 8.4 :)
>
> What exactly means "large degree" :)

It means we may not get everything the SQL:2008 standard specifies for
CTEs and windowing functions on the first pass.

Cheers,
David.
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] refcursor

2008-09-01 Thread Alvaro Herrera
mike stanton escribió:
> 
> Hello all,
> I've got a problem I can't get round. I want to declare a refcursor variable 
> in a  C program and call a function which returns a refcursor portal to the 
> main C program.
> When I compile the C program, I get a refcursor doesn´t exist message.
> Has anyone got a  C program which uses a refcursor variable?

Make sure the C program opens a transaction before calling the function,
otherwise the cursor is automatically closed as soon as the function ends.

-- 
Alvaro Herrera  Valdivia, Chile   Geotag: -39,815 -73,257
"Ah, spring... when a young penguin's fancy lightly turns to thoughts of ...
Beta testing!"  (Fedora 9 beta announcement)

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] immutable functions and enumerate type casts in indexes

2008-09-01 Thread Edoardo Panfili

Hello,

I have a problem with enumerated types in functions parameters.

my enumerated type is (this is a subset)
CREATE TYPE hibridation AS ENUM('none','genus','specie');

function declaration
CREATE FUNCTION ename(text,boolean,text,text RETURNS text AS 
'funzioniGDB.so' LANGUAGE C IMMUTABLE;


index creation (the type of ibrido is hibridation)
CREATE INDEX i_specie_nome_specie ON specie 
(esterna_nome(ibrido::text,proParte,genere,specie));


the result is
ERROR:  functions in index expression must be marked IMMUTABLE

Searching on google I found some explanation: the problem arises with 
"non immutable" typea as "data" but I can't figure the problem (or 
better, the solution) with enumerate types.


What can I do?

thank you
Edoardo







--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Can I truncate statements in the log?

2008-09-01 Thread Howard Cole
As part of my log configuration, I log statements that take over 3 
seconds. I find this very useful for optimising tables etc. The problem 
is that it produces verbatim some very large statements which can create 
huge log entries, which are probably responsible themselves for slowing 
the system down. The problem tend to be insert statements for binary 
objects - which can be Megabytes long.


Is it possible to stop logging these excessive insert statements 
somehow, or restricting the log of statements to select, delete etc and 
ignore inserts.


Thanks.

Howard.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] MySQL LAST_INSERT_ID() to Postgres

2008-09-01 Thread Lennin Caro



--- On Thu, 8/28/08, Masis, Alexander (US SSA) <[EMAIL PROTECTED]> wrote:

> From: Masis, Alexander (US SSA) <[EMAIL PROTECTED]>
> Subject: [GENERAL] MySQL LAST_INSERT_ID() to Postgres
> To: pgsql-general@postgresql.org
> Date: Thursday, August 28, 2008, 4:14 PM
> I was mapping C++ application code that works with mySQL to
> work with
> Postgres.
> There were a number of articles on line regarding the
> conversion from
> mySQL to Postgres like:
> http://en.wikibooks.org/wiki/Programming:Converting_MySQL_to_PostgreSQL
> 
> http://groups.drupal.org/node/4680
> 
> http://jmz.iki.fi/blog/programming/converting_mysql_database_to_postgres
> ql
> 
> http://www.raditha.com/blog/archives/000488.html
> 
> However, I found the most difficult issue was related to a
> MySQL's
> "SELECT LAST_INSERT_ID()" sql call.
> If your code did not use LAST_INSERT_ID(), then you
> don't have to read
> this post.
>   In MySQL "LAST_INSERT_ID()" is a MySQL's
> syntax that returns the
> last auto_increment type ID of the row(record) inserted in
> a table. 
> 
>   In other words, if your MySQL table had a auto_increment
> datatype for a field, that field will automatically advance
> whenever a
> new record(row) is inserted into that table.
> 
>   It is sometimes handy to know what is the value of that
> ID, that
> has just been added to the table, so that that record(row)
> can be
> addressed/updated later.
> 

use insert into.returning val1,val2.


http://www.postgresql.org/docs/8.3/static/sql-insert.html

this can return the value of the sequence of the table

> Well, in MySQL it's easy you just do:
> "SELECT LAST_INSERT_ID();"
>   In Postgres, however it is not that simple. You have to
> know the
> name of so called "insert sequence". Postgres has
> a system function for
> that( SQL line below ).
> In Postgres you will have to provide the table and column
> name(
> "auto_increment" type in MySQL or "serial or
> bigserial" in Postgres).
> 
> Here is that SQL query that returns the last inserted ID:
> 
>"SELECT CURRVAL(
> pg_get_serial_sequence('my_tbl_name','id_col_name'));"
> 
> 
> Alexander Masis.
> 
> 
> 
> -- 
> Sent via pgsql-general mailing list
> (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


  


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Michael Nolan
Oracle handles connecting to multiple databases (even on multiple/remote
computers) fairly seamlessly, PG does not (yet.)  Oracle's toolsets (for
things like forms and reports) are much further developed than PG's too,
though there are 3rd party tools that work with both.

Back in the old mainframe days, people used to say, "Nobody ever got fired
for selecting IBM."  It appears that mindset is still true.
--
Mike Nolan


Re: [GENERAL] immutable functions and enumerate type casts in indexes

2008-09-01 Thread Tom Lane
Edoardo Panfili <[EMAIL PROTECTED]> writes:
> my enumerated type is (this is a subset)
> CREATE TYPE hibridation AS ENUM('none','genus','specie');

> function declaration
> CREATE FUNCTION ename(text,boolean,text,text RETURNS text AS 
> 'funzioniGDB.so' LANGUAGE C IMMUTABLE;

> index creation (the type of ibrido is hibridation)
> CREATE INDEX i_specie_nome_specie ON specie 
> (esterna_nome(ibrido::text,proParte,genere,specie));

> the result is
> ERROR:  functions in index expression must be marked IMMUTABLE

Yeah, enum_out is considered STABLE not IMMUTABLE.  I think this is
correct for the long term, even though right now you could make some
argument for an IMMUTABLE marking.  For instance, we might in future
allow renaming of an enum member.  (Actually, you can do that today
if you don't mind poking pg_enum by hand ...)

Now, maybe for your purposes here it's okay to consider it immutable.
In that case what I'd suggest doing is redefining ename() to take the
enum directly.  You could invoke enum_out within the function if you
really need a text equivalent.

regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Text search configuration

2008-09-01 Thread Pedro Stavrinides
Hi All,

This is my first post to this mailing list, so apologies if I am sending my
message to the incorrect place...

My question: I have configured a very basic text search for our application,
but got stuck at the point where I need the search vector to filter out some
unwanted text (HTML tags and special characters etc.). I have been through
the docs and think I have a basic understanding...  it appears that I need
to write a parser? Or is there something simpler? I couldn't find an
examples, so any advise would be much appreciated before I start.

Thanks,
Peter


Re: [GENERAL] Text search configuration

2008-09-01 Thread Oleg Bartunov

On Tue, 2 Sep 2008, Pedro Stavrinides wrote:


Hi All,

This is my first post to this mailing list, so apologies if I am sending my
message to the incorrect place...

My question: I have configured a very basic text search for our application,
but got stuck at the point where I need the search vector to filter out some
unwanted text (HTML tags and special characters etc.). I have been through
the docs and think I have a basic understanding...  it appears that I need
to write a parser? Or is there something simpler? I couldn't find an
examples, so any advise would be much appreciated before I start.


you don't need special parser, just to *include* what you need into your
configuration. See example 
http://www.postgresql.org/docs/8.3/static/textsearch-configuration.html




Thanks,
Peter



Regards,
Oleg
_
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general