[SQL] const cast ?

2001-02-02 Thread doj
Hello Postgres Users and Developers, I have the following scenario: create table t (i int); create index ti on t(i); Now this table is filled with some values and the table is vacuum analyzed. Now I would like to run queries on this table which should use the index whenever possible, so they

RE: [SQL] const cast ?

2001-02-02 Thread Michael Ansley
Title: RE: [SQL] const cast ? The problem is that there is no way of determining whether or not the sort order after the function has been executed will be the same as the sort order on the raw data. For example, the sort order of n (-10..10) is very different to the sort order of abs(n). So

Re: [SQL] binary operators

2001-02-02 Thread Peter Eisentraut
Frederic Metoz writes: I am looking for the binary AND and OR ... SHIFT as well. Do they exist for postgresql ? in 7.1 -- Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/

Re: [SQL] Suggestion for psql: --file -

2001-02-02 Thread Peter Eisentraut
Albert REINER writes: wouldn't it be a good idea (and if it is, I am not sure what list to post it to) to have psql's option -f / --file take "-" for stdin, as many programs do? Seems reasonable. P.S: BTW, the man page (7.0.2) of psql is not very clear: it took me some experimentation to

Re: [SQL] 7.0.2-docs: textpos - strpos

2001-02-02 Thread Peter Eisentraut
Albert REINER writes: in the 7.0.2-docs I find the function textpos: However, in psql it seems one has to use strpos: textpos() was removed from the 7.1 documentation. position() is the SQL function, I think strpos() is from Oracle. -- Peter Eisentraut [EMAIL PROTECTED]

Re: [SQL] const cast ?

2001-02-02 Thread Michael Fork
You can create a function with the IsCacheable attribute... CREATE FUNCTION my_date_part(date) RETURNS int4 AS ' SELECT date_part('year', $1); ' LANGUAGE 'sql' WITH iscachable(); (This can be found in the create function docs, or in Bruce's book -- both available on the website)

[SQL] Four Odd Questions

2001-02-02 Thread Josh Berkus
Folks, 1. Has anyone had experience with trying to link Informix's 4GL as a procedural language extension for PostgreSQL? ANyone care to speculate? I happen to have access to a couple of former Informix employees ... 2. Is there any documentation on the SQL changes being incorporated into

Re: [SQL] Four Odd Questions

2001-02-02 Thread Roberto Mello
On Fri, Feb 02, 2001 at 04:37:34PM -0800, Josh Berkus wrote: Folks, 1. Has anyone had experience with trying to link Informix's 4GL as a procedural language extension for PostgreSQL? ANyone care to speculate? I happen to have access to a couple of former Informix employees ...

Re: [SQL] const cast ?

2001-02-02 Thread Tom Lane
Michael Fork [EMAIL PROTECTED] writes: You can create a function with the IsCacheable attribute... CREATE FUNCTION my_date_part(date) RETURNS int4 AS ' SELECT date_part('year', $1); ' LANGUAGE 'sql' WITH iscachable(); The reason date_part --- and most other datetime-related functions