Re: [SQL] alter column type from boolean to char with default

2006-08-03 Thread Tom Lane
"Andrew Hammond" <[EMAIL PROTECTED]> writes: > Alternatively, you already have the USING clause to tell you how to > alter the data. How about using it to alter the default as well? The reasons not to do that are already set forth in the ALTER TABLE man page. regards, tom

Re: [SQL] Error: out of memory in create table as

2006-08-03 Thread Tom Lane
jason nordwick <[EMAIL PROTECTED]> writes: > ERROR: out of memory > DETAIL: Failed on request of size 856. > CONTEXT: SQL statement "create table gwt as select * from gworktick" > PL/pgSQL function "processadd" line 30 at SQL statement What PG version? What does "explain select * from gworktic

[SQL] Error: out of memory in create table as

2006-08-03 Thread jason nordwick
I'm having memory problems. I needed to materialize a couple views (create table t as select * from v) to get acceptable performance from a small data storage system I'm building, but now I get out of memory issues on that statement. It is near the bottom of about a 40 line function, and it com

Re: [SQL] alter column type from boolean to char with default

2006-08-03 Thread Andrew Hammond
Tom Lane wrote: > Rod Taylor <[EMAIL PROTECTED]> writes: > > On Wed, 2006-08-02 at 09:19 -0400, Tom Lane wrote: > >> Hmm ... the way I would have expected to work is > >> > >> alter table posts > >> alter column deleted drop default, > >> alter column deleted type char(1) > >> using (case when dele

Re: [SQL] Function not return zero record

2006-08-03 Thread Richard Huxton
Sylvain Racine wrote: Hello, I wrote a simple function who checks in a table an address and returns the id and coordinates of the corresponding address. The problem is when I run separately the SQL query, it gives me zero (0) entry when I submit a new address - it is what I want as result -

[SQL] Function not return zero record

2006-08-03 Thread Sylvain Racine
Hello, I wrote a simple function who checks in a table an address and returns the id and coordinates of the corresponding address. The problem is when I run separately the SQL query, it gives me zero (0) entry when I submit a new address - it is what I want as result - and when I run my func

Re: [SQL] SELECT all fields except two

2006-08-03 Thread Andrew Hammond
This does not exist in SQL. However you could achieve similar functionality by doing a suitable query against the system info tables to find out what columns are available and then building your query appropriately. For an example, try psql -E -c '\d mytable' Drew Pit M. wrote: > select *,!Blob