[GENERAL] Metadata/ODBC query

2008-02-16 Thread [EMAIL PROTECTED]
Hi I'm experimenting with PostgreSQL 8.3.0 on Windows connecting via ODBC. One curiosity so far is this: If I use pgAdmin and run SELECT catalog_name FROM Information_Schema.Schemata I get data back as expected. If I connect via ODBC and issue the same query I don't see any data. SQLFetch()

Re: [GENERAL] Metadata/ODBC query

2008-02-16 Thread Tom Lane
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: If I use pgAdmin and run SELECT catalog_name FROM Information_Schema.Schemata I get data back as expected. If I connect via ODBC and issue the same query I don't see any data. What userid are you connecting as under ODBC? Has it got privileges to

Re: [GENERAL] Metadata/ODBC query

2008-02-16 Thread Tom Lane
I wrote: What userid are you connecting as under ODBC? Has it got privileges to any of the schemas? The information_schema views generally hide objects that you have no privileges for ... In fact, looking closer, it looks like the schemata view only shows you schemas that you are the *owner*

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Phoenix Kiula
IN the second SQL, I meant this: WHERE modify_date '2008-01-01' On 16/02/2008, Phoenix Kiula [EMAIL PROTECTED] wrote: I have a table with an index on a field called modify_date. This works well if I have SQL which ends in WHERE modify_date = '2008-01-01' But if I try this

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Michael Glaesemann
On Feb 15, 2008, at 18:11 , Ken Johanson wrote: Tom, is it accurate to assume that newer PG versions will further tighten type-strictness (say, '2008-01-01' presently being comparable to a datetime)? Also, do you know of any other vendors that are heading in this direction (removing by

[GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Phoenix Kiula
I have a table with an index on a field called modify_date. This works well if I have SQL which ends in WHERE modify_date = '2008-01-01' But if I try this condition: WHERE modify_date = '2008-01-01' THis index is not used. The EXPLAIN tells me it needs to do a seq scan. Why is this?

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Tom Lane
Michael Glaesemann [EMAIL PROTECTED] writes: test=# select '2008-02-15' CURRENT_DATE; Here, we're comparing against a date type, so Postgres treats '2008-02-15' as a date. It might be worth pointing out that this is not magic, but an application of the general rule mentioned at step 2a

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-16 Thread Ken Johanson
Tom Lane wrote: Hm, good point, so really we ought to have a separate casting path for numeric types to char(n). However, this section still doesn't offer any support for the OP's desire to auto-size the result; it says that you get an error if the result doesn't fit in the declared length:

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-16 Thread Tom Lane
Ken Johanson [EMAIL PROTECTED] writes: Tom Lane wrote: Hm, good point, so really we ought to have a separate casting path for numeric types to char(n). However, this section still doesn't offer any support for the OP's desire to auto-size the result; it says that you get an error if the

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Phoenix Kiula
This table is vacuumed and analyzed every hour, so yes, it's been analyzed recently. These are the EXPLAIN ANALYZE outputs for both the equality condition and the greater than condition: orguser=# explain analyze select alias from clientswhere modify_date = '2008-01-01' ;

[GENERAL] Analogue to SQL Server UniqueIdentifier?

2008-02-16 Thread [EMAIL PROTECTED]
Hi My porting experiment has encountered the SQL Server UniqueIdentifier problem. I can see one or two suggestions about this have been made over the years but I'd like to try and stay close to the original. So: I'm wondering if I can use a combination of a domain 'hack' for syntatic

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Ken Johanson
Michael Glaesemann wrote: On Feb 15, 2008, at 18:11 , Ken Johanson wrote: Tom, is it accurate to assume that newer PG versions will further tighten type-strictness (say, '2008-01-01' presently being comparable to a datetime)? Also, do you know of any other vendors that are heading in this

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Tom Lane
Michael Glaesemann [EMAIL PROTECTED] writes: The planner will choose a seq scan if it thinks that it will be faster than using an index: if based on its statistics it thinks a large portion of rows will match the criteria, a seq scan may well be faster than an index scan. Have you

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Michael Glaesemann
On Feb 16, 2008, at 9:42 , Phoenix Kiula wrote: The EXPLAIN tells me it needs to do a seq scan. Why is this? How can I make a date/time field index which uses both equality criteria and the greater than/lesser than/between criteria? The planner will choose a seq scan if it thinks that it

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Tom Lane
Phoenix Kiula [EMAIL PROTECTED] writes: orguser=# explain analyze select alias from clientswhere modify_date '2008-01-01' ; QUERY PLAN

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-16 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Tue, 12 Feb 2008, Tom Lane wrote: Also, section 6.10 cast specification defines an explicit cast to a fixed-length string type as truncating or padding to the target length (LTD): Are you sure that's the correct section to be using? Isn't that 6.10

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Ken Johanson
Tom Lane wrote: Ken Johanson [EMAIL PROTECTED] writes: select 5'6' - true select 5'6' - false select 15'60' - true select 15'60' - false These examples miss the point, because they'd give the same answer whether you think the values are text or integer. Consider instead these cases:

[GENERAL] nntp interface not working?

2008-02-16 Thread Arturo PĂ©rez
HI all, The news/NNTP feed to these mailing lists does not seem to be working. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Tom Lane
Ken Johanson [EMAIL PROTECTED] writes: select 5'6' - true select 5'6' - false select 15'60' - true select 15'60' - false These examples miss the point, because they'd give the same answer whether you think the values are text or integer. Consider instead these cases: regression=# select 7

Re: [GENERAL]

2008-02-16 Thread Robbie Thurman
Why would I want to purchase a replica from Prestige Replicas? There may be many reasons: a) You want a genuine Rolex / Breitling watch, but the price is too ridiculous b) You want to impress your friends or business clients c) You want to keep your original safe, while using the replica for

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-16 Thread Stephan Szabo
On Sat, 16 Feb 2008, Tom Lane wrote: Stephan Szabo [EMAIL PROTECTED] writes: On Tue, 12 Feb 2008, Tom Lane wrote: Also, section 6.10 cast specification defines an explicit cast to a fixed-length string type as truncating or padding to the target length (LTD): Are you sure that's the

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Phoenix Kiula
On 17/02/2008, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 16/02/2008, Greg Smith [EMAIL PROTECTED] wrote: top -bc | tee topdata That will save everything to a file called topdata while also letting you watch it scroll by. Not as easy to catch the bad periods that way, the output is

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Phoenix Kiula
On 17/02/2008, Shashank Tripathi [EMAIL PROTECTED] wrote: On 17/02/2008, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 17/02/2008, Phoenix Kiula [EMAIL PROTECTED] wrote: ~ top -b -d 1 | awk -f top.awk | tee topdata awk: top.awk:24: for(i=8;ilast;i++ awk: top.awk:24:

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Andrej Ricnik-Bay
On 17/02/2008, Phoenix Kiula [EMAIL PROTECTED] wrote: But this is kind of sitting there, hogging the command prompt. Is there any way I can let it go on in the background? Ouch ... no, that's entirely my fault, wasn't quite awake I guess, and hadn't thought it through completely ... that's not

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-16 Thread Stephan Szabo
On Sat, 16 Feb 2008, Ken Johanson wrote: Tom Lane wrote: Hm, good point, so really we ought to have a separate casting path for numeric types to char(n). However, this section still doesn't offer any support for the OP's desire to auto-size the result; it says that you get an error if

Re: [GENERAL] Pains in upgrading to 8.3

2008-02-16 Thread Bruce Momjian
Magnus Hagander wrote: Dave Page wrote: On Fri, Feb 15, 2008 at 4:21 PM, Tony Caduto [EMAIL PROTECTED] wrote: paul rivers wrote: Going from 8.2.4 and 8.2.6 to 8.3.0 has been painless for me. However, unlike the blogger you cite, I read the directions before, not after,

Re: [GENERAL] Query output into a space delimited/location sensitive file

2008-02-16 Thread Bruce Momjian
Ubence Quevedo wrote: What would the command be to have a query result be put into a location/space sensitive file [position 1 through 5 would be one thing where position 6 through 10 would be the next field, 11 through 16 another, etc]? Is this even possible with Postgres? Not

Re: [GENERAL] Query output into a space delimited/location sensitive file

2008-02-16 Thread Scott Marlowe
On Feb 16, 2008 5:29 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Ubence Quevedo wrote: What would the command be to have a query result be put into a location/space sensitive file [position 1 through 5 would be one thing where position 6 through 10 would be the next field, 11 through 16

Re: [GENERAL] Query output into a space delimited/location sensitive file

2008-02-16 Thread Ubence Quevedo
Scott, you are exactly right. I am looking to take various data in multiple tables and create an output file delimited into specific sections. I'll look more into the proper usage of select into as well as the substring/field example you have given below. Thanx! On Feb 16, 2008, at

Re: [GENERAL] Query output into a space delimited/location sensitive file

2008-02-16 Thread Scott Marlowe
On Feb 16, 2008 7:19 PM, Ubence Quevedo [EMAIL PROTECTED] wrote: Scott, you are exactly right. I am looking to take various data in multiple tables and create an output file delimited into specific sections. I'll look more into the proper usage of select into as well as the substring/field

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Tom Lane
Ken Johanson [EMAIL PROTECTED] writes: Tom Lane wrote: These examples miss the point, because they'd give the same answer whether you think the values are text or integer. ... Agreed, so should we disallow 7 '08'? Maybe, but the usability ramifications would be enormous --- you'd also be

Re: [GENERAL] Query output into a space delimited/location sensitive file

2008-02-16 Thread Greg Smith
On Fri, 15 Feb 2008, Ubence Quevedo wrote: What would the command be to have a query result be put into a location/space sensitive file [position 1 through 5 would be one thing where position 6 through 10 would be the next field, 11 through 16 another, etc]? Is this even possible with