[GENERAL] a stored procedure ..with integer as the parameter

2005-10-20 Thread surabhi.ahuja
 i have a stored procedure   insert_table(integer)  which does "insert into table (x) value ($1)";   now in my client i call the stored procedure as   select insert_table("3");   it works fine and inserts 3 into the table   but suppose i give   select insert_table("");   it gives an error ...saying

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Dean Gibson (DB Administrator)
On 2005-10-20 15:46, Roger Hand wrote: On Thursday, October 20, 2005 1:01 PM, Martijn van Oosterhout wrote: On Thu, Oct 20, 2005 at 09:28:25AM -0700, Dean Gibson (DB Administrator) wrote: I just find it surprising that XML is not one of the formats provided, considering that XML is con

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Tino Wildenhain
Am Donnerstag, den 20.10.2005, 15:46 -0700 schrieb Roger Hand: > On Thursday, October 20, 2005 1:01 PM, Martijn van Oosterhout wrote: > ... > I would argue against outputting this one specific OpenDoc format, > even though it is the "flavor of the month" right now. Actually its near standardized.

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Tino Wildenhain
Am Donnerstag, den 20.10.2005, 14:56 -0700 schrieb Chris Travers: > Martijn van Oosterhout wrote: .. > > > OTOH, this idea might be really kinda cool. Maybe a good idea for > client applications Or are there other programs out there that can > save db queries to static (stand-alone) Gnumeri

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Jan Wieck
On 10/20/2005 6:10 AM, Alban Hertroys wrote: Michael Glaesemann wrote: if (OLD.value IS NOT NULL and NEW.value IS NOT NULL and OLD.value <> NEW.value) or OLD.value IS NULL or NEW.value IS NULL But that's untested and I have a hard time thinking in three-value logic. For completeness sake;

Re: [pgsql-advocacy] [GENERAL] Oracle buys Innobase

2005-10-20 Thread Marc G. Fournier
On Thu, 20 Oct 2005, Doug Quale wrote: "Guy Rouillier" <[EMAIL PROTECTED]> writes: Doug Quale wrote: # select 'a'::char(8) = 'a '::char(8); ?column? -- t (1 row) Trailing blanks aren't significant in fixed-length strings, so the question is whether Postgresql treats comparison of

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Tom Lane
CSN <[EMAIL PROTECTED]> writes: > BTW, it (the SQL spec I presume) has always seemed > contradictory to me that you can't do: > select * from table where field=null; > but can do: > update table set field=null; This only seems contradictory if you fail to make the distinction between "=" used as a

Re: [GENERAL] NULL != text ?

2005-10-20 Thread CSN
BTW, it (the SQL spec I presume) has always seemed contradictory to me that you can't do: select * from table where field=null; but can do: update table set field=null; (as opposed to 'update table set field to null' or similar). CSN __

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Roger Hand
On Thursday, October 20, 2005 1:01 PM, Martijn van Oosterhout wrote: > On Thu, Oct 20, 2005 at 09:28:25AM -0700, Dean Gibson (DB Administrator) wrote: >> I just find it surprising that XML is not one of the formats provided, >> considering that XML is considered a data interchange format (much mo

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Chris Travers
Martijn van Oosterhout wrote: On Thu, Oct 20, 2005 at 09:28:25AM -0700, Dean Gibson (DB Administrator) wrote: I just find it surprising that XML is not one of the formats provided, considering that XML is considered a data interchange format (much more than HTML, which is a representation f

Re: [GENERAL] Strange order of execution with rule

2005-10-20 Thread Tom Lane
[EMAIL PROTECTED] writes: > I have something like this: > CREATE or replace rule update_rule as on update > to aview > do instead ( > select func_display(new, old); > select rubriek('reset', 0, '', 0); > ); > I tried all kinds of variations (one select with two functions, a

Re: [GENERAL] Unique index with Null value in one field

2005-10-20 Thread Chris Travers
Hrishi Joshi wrote: Hi, I need to define a Unique index on 3 non-PK fields (composite key) on my table in PostgreSQL 8.0.3. The problem is, if any of those 3 fields is Null, PostgreSQL allows duplicate rows to be inserted. While searching through archives, I found more information about this.

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Tom Lane
[EMAIL PROTECTED] writes: > Tom Lane <[EMAIL PROTECTED]> wrote on 10/20/2005 03:11:23 PM: >> The hard part would be in figuring out how >> the output routine could know how many spaces to add back. > The length is in the metadata for the column, or am I being dense? The output routine hasn't got

Re: [GENERAL] Checking Multiplicity Constraints and Retrieving

2005-10-20 Thread Simon Riggs
On Wed, 2005-10-19 at 15:25 +0100, Ledina Hido wrote: > First of all, is there any way of limiting the number of rows in a > table, referencing to the same element of another table? For example, > force a manager not to have more than 10 employees under his control. > In a way this can be se

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Michael Glaesemann
On Oct 20, 2005, at 23:45 , Michael Fuhr wrote: On Thu, Oct 20, 2005 at 03:57:41PM +0900, Michael Glaesemann wrote: On Oct 20, 2005, at 15:44 , Michael Fuhr wrote: expression IS DISTINCT FROM expression For non-null inputs this is the same as the <> operator. However, when both inputs

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Richard_D_Levine
Tom Lane <[EMAIL PROTECTED]> wrote on 10/20/2005 03:11:23 PM: > The hard part would be in figuring out how > the output routine could know how many spaces to add back. The length is in the metadata for the column, or am I being dense? > > regards, tom lane --

[GENERAL] Strange order of execution with rule

2005-10-20 Thread han . holl
Hello, I have something like this: CREATE or replace rule update_rule as on update to aview do instead ( select func_display(new, old); select rubriek('reset', 0, '', 0); ); (Postgres 8.0.3). I tried all kinds of variations (one select with two functions, and two differ

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 12:34:39PM -0700, Steve Atkins wrote: > > While there are valid deliverable email addresses in .arpa, you really > don't want to be accepting them from end users... You know, as someone who has been bitten hundreds of times by the decision of some application designer who

Re: [pgsql-advocacy] [GENERAL] Oracle buys Innobase

2005-10-20 Thread Doug Quale
"Guy Rouillier" <[EMAIL PROTECTED]> writes: > Doug Quale wrote: >> >> # select 'a'::char(8) = 'a '::char(8); >> ?column? >> -- >> t >> (1 row) >> >> Trailing blanks aren't significant in fixed-length strings, so the >> question is whether Postgresql treats comparison of varchars right.

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Dann Corbit
Interesting article: http://coveryourasp.com/ValidateEmail.asp See also: http://search.cpan.org/~cwest/Email-Address-1.80/lib/Email/Address.pm http://www.faqs.org/rfcs/rfc2822.html http://docs.python.org/lib/module-rfc822.html > -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-g

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Tom Lane
Chris Travers <[EMAIL PROTECTED]> writes: > IIrc, varchar and bpchar are stored in a similar way, but are presented > differently when retrieved. I.e. storage is separate from presentation > in this case. I.e. the padding in bpchar occurs when it is presented > and stripped when it is stored.

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Martijn van Oosterhout
On Thu, Oct 20, 2005 at 09:28:25AM -0700, Dean Gibson (DB Administrator) wrote: > I just find it surprising that XML is not one of the formats provided, > considering that XML is considered a data interchange format (much more > than HTML, which is a representation format). All jokes aside, sayi

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Dann Corbit
Look back in the stack and you will find that I have quoted chapter and verse (see the attached html file in a previous email that I sent). This is in relation to the comparison operator. > -Original Message- > From: John D. Burger [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 20, 2

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread John D. Burger
[Removed all the non-list addresses] Dann Corbit wrote: Let me make something clear: When we are talking about padding here it is only in the context of a comparison operator and NOT having anything to do with storage. Given two strings of different in a comparison, most database systems (by d

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 09:54:13PM +0300, Andrus wrote: > How to write a WHERE clause which selects e-mail addresses which > are surely wrong ? Then I think the validating function someone else sent here () is a good start. You probably want the o

[GENERAL] Precompiled win32 binary for getCurrentTransactionID?

2005-10-20 Thread Steve V
Does anyone by any chance have a win32 binary compiled for the code found in the below thread? I have been trying and for the life of me cannot get it(or pg from source) to compile in my windows environment. I'm sure it's user error on my part, but I don't have the time at the moment to figure it o

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Richard_D_Levine
I will happily reiterate that I am the troll who started this mess by whining about how *Oracle* handles this. Tom's explanation that CHAR is has a PAD collation and VARCHAR has a NO PAD collation have restored my faith that there is goodness in the world. My whining was out of ignorance. I woul

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Steve Atkins
On Thu, Oct 20, 2005 at 11:52:40AM -0400, Andrew Sullivan wrote: > On Thu, Oct 20, 2005 at 06:10:40PM +0300, Andrus wrote: > > >From this thread I got the regular expression > > [snipped] > > Note that that regular expression, which appears to be validating > TLDs as well, is incredibly fragile.

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Steve Atkins
On Thu, Oct 20, 2005 at 09:54:13PM +0300, Andrus wrote: > "Andrew Sullivan" <[EMAIL PROTECTED]> wrote in message > > > I suggest that if you want to validate TLDs, you pull them off when > > you write the data in your database, and use a lookup table to make > > sure they're valid (you can keep th

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrus
"Andrew Sullivan" <[EMAIL PROTECTED]> wrote in message > I suggest that if you want to validate TLDs, you pull them off when > you write the data in your database, and use a lookup table to make > sure they're valid (you can keep the table up to date regularly by > checking the official IANA regi

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Dann Corbit
> -Original Message- > From: Chris Travers [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 20, 2005 11:53 AM > To: Dann Corbit > Cc: Greg Stark; Tom Lane; Chris Travers; josh@agliodbs.com; pgsql- > [EMAIL PROTECTED]; Stephan Szabo; Terry Fielder; Tino Wildenhain; > Marc G. Fournier; [EM

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Chris Travers
Dann Corbit wrote: Let me make something clear: When we are talking about padding here it is only in the context of a comparison operator and NOT having anything to do with storage. IIrc, varchar and bpchar are stored in a similar way, but are presented differently when retrieved. I.e. stor

Re: [GENERAL] From oracle to postgresql...

2005-10-20 Thread Joshua D. Drake
On Thu, 2005-10-20 at 12:35 -0400, Chris Browne wrote: > dev@archonet.com (Richard Huxton) writes: > > If you have money to spend, it might be worth checking out > > EnterpriseDB - they claim to have Oracle compatibility. News > > item/company site below. > >http://www.postgresql.org/about/news

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Dann Corbit
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-hackers- > [EMAIL PROTECTED] On Behalf Of Greg Stark > Sent: Wednesday, October 19, 2005 11:17 PM > To: Tom Lane > Cc: Chris Travers; josh@agliodbs.com; pgsql-hackers@postgresql.org; Dann > Corbit; Stephan Szabo; Terry Fielder; Ti

Re: [GENERAL] Tables

2005-10-20 Thread Sean Davis
On 10/20/05 12:37 PM, "Bob Pawley" <[EMAIL PROTECTED]> wrote: > I am new to databases. > > I have table 1, a primary source, which generates a serial number to make each > item unique. > > I want to use this number to generate a row in table 2 linking the two rows > and allowing specific informa

Re: [GENERAL] doc typo sql-reindex.html psql vs. postgres

2005-10-20 Thread David Fetter
On Thu, Oct 20, 2005 at 06:04:53PM +0200, Janning Vygen wrote: > By the way: What i really miss is a troubleshooting document in the > docs. I run postgresql for over 4 years now and i have come across > many situations where i really would need something like this. You > can find most solutions b

Re: [GENERAL] Tables

2005-10-20 Thread Michael Fuhr
On Thu, Oct 20, 2005 at 09:37:07AM -0700, Bob Pawley wrote: > I have table 1, a primary source, which generates a serial number > to make each item unique. Do you mean that the table has a serial column (which is just a convenient way to declare an integer column that takes its default value from

Re: [GENERAL] From oracle to postgresql...

2005-10-20 Thread Chris Browne
dev@archonet.com (Richard Huxton) writes: > If you have money to spend, it might be worth checking out > EnterpriseDB - they claim to have Oracle compatibility. News > item/company site below. >http://www.postgresql.org/about/news.367 >http://www.enterprisedb.com/ It would be quite useful

[GENERAL] Tables

2005-10-20 Thread Bob Pawley
I am new to databases.   I have table 1, a primary source, which generates a serial number to make each item unique.   I want to use this number to generate a row in table 2 linking the two rows and allowing specific information on each item to be developed..   I have a number of books, includ

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Dean Gibson (DB Administrator)
On 2005-10-19 23:52, Michael Glaesemann wrote: On Oct 20, 2005, at 15:45 , Roger Hand wrote: On Oct 20, 2005, at 14:50 , Dean Gibson (DB Administrator) wrote: PSQL has the option to output the result of queries in several different formats, including HTML. Suggestion: have an option to

Re: [GENERAL] doc typo sql-reindex.html psql vs. postgres

2005-10-20 Thread Janning Vygen
Am Donnerstag, 20. Oktober 2005 16:04 schrieb Tom Lane: > Janning Vygen <[EMAIL PROTECTED]> writes: > > it says: > > $ export PGOPTIONS="-P" > > $ psql broken_db > > > > It should be: > > $ export PGOPTIONS="-P" > > $ postgres broken_db > > No, it's correct as it stands. You us

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 11:22:25AM -0400, Brian Mathis wrote: > That's why I think the better term for this is "well formed". "Validity" can > only be determined by sending to it, but you can tell if an address at least In fact, it can only be determined by sending to it over and over again, beca

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 06:10:40PM +0300, Andrus wrote: > >From this thread I got the regular expression [snipped] Note that that regular expression, which appears to be validating TLDs as well, is incredibly fragile. John Klensin has actually written an RFC about this very problem. Among other

3-state logic (was: Re: [GENERAL] NULL != text ?)

2005-10-20 Thread Alban Hertroys
Tom Lane wrote: Wrong. SQL doesn't guarantee lazy evaluation. The above will work, but it's because TRUE OR NULL is TRUE, not because anything is promised about evaluation order. Learned something new again, then. I also noticed FALSE OR NULL is NULL, which went against my intuition. I thin

Re: [pgsql-advocacy] [GENERAL] Oracle buys Innobase

2005-10-20 Thread Andrew Sullivan
On Wed, Oct 19, 2005 at 01:02:15PM -0300, Marc G. Fournier wrote: > >that idiocy is that a string with two blank characters is not equal to a > >string with a single blank character in Oracle. 'a ' is not equal to 'a > >'. 'a ' is not equal to 'a'. Port that to another database. Seen the > >J

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Brian Mathis
On 10/20/05, Douglas McNaught <[EMAIL PROTECTED]> wrote: > It performs a MX-lookup, which IMHO is the best way to check for validity.But that's expensive and slow, and doesn't tell you whether the userpart of the address is valid (and in general, there's no way to determine that short of actually s

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrus
""Guy Rouillier"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrus wrote: >> I have a database of e-mail addresses. >> >> I want to select the email addresses which are not valid: >> >> do not contain exactly one @ character, >> contain ; > < " ' , characters or spaces etc. >>

Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy] [GENERAL]

2005-10-20 Thread Kevin Grittner
Dann Corbit wrote: > Try this query in Oracle, SQL*Server, DB/2, Informix, etc.: > > connxdatasync=# select 1 where cast('a' as varchar(30)) = cast('a ' as > varchar(30)); > ?column? > -- > (0 rows) For what it's worth, on Sybase ASE I get: --- 1 (1 row aff

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Lincoln Yeoh
At 05:33 PM 10/19/2005 -0700, Dann Corbit wrote: If there is a significant performance benefit to not expanding text columns in comparison operations, then it seems it should be OK. I probably read the standard wrong, but it seems to me that varchar, char, and bpchar columns should all behave

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Michael Fuhr
On Thu, Oct 20, 2005 at 03:57:41PM +0900, Michael Glaesemann wrote: > On Oct 20, 2005, at 15:44 , Michael Fuhr wrote: > > expression IS DISTINCT FROM expression > > > > For non-null inputs this is the same as the <> operator. However, > > when both inputs are null it will return false, and when

Re: [GENERAL] NEW in Rule makes another nextval call?

2005-10-20 Thread Richard Huxton
Sven Willenberger wrote: On Thu, 2005-10-20 at 15:01 +0100, Richard Huxton wrote: However, in this particular case I think you want an after insert trigger on customer rather than a rule. As as AFTER INSERT trigger, I can safely assume here that NEW.custid wil now properly use the actual value

Re: [GENERAL] NEW in Rule makes another nextval call?

2005-10-20 Thread Sven Willenberger
On Thu, 2005-10-20 at 15:01 +0100, Richard Huxton wrote: > Sven Willenberger wrote: > > Is this intended behavior? or is the NEW > > acting as a macro that is replace by "nextval()" ? > > Well, it's understood behaviour even if not quite "intended". > > You are quite right, rules basically act l

Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] [GENERAL] Oracle buysInnobase)

2005-10-20 Thread Rick Morris
Richard Huxton wrote: Dann Corbit wrote: I can see plenty of harm and absolutely no return. We are talking about blank padding before comparison. Do you really want 'Danniel ' considered distinct from 'Danniel ' in a comparison? In real life, what does that buy you? 100% YES! If two va

Re: [GENERAL] server , client encoding issue

2005-10-20 Thread Tom Lane
Martijn van Oosterhout writes: > On Thu, Oct 20, 2005 at 03:41:51PM +0530, surabhi.ahuja wrote: >> how can i change the client encoding to LATIN1? > Send the query: > set client_encoding=latin1; Also, whatever client-side library you're using may have alternative ways to specify the same thing.

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > Michael Glaesemann wrote: >> if (OLD.value IS NOT NULL and NEW.value IS NOT NULL and OLD.value <> >> NEW.value) or OLD.value IS NULL or NEW.value IS NULL >> >> But that's untested and I have a hard time thinking in three-value logic. > For completen

Re: [GENERAL] doc typo sql-reindex.html psql vs. postgres

2005-10-20 Thread Tom Lane
Janning Vygen <[EMAIL PROTECTED]> writes: > At > http://www.postgresql.org/docs/8.0/static/sql-reindex.html > it says: > Rebuild all system indexes in a particular database, > without trusting them to be valid already: > $ export PGOPTIONS="-P" > $ psql broken_db > It

Re: [GENERAL] NEW in Rule makes another nextval call?

2005-10-20 Thread Richard Huxton
Sven Willenberger wrote: Is this intended behavior? or is the NEW acting as a macro that is replace by "nextval()" ? Well, it's understood behaviour even if not quite "intended". You are quite right, rules basically act like macros with all the limitations they have. What is actually happeni

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Andrew Kelly
On Thu, 2005-10-20 at 08:14 -0400, Jan Wieck wrote: > On 10/20/2005 2:17 AM, Greg Stark wrote: > > > (I can't believe anyone really wants varchar to be space padded. Space > > padding > > always seemed like a legacy feature for databases with fixed record length > > data types. Why would anyone w

Re: [GENERAL] How to check is the table system

2005-10-20 Thread Michael Glaesemann
On Oct 20, 2005, at 18:22 , Андрей wrote: How can I get table's comment, created like this: COMMENT ON TABLE people IS '...comment...' ? What system table keeps comments on databases, schemas and tables? Here are a couple of links to documents that might help. http://www.postgresql.org/doc

[GENERAL] NEW in Rule makes another nextval call?

2005-10-20 Thread Sven Willenberger
On a table ("customer") I have a rule set up that is designed to update a "contacts" table with a customer id once the customer is added to the customer table. (Yes, this does seem backwards but it has to do with the way this system of web-based signups gets translated into a customer record). CR

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread Jan Wieck
On 10/20/2005 2:17 AM, Greg Stark wrote: (I can't believe anyone really wants varchar to be space padded. Space padding always seemed like a legacy feature for databases with fixed record length data types. Why would anyone want a string data type that can't represent all strings?) They must h

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Hannes Dorbath
On 20.10.2005 14:00, Douglas McNaught wrote: But that's expensive and slow Sure, that isn't meant to be used in a WHERE condition on a 100k row table.. more to be bound via check constraint on a user table, so incomming data is validated. and doesn't tell you whether the user part of the a

Re: [GENERAL] Checking Multiplicity Constraints and Retrieving Data from Error Messages

2005-10-20 Thread Martijn van Oosterhout
On Thu, Oct 20, 2005 at 12:44:53PM +0100, Ledina Hido wrote: > I am not sure if CHECK constraints will work, as I don't think you > can reference another table in one of those. And I think it might > even not let you have a subquery (ie a select inside the check > statement). So I don't know

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Douglas McNaught
Hannes Dorbath <[EMAIL PROTECTED]> writes: > On 19.10.2005 21:18, Michael Fuhr wrote: >> One possibility would be to write a plperlu function that uses the >> Email::Valid module. Here's a trivial example; see the Email::Valid >> documentation to learn about its full capabilities: > > ..and if yo

Re: [GENERAL] Checking Multiplicity Constraints and Retrieving Data from Error Messages

2005-10-20 Thread Ledina Hido
On 20 Oct 2005, at 12:31, Martijn van Oosterhout wrote: On Wed, Oct 19, 2005 at 03:25:25PM +0100, Ledina Hido wrote: First of all, is there any way of limiting the number of rows in a table, referencing to the same element of another table? For example, force a manager not to have more than 10

Re: [GENERAL] Checking Multiplicity Constraints and Retrieving Data from Error Messages

2005-10-20 Thread Martijn van Oosterhout
On Wed, Oct 19, 2005 at 03:25:25PM +0100, Ledina Hido wrote: > First of all, is there any way of limiting the number of rows in a > table, referencing to the same element of another table? For example, > force a manager not to have more than 10 employees under his control. > In a way this can

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Edmund
"Andrus" <[EMAIL PROTECTED]> writes: > I have a database of e-mail addresses. > > I want to select the email addresses which are not valid: > > do not contain exactly one @ character, > contain ; > < " ' , characters or spaces etc. > > What is the WHERE clause for this ? > There was a thread

[GENERAL] difficulty formating interval datatypes in 7.4

2005-10-20 Thread Chris Matheson
Hello list, I am working to format an interval in using the to_char() SQL function on postgresql 7.4.8. I've had nothing but disapointment so far. My confusion occurs when I'm trying to format using days where the days output would be more than 99. For example: I would like to do something l

[GENERAL] Checking Multiplicity Constraints and Retrieving Data from Error Messages

2005-10-20 Thread Ledina Hido
As part of my 4th Year Group Design Project, I am required to build a database system that will validate and then store the data. As such I am currently investigating different DB, to choose the most suitable one. I liked many features of PostgreSQL (eg deferring transactions) but there are

Re: [GENERAL] PostgreSQL on Dual Processors, Dual-Core AMD Chips

2005-10-20 Thread
In article <[EMAIL PROTECTED]>, Tony Caduto <[EMAIL PROTECTED]> wrote: >I believe that as each process(backend) is created it will get assigned >to a CPU. At least with Linux the process can run on any CPU. It isn't restricted to some assignment at the time of its creation. -- http://yosemitene

Re: [GENERAL] server , client encoding issue

2005-10-20 Thread Martijn van Oosterhout
On Thu, Oct 20, 2005 at 03:41:51PM +0530, surabhi.ahuja wrote: > how can i change the client encoding to LATIN1? > i know it can be done by changing the postgresql.conf Send the query: set client_encoding=latin1; Have a nice day, -- Martijn van Oosterhout http://svana.org/kleptog/ > Paten

[GENERAL] versions of oDBC driver

2005-10-20 Thread Zlatko Matić
Hello.   Could someone say which versions of ODBC drivers are recommended for PostgreSQL/MS Access 2003 combination, for: a) Postgres 8.0.4 b) Postgres 8.1 beta   Namely, I was not able to connect from my Access front-end when I migrated from Postgres 8.0.4 to Postgres 8.1 beta3 Are ther

Re: [GENERAL] server , client encoding issue

2005-10-20 Thread surabhi.ahuja
Title: Re: [GENERAL] server , client encoding issue how can i change the client encoding to LATIN1? i know it can be done by changing the postgresql.conf   but i want to include it in the code ...   is it possible that PQconnectdb can take a parameter for client encoding if yes how??   if

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Alban Hertroys
Michael Glaesemann wrote: if (OLD.value IS NOT NULL and NEW.value IS NOT NULL and OLD.value <> NEW.value) or OLD.value IS NULL or NEW.value IS NULL But that's untested and I have a hard time thinking in three-value logic. For completeness sake; Because of lazy evaluation, that boils down to

Re: [GENERAL] Reverse engineering SW

2005-10-20 Thread Tino Wildenhain
Hannes Dorbath schrieb: On 19.10.2005 05:16, Bruno Cochofel wrote: His there any SW that can do reverse engineering on postgreSQL databases? I need something that can create entity-relationship models from an already made db, and something that can create a db from a model. Casestudio does t

[GENERAL] doc typo sql-reindex.html psql vs. postgres

2005-10-20 Thread Janning Vygen
At http://www.postgresql.org/docs/8.0/static/sql-reindex.html it says: Rebuild all system indexes in a particular database, without trusting them to be valid already: $ export PGOPTIONS="-P" $ psql broken_db It should be: Rebuild all system indexes in a particu

[GENERAL] How to check is the table system

2005-10-20 Thread Андрей
Hello! How can I get table's comment, created like this: COMMENT ON TABLE people IS '...comment...' ? What system table keeps comments on databases, schemas and tables? Big Thanks, Andrei ---(end of broadcast)--- TIP 5: don't forget

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Martijn van Oosterhout
On Thu, Oct 20, 2005 at 03:23:51PM +0900, Michael Glaesemann wrote: > My personal opinion on this is that there are a lot of different > ideas about how the XML should/could be written, and a the current > output can be piped to a script in language here> to format to match anyone's wish. Rath

Re: [GENERAL] Reverse engineering SW

2005-10-20 Thread Hannes Dorbath
On 19.10.2005 05:16, Bruno Cochofel wrote: His there any SW that can do reverse engineering on postgreSQL databases? I need something that can create entity-relationship models from an already made db, and something that can create a db from a model. Casestudio does this very nice. -- Regards

Re: [GENERAL] log_min_duration_statement oddity

2005-10-20 Thread Csaba Nagy
Thanks Tom, now at least I can stop chasing what I'm doing wrong :-) BTW, will be a way to also log the parameter values for prepared statements ? While debugging performance problems it would be invaluable, in many cases it would help me reproduce the problem when only SOME values cause problems.

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Hannes Dorbath
On 19.10.2005 21:18, Michael Fuhr wrote: One possibility would be to write a plperlu function that uses the Email::Valid module. Here's a trivial example; see the Email::Valid documentation to learn about its full capabilities: ..and if you don't mind installing pl/php, you can use this functi

Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] [GENERAL] Oracle buysInnobase)

2005-10-20 Thread Richard Huxton
Dann Corbit wrote: I can see plenty of harm and absolutely no return. We are talking about blank padding before comparison. Do you really want 'Danniel ' considered distinct from 'Danniel ' in a comparison? In real life, what does that buy you? 100% YES! If two values are the same, then a

Re: [GENERAL] server , client encoding issue

2005-10-20 Thread Richard Huxton
surabhi.ahuja wrote: i checked the locale it is giving: LANG=en_US.iso885915 LC_CTYPE="en_US.iso885915" If you Google for "ISO-8859-15 Latin9" the top two results seem to give details. Oh - there are two naming systems for character sets, just to make things even more complicated. Now,

Re: [GENERAL] From oracle to postgresql...

2005-10-20 Thread Richard Huxton
Rafael Montoya wrote: I need to know if there is a tool that convert oracle procedures and triggers to plpgsql syntax. Please, can anybody tell me where do i download it from?, i'll thank you a lot. I don't know of a free tool that will do procedures. Probably worth reading through Oracle n

Re: [GENERAL] SQL return value...

2005-10-20 Thread Richard Huxton
Cristian Prieto wrote: This is maybe a really newbie question, but, when I have an SQL function like that: $$ Insert into mytable (id, name) values ($1, $2); $$ What return value suppose to return? Either return "void" or return "boolean" and add a "SELECT true;" statement to the end of your

Re: [GENERAL] Create GLOBAL TABLE

2005-10-20 Thread Richard Huxton
Marius Cornea wrote: 1.The sintax for create table is : CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( { column_name data_type [ DEFAULT default_expr ] [ column_constraint [ ... ] ] ... What mean the parameter GLOBAL|LOCAL ?? http://www.postgresql.org/docs/8.0/stat

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Michael Glaesemann
On Oct 20, 2005, at 15:44 , Michael Fuhr wrote: expression IS DISTINCT FROM expression For non-null inputs this is the same as the <> operator. However, when both inputs are null it will return false, and when just one input is null it will return true. Thus it effectively acts as

Re: [GENERAL] PSQL suggested enhancement

2005-10-20 Thread Michael Glaesemann
On Oct 20, 2005, at 15:45 , Roger Hand wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Glaesemann Sent: Wednesday, October 19, 2005 11:24 PM On Oct 20, 2005, at 14:50 , Dean Gibson (DB Administrator) wrote: PSQL has the option to outp