how about using 2 tables with according unique/primary key constraints and a
view to actually access the data (mixing the 2 tables into one) ?
On Saturday 08 October 2005 22:36, Miles Keaton wrote:
I'm stuck on a brain-teaser with CONSTRAINT:
Imagine a table like lineitems in a bookstore -
On Sat, 2005-10-08 at 22:36 -0700, Miles Keaton wrote:
... both isbn and name MUST be in the table, and what I'm
trying to do is put a CONSTRAINT on the table definition to protect
against user error, by making sure that any entered isbn is only tied
to one book-name in that table.
Create a
How to use pg_autovacuum
?
I've been using SuSE and PostgreSQL for a fairly long time. Recently
(last 12 months), I've noticed that the 9.x (9.2 and 9.3 specifically)
versions of SuSE do not include PostgreSQL on the CD install -- only on
the DVD. At first (9.2), I thought it was just a glitch that didn't get
fixed in 9.3.
In the tsearch2 documentation I see a lot of examples where you
add a column of type tsvector to your table and then indexing
that column.
Instead of adding the extra column, would it be possible to
just make a functional index something like this:
create index foo__tsearch on foo using gist
Hello.
I downloaded 8.0.4 Windows installer and wanted to
update my previos 8.0.3 installation, by using upgrade.bat.
Unfortunately I was not able to do it. Just before
the end of installation an error apears "Service 'PostgreSQL Database Server
8.0' (pgsql-8.0) could not be installed.
Ron,
tsearch index is lossy, so search results needs to be verified.
If you have separate tsvector column you could use it and get all benefit
of to_tsvector already process documents (parsing, dictionaries lookup,...),
instead of reading entire document from disk and process it again.
Read
Oleg Bartunov wrote:
You could increase statistics or try contrib/tsearch2
Oleg
On Fri, 7 Oct 2005, [EMAIL PROTECTED] wrote:
Hello,
We have a table of people with a date-of-birth and a surname, both
indexed.
We have queries like this:
select report from table where dateofbirth =
On Sat, Oct 08, 2005 at 05:01:50PM -0500, Jim C. Nasby wrote:
Though AFAIK there wouldn't be anything illegal about someone with a
commercial license of MySQL using the GPL'd version of InnoDB... but of
course if they did that they'd have GPL'd software again, so no reason
to pay for the
[EMAIL PROTECTED] writes:
Hello all,
I am writing an app in PHP that uses a PostGres database.
One thing i have noticed is that what should/could be a single line of
SQL code takes about 6 lines of PHP. This seem wasteful and redundant
to me.
Here is a sample of what I'm talking about
[EMAIL PROTECTED] writes:
Hello all,
I am writing an app in PHP that uses a PostGres database.
One thing i have noticed is that what should/could be a single line of
SQL code takes about 6 lines of PHP. This seem wasteful and redundant
to me.
Here ya go!...
create temp table foo (
=?iso-8859-2?Q?Zlatko_Mati=E6?= [EMAIL PROTECTED] writes:
How to use pg_autovacuum ?
Read the README file for it.
regards, tom lane
---(end of broadcast)---
TIP 6: explain analyze is your friend
Hi all,
If I want to get dates in the European format, what's the difference
between (a) including -o -e on the postmaster command line and (b)
uncommenting datestyle='iso,dmy' in postgresql.conf?
If there's no difference, which is the preferred/recommended method?
--Ray.
Gregory Youngblood [EMAIL PROTECTED] writes:
I've been using SuSE and PostgreSQL for a fairly long time. Recently
(last 12 months), I've noticed that the 9.x (9.2 and 9.3 specifically)
versions of SuSE do not include PostgreSQL on the CD install -- only on
the DVD. At first (9.2), I thought it
Hi,
On Sun, 9 Oct 2005, Tom Lane wrote:
Gregory Youngblood [EMAIL PROTECTED] writes:
I've been using SuSE and PostgreSQL for a fairly long time. Recently
(last 12 months), I've noticed that the 9.x (9.2 and 9.3 specifically)
versions of SuSE do not include PostgreSQL on the CD install --
Raymond O'Donnell [EMAIL PROTECTED] writes:
If I want to get dates in the European format, what's the difference
between (a) including -o -e on the postmaster command line and (b)
uncommenting datestyle='iso,dmy' in postgresql.conf?
If there's no difference, which is the
I think is almost the same that in many other languages, and like in
many other with the time you can have function's libraries, or more
likely class libraries with the usefull stuff.
In desktop programming environments you have components, here you have
classes that are the same thing using it
Hello all,
I am writing an app in PHP that uses a PostGres database.
One thing i have noticed is that what should/could be a single line of
SQL code takes about 6 lines of PHP. This seem wasteful and redundant
to me.
Here is a sample of what I'm talking about ($db is a PDO already
defined and
Gordon Burditt wrote:
[...stuff snipped...]
MySQL permits (but it's not standard, and available in MySQL 4.1.0
and later):
INSERT INTO my.table (somefield) VALUES ('$someval') ON DUPLICATE
KEY UPDATE somefield = '$someval';
This is very useful for times when you want to count something
I am writing an app in PHP that uses a PostGres database.
One thing i have noticed is that what should/could be a single line of
SQL code takes about 6 lines of PHP. This seem wasteful and redundant
to me.
Here is a sample of what I'm talking about ($db is a PDO already
defined and created).
Try (for simple cases):
DELETE FROM my.table WHERE somecondition;
INSERT INTO my.table (somefield) VALUES ('$someval');
In complex cases it may be necessary to INSERT the values into a
temporary table, which is then used to condition the DELETE before
INSERTing the temporary table into your
On Sun, Oct 09, 2005 at 03:16:22PM +0200, Martijn van Oosterhout wrote:
On Sat, Oct 08, 2005 at 05:01:50PM -0500, Jim C. Nasby wrote:
Though AFAIK there wouldn't be anything illegal about someone with a
commercial license of MySQL using the GPL'd version of InnoDB... but of
course if they
On Sun, Oct 09, 2005 at 10:10:28AM -0400, Jerry Sievers wrote:
[EMAIL PROTECTED] writes:
Hello all,
I am writing an app in PHP that uses a PostGres database. One
thing i have noticed is that what should/could be a single line of
SQL code takes about 6 lines of PHP. This seem
[EMAIL PROTECTED] (Uwe C. Schroeder) writes:
On Saturday 08 October 2005 21:07, Chris Browne wrote:
2. The code base was pretty old, pretty creaky, and has a *really*
heavy learning curve.
It was pretty famous as being *really* difficult to build; throw
together such things
on 10/8/05 11:36 PM, [EMAIL PROTECTED] purportedly said:
I know it's tempting to say, just link a separate table for the book
and don't store the book name but let's just pretend that's not an
option - because I'm not actually dealing with books : I just made up
this simplified version of
This is weird. I set up a table with a serial id field
and created a primary key on it. Then I imported data.
Running an app against it, I got periodic errors
stating duplicate key violates unique constraint
pkey_table1. Looking through the table (with
phppgadmin), there are duplicate rows:
On Sun, Oct 09, 2005 at 12:46:51PM -0700, CSN wrote:
select * from table1 where id=586;
586|a|b|c|d
Do you get different results from the following queries?
SET enable_seqscan TO on;
SET enable_indexscan TO off;
SELECT * FROM table1 WHERE id = 586;
SET enable_seqscan TO off;
SET
Chris Browne wrote:
[EMAIL PROTECTED] (Uwe C. Schroeder) writes:
On Saturday 08 October 2005 21:07, Chris Browne wrote:
2. The code base was pretty old, pretty creaky, and has a *really*
heavy learning curve.
It was pretty famous as being *really* difficult to build; throw
Look what somebody suggested!
---
If the worst happens and Oracle tries to squash
InnoDB, there may already be such an alternative out
there.
I wonder what it would take to add (and optimize)
Postgres storage engine support to MySQL? I don't know
Uwe said:
how about using 2 tables with according unique/primary key constraints and a
view to actually access the data (mixing the 2 tables into one) ?
Oliver said:
Create a separate table with the two columns name and isbn which are
that table's primary key; on the main table, create a
I would create a multi-column unique index on the table. This should solve
the problem mentioned although you may still have an integrity issue if a
book name is mistyped.
Hm?
This sounds promising, except it's the exact opposite of what I need.
Is this what you meant?
CREATE TABLE
Stupid question, but what does MySQL bring to the equation? Why not just
use PostgreSQL in the first place?
On Sun, 9 Oct 2005, CSN wrote:
Look what somebody suggested!
---
If the worst happens and Oracle tries to squash
InnoDB, there may
Yep, those were two of my very first questions too. ;)
CSN
--- Marc G. Fournier [EMAIL PROTECTED] wrote:
Stupid question, but what does MySQL bring to the
equation? Why not just
use PostgreSQL in the first place?
On Sun, 9 Oct 2005, CSN wrote:
Look what somebody suggested!
Marc G. Fournier wrote:
Stupid question, but what does MySQL bring to the equation?
MySQL brings to the table an impressive AI interface that knows what you
really meant to do and thus does away with those pesky error messages.
After all, who wants to be told that -00-00 is not a date, or
Hey
Could you write specific functions insert/update that people use when
they update the data in the db, that checks for the constraints you are
talking about. So the functions would take in the input data and then would
scan the table to make sure there is no book with the same isbn that
also
Solved!
CREATE OR REPLACE FUNCTION non_duplicated_isbn() RETURNS trigger AS $function$
DECLARE
rez RECORD;
BEGIN
SELECT INTO rez * FROM books WHERE isbn=NEW.isbn AND name != NEW.name;
IF FOUND THEN
RAISE EXCEPTION 'isbn % already used for different book name: %',
NEW.isbn, rez.name;
On Sun, Oct 09, 2005 at 09:32:55PM -0700, Miles Keaton wrote:
Solved!
CREATE OR REPLACE FUNCTION non_duplicated_isbn() RETURNS trigger AS $function$
DECLARE
rez RECORD;
BEGIN
SELECT INTO rez * FROM books WHERE isbn=NEW.isbn AND name != NEW.name;
IF FOUND THEN
RAISE EXCEPTION
37 matches
Mail list logo