Re: [SQL] error with mor than 1 sub-select

2006-08-23 Thread Erik Jones
Actually, it pointed you right to it. Notice that exits is just before where the pointer was. chrisj wrote: thanks, stupid user error. i guess the pointer on the error message led me astray Michael Fuhr wrote: On Tue, Aug 22, 2006 at 06:47:51PM -0700, chrisj wrote: The first

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: Is AS in SELECT my_column AS my_name FROM my_table mandatory to be SQL92 compliant? No. I have a patch at http://developer.postgresql.org/~petere/select-without-as/select-without-as.patch that fixes this at least for 7.4. I don't

Re: [SQL] SQL92 compliance

2006-08-23 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: Is AS in SELECT my_column AS my_name FROM my_table mandatory to be SQL92 compliant? No. I have a patch at http://developer.postgresql.org/~petere/select-without-as/select-without-as.patch

[SQL] The length of the sql query

2006-08-23 Thread Emi Lu
Hello, Just curious to know whether postgresql has any length constraint about where part, such as Query = [ select col1, col2, ... coln from table 1, table2, where constraint1 + constraint2 +constraintN ] Is there any length arrange for the Query str such

Re: [SQL] SQL92 compliance

2006-08-23 Thread Scott Marlowe
On Wed, 2006-08-23 at 12:40, Tom Lane wrote: Peter Eisentraut [EMAIL PROTECTED] writes: Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: Is AS in SELECT my_column AS my_name FROM my_table mandatory to be SQL92 compliant? No. I have a patch at

[SQL] All columns from table in a joined query

2006-08-23 Thread MHahn
I've been trying to figure out how to do the following: Select schedule.* from schedule join meetingday on schedule.id = meetingday.scheduleid where sessionnumber = 165 group by schedule.* order by min(meetingday.date); Is this possible in any way, or do I need to list each field of the

[SQL] Deleting Functions

2006-08-23 Thread Scott Petersen
Folks, I am using PGSQL do do all of my schema changes, but have run into a problem. I need to be able to DROP all of the USER FUNCTIONS that are defined in a schema. The problem is that I do not know the names of all of the functions and parameters. I know that I could use '\df' and then

Re: [SQL] All columns from table in a joined query

2006-08-23 Thread Sumeet
You need to create a custom aggregate for this CREATEAGGREGATEarray_accum( sfunc=array_append, basetype=anyelement, stype=anyarray, initcond='{}' ); then use the field names in your query like this select array_to_string(array_accum(field1 || '@' || field2),'#') as field_alias from

Re: [SQL] Deleting Functions

2006-08-23 Thread Jim Buttafuoco
Scott, I use the following query with psql \o option. Change the schema name from public to whatever. I am sure you could put this into a plpgsql function using execute as well. Jim \o drops.sql select 'drop function ' || nspname || '.' || proname || '(' ||

Re: [SQL] All columns from table in a joined query

2006-08-23 Thread Tom Lane
[EMAIL PROTECTED] writes: I've been trying to figure out how to do the following: Select schedule.* from schedule join meetingday on schedule.id = meetingday.scheduleid where sessionnumber = 165 group by schedule.* order by min(meetingday.date); I think what you're after is select * from

Re: [SQL] Deleting Functions

2006-08-23 Thread Tom Lane
Jim Buttafuoco [EMAIL PROTECTED] writes: select 'drop function ' || nspname || '.' || proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ');' from pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where nspname='public'; Seems like you could do that more easily with