[SQL] a question to developers

2003-11-11 Thread sad
Hello Developers what had drove you to use CSTRING type for input argument of postgres-type input convertion functions (in general) and for output of postgres-type output conversion functions ? thanx ---(end of broadcast)--- TIP 6: Have you

Re: [SQL] How to know column constraints via system catalog tables

2003-11-11 Thread Christoph Haller
> > Hi, > > I need to query each column's constraint and name of a table in > postgreSQL v7.3.4 with a single SQL query but don't know how. Would > appreciate any pointers! > > Thank you. > > Regards, > Damon > select relname,conname from pg_constraint,pg_class where pg_class.oid=conrelid ;

Re: [SQL] pg 7.4.rc1, Range query performance

2003-11-11 Thread ow
--- Bruce Momjian <[EMAIL PROTECTED]> wrote: > Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Sorry there isn't a simple solution. > > > > But there is: make an index with the column order (b,c,a). > > Oh, yea, right. If he puts the columns he is doing a straight equals > c

[SQL] curly braces to group outer joins in queries from OpenOffice.org?

2003-11-11 Thread Palle Girgensohn
Hi! I just tried using openoffice to create a SQL query, but it failed when I tried using left outer joins. The contructed query from OO contains curly braces to group things. I've never seen this construct before. Is it OO doing bad things, or does postgresql not understand it? It's on pg-7.3.

Re: [SQL] Getting the row_count value outside of a function

2003-11-11 Thread Christoph Haller
> > I can get the row_count value inside of a function, > but I can“t get it outside of a function. > > How can I do this? > > Regards, > Enio > Ok, you're outside of a function, but there must be another environment which isn't nirvana. Where are you? Regards, Christoph ---

Re: [SQL] transaction processing after error in statement

2003-11-11 Thread Jan Wieck
Holger Jakobs wrote: Why is that "funny behaviour" for you? By putting the statements into a transaction block you told the data management system "I want this group of statements to be atomic". Atomic means all or nothing. It might not be exactly what you intended to say, and you have a point if

Re: [SQL] curly braces to group outer joins in queries from OpenOffice.org?

2003-11-11 Thread Tom Lane
Palle Girgensohn <[EMAIL PROTECTED]> writes: > I just tried using openoffice to create a SQL query, but it failed when I > tried using left outer joins. The contructed query from OO contains curly > braces to group things. I've never seen this construct before. The SQL standard has never heard o

Re: [SQL] How to know column constraints via system catalog tables

2003-11-11 Thread Christoph Haller
> > Thanks for the reply but my main problem is I'm trying to find the primary column(s) > and the data type of these column in a table. pg_constraint's conkey is a int2[] > field. So if i have a table called 'films' (taken from postgreSQL doc) that has two > primary keys (composite primary key

Re: [SQL] curly braces to group outer joins in queries from

2003-11-11 Thread Palle Girgensohn
What about the `OJ'? FROM ( OJ table alias left join table2 alias2 ) OJ seems plain wrong, right? Here's their code snippet (from oo_1.1_src/dbaccess/source/ui/querydesign/QueryDesignView.cxx): if(aJoin.getLength()) { ::rtl::OUString aStr = ::rtl::OUString::createFromAscii("{ OJ ");

Re: [SQL] curly braces to group outer joins in queries from OpenOffice.org?

2003-11-11 Thread Tom Lane
Palle Girgensohn <[EMAIL PROTECTED]> writes: > Here's their code snippet (from > oo_1.1_src/dbaccess/source/ui/querydesign/QueryDesignView.cxx): > if(aJoin.getLength()) > { > ::rtl::OUString aStr = ::rtl::OUString::createFromAscii("{ OJ "); > aStr += aJoin; > aStr += ::rtl::OUSt

Re: [SQL] curly braces to group outer joins in queries from

2003-11-11 Thread Palle Girgensohn
Only, I set up postgreql to connect using JDBC... :( So, the bug is that OO expects an ODBC connection, and I use JDBC... Seems logical. I'll go ask the ODBC guys. Thanks for you help, /Palle --On tisdag, november 11, 2003 11.28.57 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: Palle Girgensohn <[

Re: [SQL] curly braces to group outer joins in queries from OpenOffice.org?

2003-11-11 Thread Tom Lane
Palle Girgensohn <[EMAIL PROTECTED]> writes: > Only, I set up postgreql to connect using JDBC... :( > So, the bug is that OO expects an ODBC connection, and I use JDBC... Seems > logical. I'll go ask the ODBC guys. Thanks for you help, I do not know if the JDBC spec includes ODBC-style brace cons

[SQL] Bit strings

2003-11-11 Thread Yasir Malik
Hello, For a data warehousing project I will have to implement bitmaps. I would perfer to stay away from C, Java, etc., and would like to use PostgreSQL instead. I have a question about bit string type: does the time it takes to do the & or | of two bit strings run in constant time (as it does i

[SQL] question to developers

2003-11-11 Thread sad
Hello Developers what had drove you to use CSTRING type for input argument of postgres-type input convertion functions (in general) and for output of postgres-type output conversion functions ? thanx ---(end of broadcast)--- TIP 9: the planne

Re: [SQL] transaction processing after error in statement

2003-11-11 Thread Holger Jakobs
> > Why is that "funny behaviour" for you? By putting the statements into > a transaction block you told the data management system "I want this > group of statements to be atomic". Atomic means all or nothing. It > might not be exactly what you intended to say, and you have a point > if you concl

Re: [SQL] transaction processing after error in statement

2003-11-11 Thread Holger Jakobs
On 11 Nov, Jan Wieck wrote: > As long as we talk in an SQL context, can you please stick to SQL > terms? I don't know exactly what you mean with "operation". If for > example the statement > > DELETE FROM order_line WHERE ol_ordernum = 4711; > > has 12 matching rows in order_line, is an op

Re: [SQL] 7.3 how remove password valid until

2003-11-11 Thread alban
Bruce Momjian wrote: > I think you have to specify the data as 'infinity'. > > test=> CREATE USER x WITH VALID UNTIL '2005-01-01'; > CREATE USER > test=> ALTER USER x WITH VALID UNTIL 'infinity'; > ALTER USER > Thank You Alban ---(end of broadcast)--

[SQL] Is there a more elegant way to write this query?...

2003-11-11 Thread Nick Fankhauser - Doxpop
Hi- I'm suffering from a performance problem, but when I look at my query, I'm not convinced that there isn't a better way to handle this in SQL. -So I'm seeking advice here before I go to the performance list. I have three tables- case, actor and actor_case_assignment. As the names imply, actor

Re: [SQL] Is there a more elegant way to write this query?...

2003-11-11 Thread Nick Fankhauser
Hi Eric- Thanks for your suggestion. > An explain analyze would help. I'll do that (and move the question to the performance list) when I get to the performance question, but at this point, I'm just seeking some help in looking at this from a different angle- I couldn't figure out how to achieve

[SQL] Quota query with decent performance?

2003-11-11 Thread Troels Arvin
Hello, I'm researching how "quota queries" (a term used by Fabian Pascal) may be performed in various DBMSes with acceptable performance: http://troels.arvin.dk/db/rdbms/#select-limit-simple-note An example of a quota query could be to get the top-3 youngest people from a collection of people. Th

Re: [SQL] Quota query with decent performance?

2003-11-11 Thread Josh Berkus
Troels, Thank you for contacting us before publishing your results. Please ignore any list-trolls who criticize your methodology; there are a few cranks on every list. The important thing is your contacted us. > In MSSQL and DB2 there are very efficient facilities for such queries, but > I

Re: [SQL] Quota query with decent performance?

2003-11-11 Thread Chester Kustarz
maybe: select * from person where age <= (select age from person order by age limit 1 offset 2); 7.20 msec assuming it does what you want. On Tue, 11 Nov 2003, Troels Arvin wrote: > An example of a quota query could be to get the top-3 youngest people from > a collection of people. The complica

Re: [SQL] Quota query with decent performance?

2003-11-11 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: > Second, the query you post is one "SQL Standard" way, which is good for > portability but not for speed. Frankly, I'm not convinced that it's even the > best SQL standard way. On the other databases, you seem happy to use > non-SQL-standard syntax, so l