Gary,
If you're not to worried about tying yourself to Postgres and you're
sure you want to create a tree structure, you may want to check out
the ltree contrib module. It will allow you to create an index over
the entire tree, and will allow you to use real names instead of INTs
for the nodes in
On Tuesday 16 November 2004 1:08 pm, sad wrote:
> On Tuesday 16 November 2004 14:29, Gary Stainburn wrote:
> > Hi folks.
> >
> > I'm looking at the possibility of implementing a photo gallery for
> > my web site with a tree structure
> >
> > How would I go about creating a view to show a) the numbe
Hmm. I was more interested in using COUNT( * ) than DISTINCT *.
I want a count of all rows, but I want to be able to specify which
columns are distinct.
That's definitely an interesting approach, but testing doesn't show it
to be appreciably faster.
If I do a DISTINCT *, postgres will attempt t
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
> Is there another way to accomplish what the former is doing, then?
The only thing I can think of is a subselect in from that uses distinct.
select count(*) from (select distinct ...) foo
That also theoretically allows you to use select distinct *
On Tue, Nov 16, 2004 at 02:30:09PM +0200, Achilleus Mantzios wrote:
> >
> > CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable
> >
> > oughta work.
>
> What about indexes, constraints, sequences,etc...???
You'll have to create those too, I'm afraid. I don't know of a way
to m
I have a logging application that should produce an entry in the
database every minute or so, give or take a few seconds.
I'm interested in finding out
a: what minutes don't have a record and
b: periods where the gap exceeded a certain amount of time.
Is this not the same question ?
An
I have a logging application that should produce an entry in the
database every minute or so, give or take a few seconds.
I'm interested in finding out
a: what minutes don't have a record and
b: periods where the gap exceeded a certain amount of time.
The only way I can think of to do it is to
Is there another way to accomplish what the former is doing, then?
For practical reasons, I'd like to come up with something better.
For theoretical curiosity, I'd like to know whether there's a way to
combine COUNT and DISTINCT that still allows one to reference * rather
than naming specific col
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
> I am wondering whether the following two forms of SELECT statements are
> logically equivalent:
>
> SELECT COUNT( DISTINCT table.column ) ...
>
> and
>
> SELECT DISTINCT COUNT( * ) ...
Not in general.
The former counts how many distinct table.colu
I am wondering whether the following two forms of SELECT statements are
logically equivalent:
SELECT COUNT( DISTINCT table.column ) ...
and
SELECT DISTINCT COUNT( * ) ...
If they are the same, then why is the latter query much slower in
postgres when applied to the same FROM and WHERE clauses?
I have two data tables AUTHORS and BOOKS, and one indirection table
AUTHOR_BOOKS which allow me to make n:m links. Now I want to create view
that allow user to select all books of specyfic author - user should use
query like this SELECT * FROM booksvw WHERE idauthor=xxx.
I know two queries that
[EMAIL PROTECTED] (Tom Lane) wrote in message news:<[EMAIL PROTECTED]>...
> Stephan Szabo <[EMAIL PROTECTED]> writes:
> > On Tue, 9 Nov 2004, carex wrote:
> >> And it works also perfectly with Gentoo.
> >> So,is this a typical "Redhat Enterprise" problem ?
> >> Or do I overlook something ??
>
> >
I'm looking at the possibility of implementing a photo gallery for my
web site with a tree structure, something like:
You don't really want a tree structure, because one day you'll want to
put the same photo in two galleries. Suppose you take a very interesting
photo of celery during your tri
It could help me, but pg_dump give all foreigns key and index creation.
I'm not sure if it's not better to write a custom function in plpgsql.
Bruno
- Original Message -
From: "Peter Eisentraut" <[EMAIL PROTECTED]>
To: "Bruno Prévost" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesd
Am Dienstag, 16. November 2004 16:40 schrieb Bruno Prévost:
> I need to use it in sql.
There is no direct way to do this in SQL, but I can offer you the following
alternative:
CREATE FUNCTION get_table_definition(text) RETURNS text AS '
#!/bin/sh
pg_dump -t $1
' LANGUAGE plsh;
:)
--
Peter Eis
I need to use it in sql.
Thk
Bruno
- Original Message -
From: "Peter Eisentraut" <[EMAIL PROTECTED]>
To: "Bruno Prévost" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 16, 2004 10:16 AM
Subject: Re: [SQL] Table definition
Am Dienstag, 16. November 2004 15:04 schrieb
Bruno Prévost wrote:
>Anybody know how to obtain the table definition in text.
Not quite sure if this is quite what you're after, but would:
$ pg_dump -st foo
help at all? It gives out the SQL that you would need to enter to
re-create the table.
Sam
---(end of bro
Title: Les consultants Interaction | stationery
Probably there is no direct way get the definition (i could
not find one atleast).
You can probably write a custom function which gives all
columns, indexes and formulate a create table statement (text
definition).
Let us know if you find a wa
Am Dienstag, 16. November 2004 15:04 schrieb Bruno Prévost:
> Anybody know how to obtain the table definition in text.
Use pg_dump.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---(end of broadcast)---
TIP 6: Have you searched our
Title: Les consultants Interaction | stationery
ï
Hi,
Anybody know how to obtain the table definition in text.
Something like "select definition from pg_catalog.pg_views where viewname =
'xxx'" but for a table.
Thanks
Bruno
On Tue, 2004-11-16 at 11:29 +, Gary Stainburn wrote:
>
> How would I go about creating a view to show a) the number of photos
> in
> a gallery and b) the timestamp of the most recent addition for a
> gallery, so that it interrogates all sub-galleries?
There isn't a very simple answer to tha
On Tuesday 16 November 2004 14:29, Gary Stainburn wrote:
> Hi folks.
>
> I'm looking at the possibility of implementing a photo gallery for my
> web site with a tree structure
> How would I go about creating a view to show a) the number of photos in
> a gallery and b) the timestamp of the most rec
O Andrew Sullivan έγραψε στις Nov 16, 2004 :
> On Tue, Nov 16, 2004 at 10:02:34AM +0100, Markus Schaber wrote:
> > Hello,
> >
> > Is there an easy way to move a table to another schema in PostgreSQL 7.4?
> >
> > ALTER TABLE and ALTER SCHEMA don't have this options.
>
> CREATE TABLE newschema.ne
Hi folks.
I'm looking at the possibility of implementing a photo gallery for my
web site with a tree structure, something like:
create table gallery (
id serial,
parent int4,
name varchar(40),
primary key (id));
create table photos (
pid serial,
id int4 references gallery not null,
added t
On Tue, Nov 16, 2004 at 10:02:34AM +0100, Markus Schaber wrote:
> Hello,
>
> Is there an easy way to move a table to another schema in PostgreSQL 7.4?
>
> ALTER TABLE and ALTER SCHEMA don't have this options.
CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable
oughta work.
A
Hello,
Is there an easy way to move a table to another schema in PostgreSQL 7.4?
ALTER TABLE and ALTER SCHEMA don't have this options.
Thanks,
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:[EMAIL
26 matches
Mail list logo