ect case when $1 then 0 else 1 end; ' language sql;
And that's back-to-front ;)
create or replace function bool2int (boolean) returns integer as '
select case when $1 then 1 else 0 end;
' language sql
Thanks for the example of the use of casts.
Alex Satrapa
---
tice when someone attempts to CREATE (UNIQUE) INDEX on a column that is inherited? At least the programmer would then be alerted to the problem before it bites them.
For the record, this "foreign key not working on tables defined using inherit" issue affects all versions of PostgreSQL up to at leas
nomalies, I was hoping to take advantage of the object-relational features of PostgreSQL to make my work a little easier.
Does anyone know whether I'm just doing something wrong, or is the old documentation still correct?
Thanks
Alex Satrapa
---(end of broadcast)---
that gets turned to slag.
Alex Satrapa
---(end of broadcast)---
TIP 8: explain analyze is your friend
s. They can't make
wholesale changes to your database such as "select * from
credit_card_details; truncate invoices; drop table accounts_receivable;"
etc.
Regards
Alex Satrapa
---(end of broadcast)---
TIP 3: if posting/reading th
ore.
DBD::Pg defaults to "AutoCommit" behaviour, unless you explicitly turn
it off:
my $dbh = DBI->connect (
"DBI:Pg:dbname=database", "user" , "password",
{AutoCommit => 0}
);
HTH
Alex Satrapa
---(end of broadcas
loop
insert into test values (i,''Test'');
end loop;
return s_out;
End;
' language 'plpgsql';
The rest looks fine (works for me - yes I tested it this time)
Alex Satrapa
---(end of broadcast)---
TIP 9: the pla
Chris Ochs wrote:
Never mind, I forgot to quote the quote's...
Heh... and here I was thinking you were trying to build a function ;)
And I made the same mistake as you... guess I should proofread instead
of copy-pasting ;)
Alex Satrapa
---(end of broa
Chris Ochs wrote:
CREATE FUNCTION taxship(varchar,integer,varchar,float,float) returns integer
AS '
insert into taxship(s_oid,order_id,mer_id,tax,shipping) values
('$1',$2,'$3',$4,$5);
SELECT 1;
' LANGUAGE SQL;
try
CREATE FUNCTION taxship (varchar,integer,varchar,float,float) RETURNS
integer AS '
Dann Corbit wrote:
But as for the DEFAULT '' NOT NULL entries, CODD and Date eventually
decided that NULL data was a big mistake.
While SQL programmers are used to it, most end users with slim SQL
familiarity will be pretty shocked when:
And so, too, will man people with little or no understanding
Alex Satrapa wrote:
I'm currently exploring the Zelerate AllCommerce system
http://allcommerce.sourceforge.net
Ick... this product is *so* the poster child of the MySQL generation:
#
# Table structure for table 'addresses'
#
CREATE
Mike Nolan wrote:
I may need to move a web store to another hosting facility or rewrite it.
I'm currently exploring the Zelerate AllCommerce system
http://allcommerce.sourceforge.net
I haven't even reached the stage of installing it yet. It's designed to
run out-of-the-box on MySQL, so I'm a lit
Chris Travers wrote:
Here is a paper I have written for the purposes of providing some
additional educational material for the MySQL crowd.
Here's my contribution:
Why I choose PostgreSQL (PostgreSQL in 21 Seconds)
I choose referential integrity, meaning my lookups always work.
I choose stor
John Wells wrote:
Ok...this has irritated me for sometime. I've seen reference to dividing
it up into proper syllables in the mailing archives, but couldn't find
pronunciation of the "gres" part...
FOLDOC (Free Online Dictionary of Computing) says:
PostgreSQL
/'post-gres-kyu-el/ An enhancemen
Ausrack Webmaster wrote:
The thing is...I am not. I am inserting it into a varchar field.
Are there any single quotes in the message body? They will wreak havoc
with the rest of the query. And why are you putting single quotes around
'$parent'?
What happens if you move the '$body' to the end:
Tom Lane wrote:
Greg Stark <[EMAIL PROTECTED]> writes:
I just dropped a column that I wish I hadn't. Is there some simple update i
could do to the pg_* tables that would undrop it?
You could rsync the database back from your live off-site backup, or
rifle through the piles of backups to recover f
Jason Tesser wrote:
We are evaluating Postgres and would like some input about disaster recovery.
I'm going to try to communicate what I understand, and other list
members can correct me at their selected level of vehemence :)
Please send corrections to the list - I may take days to post follow-up
Randolf Richardson wrote:
From my perspective MySQL and PostgreSQL are completely different
projects (for starters they even use different licensing schemes -- BSD v.
GPL) that are in competition. Since PostgreSQL stands on its own without
any dependencies on MySQL, I don't see any reason
Randolf Richardson, DevNet SysOp 29 wrote:
[sNip]
Do a shutdown -h on a live database machine with pg. It will gracefully
shut itself down.
Is that true for all OS flavors and is it dependent upon the DBA having
set up proper shutdown scripts?
[sNip]
When I tested this on PostgreSQL on Novel
done before or
after the "Unique" processing. However, since the column(s) I'm
filtering on are only those present in the "on distinct" clause, it
makes no difference whether the filter is before or after the
"Unique"-ifying.
Am I totally stark, raving mad?
Alex Satrapa
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Kathy Zhu wrote:
I know we have LIMIT to limit the number of rows returned, I wonder if there is
a way to indicate an offset.
Select * from Test offset 10, limit 4;
As per the PostgreSQL documentation, specifically the page on the
"SELECT" SQL command:
LIMIT Clause
LIMIT { count | ALL }
21 matches
Mail list logo