nteed.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
uot;
CHECK( parent_discriminator = 42)
or: COMMENT ON TABLE child "Your explanation goes here.";
If you need to hide this column from you uses, you can use a view.
--
Regards,
Richard Broersma Jr.
2, 'hex');
END;
$$ LANGUAGE plpgsql;
SELECT '\x000b'::bytea AS want_this,
decode('000b','hex')AS or_this1,
decode('\000\013','escape') AS or_this2;
SELECT f_concat_bytea1('\x00', '\x0b
ve, which means it's trying to
treat them as a single record-column with three fields. Hence the error
message.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
LE-EXCLUDE
You cannot disable a check constraint.
Perhaps a staging table is advisable here?
--
Regards,
Richard Broersma Jr.
k the same options as ssh I daresay you could get it
working.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
--
(0 rows)
dynacom=# -- THIS IS INSANE
Perhaps just do an EXPLAIN ANALYSE on both of those. If for some reason
one is using the index and the other isn't then it could be down to a
corrupted index. Seems unlikely though.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing
AS id_a, tb.id AS id_b, ta.d, ta.t
FROM ta JOIN tb USING (d,t);
ROLLBACK;
If the fields were named differently you'd need something like:
FROM ta JOIN tb ON (ta.d1, ta.t1) = (tb.d2, tb.t2)
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql
Actually got it figured...for some reason it had the function twice (o;
But with or without function index the time to query stays the same...around
110msec for 24 results...
cheers
richard
On Wed, 29 Feb 2012 11:08:46 -0500, Tom Lane wrote:
> Richard Klingler writes:
>> Took some t
rt(name));
Which should speed up my query:
select * from port where name not like '%Z' order by btrsort(name) asc
cheers
richard
On Sat, 17 Dec 2011 16:16:07 +0100, Filip Rembiałkowski wrote:
> If you use btrsort(column) from the example, you can just create
for
building
up a hierarchical tree menu in a web application where every msecs
counts (o;
cheers
richard
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
%'
;
Though I just can't order the rows anymore by inet(arp.ip) anymore...
Any hints on my ordering isn't anylonger possible?
But at least the query is way faster than before (o;
2msec instead of 650msecs (o;
thanx ina dvance
richard
On Sat, 10 Dec 2011 11:28:29 -0500, David Jo
Null or 0...
thanx in advance
richard
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
quote any of your values in your Python code - it's
doing it for you. I'm guessing there are other options beside %s for
other data-types (integers,floats,boolean etc).
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
caping apart from single quotes. It's
especially useful for function bodies which tend to contain their own
string literals.
SELECT length($$ab\nde$$);
length
6
None of this should matter from an application however, since its
database access library should do all the
FROM Loggingtable
GROUP BY user_id, project_id, date_trunc( 'day', ts )
ORDER BY date_trunc( 'day', ts ), user_id, project_id;
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
WHERE B.id = Accum_ts.id
AND B.ts >= Accum_ts.ts - INTERVAL '5 MINUTES'
GROUP BY B.id
HAVING MIN( B.ts ) <= MAX( B.ts ))
SELECT id, ts
FROM Accum_ts
ORDER BY id, ts;
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql
XISTS ( SELECT *
FROM Yourtable AS B
WHERE B.id = A.id
AND B.ts > A.ts - INTERVAL '5 MINUTES'
AND B.tx < A.ts )
ORDER BY id, ts;
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@p
ies do not have any guaranteed order unless you add an ORDER BY
clause. None of them, no matter how simple.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
will be returned too
The WHERE clause will only return rows is the arguments all evaluate
to TRUE. No rows will be returned for rows that cause the WHERE
clause to evaluate to a NULL value.
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To m
4-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE) IS FALSE;
?column?
--
f
(1 row)
spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE) IS UNKNOWN;
?column?
--
t
(1 row)
--
Regards,
Richard Br
ostgresql.org/docs/9.1/static/datatype-geometric.html
http://www.postgresql.org/docs/9.1/static/sql-createindex.html
http://www.depesz.com/index.php/2010/01/03/waiting-for-8-5-exclusion-constraints/
Is this correct?
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@p
you can also generate a crosstab table using the sign function
you can check out the link below ( its a sqlite tutorial, but the same
idea will work for pg too )
http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html
On 03/09/2011 12:16 PM, Eric Ndengang wrote:
Hi Guys,
I have the fo
.
Apart from Vibhor's suggestion (which is the typical way PG does it) you
can also set the auto field to DEFAULT:
INSERT INTO mytable (rowid, other) VALUES (DEFAULT,'a'), (DEFAULT,'b');
This should work on either system.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsq
7;day' FROM d) = 3;
That ends up doing a bitmap index scan for me.
Of course, it's entirely possible an index on year+month returns too
many rows to be useful.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subs
On Tue, Dec 7, 2010 at 1:47 PM, Tony Capobianco
wrote:
> Why did I need to cast both as text though?
http://www.postgresql.org/docs/8.3/interactive/release-8-3.html#AEN87134
--
Regards,
Richard Broersma Jr.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to y
o push your data to the new
schema.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
should work:
UPDATE foo
Set x = y
WHERE id = ANY( CAST( string_to_array( '1,2,3,4', ',' ) AS INTEGER[] ));
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@po
ble1 SET nm = table2.nm
FROM table2
WHERE table1.sn = table2.sn;
SELECT * FROM table1;
ROLLBACK;
Be careful with aliasing the target of the update (table1 in this case).
As another poster has discovered, that counts as another table in your join.
--
Richard Huxton
Archonet Ltd
--
Sent v
first define a custom type, then drop the out parameters.
create type mytype as (
i integer,
j text );
create or replace function outtest()
returns mytype as
$BODY$
i = 1
j = 'something'
return ( i, j )
$BODY$
language plpythonu;
select * from outtest();
i | j
---+---
1 | someth
> native postgres driver, does any better?
>From my limited experience, I believe is does do better. The
following blogs as a few entries about using Base:
http://www.postgresonline.com/journal/archives/167-Importing-data-into-PostgreSQL-using-Open-Office-Base-3.2.html
--
Rega
rd to get correct. They
sometimes do unexpected things.
It looks like the CREATE Trigger FOR EACH STATEMENT is better suited to do
what you want:
"In addition, triggers may be defined to fire for a TRUNCATE, though only FOR
EACH STATEMENT."
--
Regards,
Richard Broersma Jr.
Visit the L
6-08 14:39:43 PDTSTATEMENT:
BEGIN;
UPDATE "public"."structures"
SET "scoped"=E'-1'
WHERE "buildingfunction" = E'CRANE OPERATOR STATION'
AND "xmin" = 20497
-06-08 14:39:43 PDTLOG: duration: 0.000 ms statement: ROLLBA
I could find.
I know that there are a couple of options that affect the
representation of Booleans in the odbc driver. I'm not sure it will
do what you need though.
However, here is the official documentation: (hopefully it helpful)
http://psqlodbc.projects.postgresql.org/
--
Regard
; bareword 1 and 0 instead of 't' and 'f'. For the sake of compatibility
> (especially bareword integers in queries), I've defined a 'sybit' type
> in postgres to be a domain.
One thought would be see if ODBC configuration options will achieve
this for you. H
Using the real, windowing versions of first/last in 8.4+ will still
require sorting the whole table (AFAICT) so isn't likely to be much
improvement over a self-join here.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your
with an outer query that
compares mycode=prev_code to get a run length.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
uot; and "last value I happened to find".
If you want the earliest/latest timestamp from each day, use min() and
max().
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ta-types in the alias declaration for all
set returning relations with the exception of a set returning function
(i.e. store procedure). The from clause has a give-away that this is
a set returning function: "jfcs_balancedue('%s')" since it has a
parameter.
Notice the function
te" = '2010-05-21'::date
AND "completio ndate" =
'-12-31'::date
/* The table was automatically re-queried to find out what the new
itemnbr actually is according to its default value. And lastly the
former query tha
erial datatype.
At-least in recent versions auto increment is recognized by MS-Access
just fine (I'm guessing this is due to the Return clause which the
ODBC driver automatically calls).
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postg
IN
> curtime := 'CURRENT_DATE';
> LOOP
I'm not "up" on my pl/pgSQL, but isn't CURRENT_DATE a literal value so
it shouldn't to be enclosed in single quotes?
Another idea would be to: CAST( now() AS DATE )
--
Regards,
Richard Broersma Jr.
V
FROM T
p2082849b(> WHERE n <= 10000)
p2082849b-> SELECT n,c,d FROM T;
INSERT 0 10001
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list
I'm rereading my Joe Celko's SQL Programming Style and I noticed an
interesting comment regarding the EAV model (of course he discourages
its use):
"There are better tools for collecting free-from data."
What tools was he referring to?
--
Regards,
Richard Broersma Jr.
V
discrepencylist ds, opendays
WHERE opendays.day >= ds.discstartdt AND opendays.day <=
LEAST('now'::text::date, ds.resolutiondate)
GROUP BY opendays.day, ds.resolvingparty
ORDER BY opendays.day, ds.resolvingparty;
--
Regards,
Richard Broersma Jr.
Visit the Los Angele
raints.
While 8.4 has CTE's which are good for querying adjacency list tree,
we need to wait for write-able CTE's (maybe 9.1?) to preform all of
the possible tree modifications.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.post
trigger?
If you don't expect this to be common, maybe you could fix the
concurrency issue by taking a table-wide lock that locks out
other writers.
Surely SELECT FOR UPDATE on the parents would be sufficient? If there's
no overlap between (currently non-cyclic) graphs being altered
child" isn't in that set.
4. If there is a cycle, raise an error (which will abort the insert or
update)
If you have a "before" trigger, then step 4 could return NULL rather
than raise an error. That would just skip the insert.
Also, step #1 could be done with a CHECK const
es to go through the issues I had building
the lib etc.)
I'd be surprised if there wasn't a -contrib or -extras rpm with the
relevant files. The community rpms should have them if the "official"
Suse ones don't
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql ma
is being executed?
It's also worth checking that the pg_config you are executing is the one
associated with postgresql-8.4.2 - make sure your PATH is set
appropriately. I'm not sure that it would give this error, but I keep
making the mistake of setting my PATH with the three version
this hierarchy will have overlap, this is an indication of a violation
of the second normal form (I believe).
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.or
. Each cabin is
defined by a category according the set in the cabin_category table.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make chang
On Wed, Mar 3, 2010 at 7:02 AM, Louis-David Mitterrand
wrote:
> What is the best solution? Adding an id_ship to 'cabin'? Or check'ing
> with a join down to 'ship'? (if possible).
Can you post simplified table definitions for the relations involved?
--
Regar
You will need to create the function with SECURITY DEFINER permissions,
as a user who can read from the table. Make sure the application cannot
read from the table and has to use the function.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To
return NOTHING.
Is there a way to achieve this?
Not quite the way you suggest. You could build a series of views with
the WHERE conditions built in to them, and grant permissions on those
though.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org
On 19/02/10 10:58, Gordon Ross wrote:
On 19/02/2010 10:36, "Richard Huxton" wrote:
Works here - are you sure you don't have any triggers interfering?
Doh ! *blush*
Yes, I did, to stop anyone tampering with the audit table ;-)
There you go - it worked :-)
--
Richard Hu
of PostgreSQL from the last few years supports "dollar
quoting".
http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
That lets you do:
create or replace function ... as $$
...
IF myvar = 'normal-quoting works here' THEN
...
$$ language plpgsql;
--
Ric
(-1,1), (-2,2), (-3,3);
UPDATE audit SET key = extension.number
FROM extension
WHERE audit.record_id = extension.number;
SELECT * FROM audit ORDER BY id;
ROLLBACK;
CREATE TABLE
INSERT 0 3
INSERT 0 3
UPDATE 3
id | record_id | key
+---+-
1 | 1 | 1
2 | 2 | 2
3 |
r, for this case you can just do an update with an extended where
clause:
UPDATE t2 ... WHERE t2f1=NEW.d1 AND NEW.t1f4 > t2.t2f4
No need for the IF.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscript
l.loc_name AS linked_name
FROM
images i2
JOIN location_images li ON i2.img_id = li.img_id
JOIN locations l ON li.loc_id = l.loc_id
...
You could do something clever with inheritance on the joining tables,
but it's better to keep things simple imho.
--
Richard Huxton
Archonet Ltd
--
Sent via pg
mpt to perform an update.
The official use for update-able views is for limiting the results
from a *single* base table.
Having said all of this, it is possible to do what your describing.
I've seen Keith Larson make update-able views from a composite of
selected UNION and FULL OUT JOIN quer
I noticed a few new SQL references in the manual:
CREATE SERVER
CREATE FOREIGN DATA WRAPPER,
CREATE USER MAPPING
Is this similar to DBI-Link?
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing
> ERROR: schema "adress" does not exist
>
> Do somebody have some problem and how to fix this?
Are you sure that you didn't just misspell address?
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent
On Wed, Nov 4, 2009 at 2:11 PM, Tom Lane wrote:
> Richard Broersma writes:
>> Can anyone one explain why a "WITH RECURSIVE" query has the same
>> results regardless whether UNION or UNION ALL is specified?
>
> Well, if the rows are all different anyway, UNION
On Wed, Nov 4, 2009 at 2:11 PM, Tom Lane wrote:
> Richard Broersma writes:
>> Can anyone one explain why a "WITH RECURSIVE" query has the same
>> results regardless whether UNION or UNION ALL is specified?
>
> Well, if the rows are all different anyway, UNION
> SELECT sum(n) FROM t;
sum
--
5050
(1 row)
broersr=> WITH RECURSIVE t(n) AS (
broersr(> VALUES (1)
broersr(> UNION ALL
broersr(> SELECT n+1 FROM t WHERE n < 100
broersr(> )
broersr-> SELECT sum(n) FROM t;
sum
--
5050
(1 row)
--
Regards,
Richard
to
replace our UNIONs.
You'll want a unique constraint on length_codes.code and you should
really write a custom trigger to make sure none of the
min_length..max_length ranges overlap. In practice, you're probably only
setting this table up once so might not bother.
--
Ri
E plpgsql;
SELECT print_array(ARRAY[ '(1,"abc")'::typ1, '(2,"def")'::typ1 ]);
SELECT print_array(ARRAY[ '(1,"abc")', '(2,"def")' ]::typ1[]);
ROLLBACK;
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
number'::regclass;
>
> plpgsql isn't tremendously good with rowtypes that contain dropped
> columns.
I thought that only applied to columns dropped after the function was
defined. Live and learn.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list
ial_number
>
> That seems to be some bug in Postgres ?
If you look earlier you should see a line that says something like: "set
search_path = rma, ..."
Makes it irritating to cut+paste sections of the dump, but it works just
fine.
--
Richard Huxton
Archonet Ltd
--
Denis BUCHER wrote:
> Richard Huxton a écrit :
>> The other thing you could try is printing out row before returning it:
>> RAISE NOTICE 'row = %', row;
>> RETURN NEXT ROW;
>> It might be you've not got what you were expecting.
>
> Thanks a
. ROLLBACK we can change things until we see
the problem.
The other thing you could try is printing out row before returning it:
RAISE NOTICE 'row = %', row;
RETURN NEXT ROW;
It might be you've not got what you were expecting.
--
Richard Huxton
Archonet Ltd
--
Sent via p
Denis BUCHER wrote:
> Richard Huxton a écrit :
>>> ERREUR: wrong record type supplied in RETURN NEXT
>>> CONTEXTE : PL/pgSQL function "hds_bw_find_sn_live" line 26 at return next
>>>
>>> Does someone maybe knows what it could be ?
>>>
PLACE FUNCTION rma.find_sn_live (varchar(30)) RETURNS SETOF
>> rma.serial_number
This is a different function. Function "hds_bw_find_sn_live" has the
wrong type for its "return next".
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pg
you could use distinct on
select distinct on (fs.film.title, fs.film.year ) title, year
from fs.film left join fs.star on fs.film.id = fs.star.film
where fs.star.last = 'Sheen';
On Sat, 2009-10-10 at 00:53 +0200, Dag-Erling Smørgrav wrote:
> Consider the attached schema (filmstars.sql), which i
---+---+--
> (0 rows)
You've defined getnote() as returning a single getnote_t value I think
you probably want "RETURNS SETOF getnote_t".
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
t splitting
where the files are stored. That might involve setting up symlinks, I
can't remember if 7.3 supported tablespaces.
If you do put some files on the encrypted filesystem and some on the
unencrypted one make sure you don't start PG until both are available. I
don't kno
two rows.
> But to work with hibernate I need the return NEW statement.
Hmm - not sure I can see a way around this. Maybe someone else who knows
Hibernate can help.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make change
p_subdtls_01" does not exist
I think you missed the word "column" in the error message (easy to do,
you know you are naming tables). You've missed the quotes around the
partition-names so it's trying to find a column on a table that matches.
dateTable := 'coll_fp_su
ext \.
Why not just load the dump file into PostgreSQL? Why are you trying to
copy+paste if you want the entire dump?
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ould be if I just can type the table name.
There is a variable called "search_path" which controls what schemas are
checked for tables, functions etc. If you have two tables with the same
name but different schemas you'll need to use the .
format though.
SET search_path = public
27;t know how you do that, but it should be in the manual.
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
he end of lines when it's
expecting "\n".
The postgresql version is 7.4.17.
Might want to set aside some time to upgrade in the near future - you're
missing four full versions since 2003. At the very least, upgrade to
7.4.25 at your earliest convenience.
--
Richard
Glenn Maynard wrote:
On Thu, Jul 23, 2009 at 2:41 AM, Richard Huxton wrote:
Ah [cue light-bulb effect], I think I understand. Your function isn't in the
database is it? Surely your application knows if it's issuing BEGIN..COMMIT?
I'm writing a Python library call. It has no i
Glenn Maynard wrote:
On Thu, Jul 23, 2009 at 1:31 AM, Richard Huxton wrote:
- Let me use SAVEPOINT outside of a transaction,
You are never outside a transaction. All queries are executed within a
transaction.
"Transaction block", then, if you insist.
I think this is the ro
ter, I'll probably end up dropping out of the ORM
and using some uglier SQL to work around this, but this is so trivial
that it's silly to have to do that. I can't do it within the ORM; it
doesn't have the vocabulary.
The ORM can't control transactions, can't call fu
earliest duplicates
WHERE email=tgt_email AND create_date > tgt_date;
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
, transplant the pointer rather than
actually copy the data?
If they are large-objects (stored via the lo_xxx interface) yes. If not,
no. I take it the large blob of xml is one of the fields that you are
classifying as common?
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql
flavors are available also).
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
*) more since it helps to correctly express the idea that we are
counting rows per group and not cm.id(s) per group.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgre
have proposed;
>
> SELECT
> R.region_name,
> Count(*) AS RegionComplaints
> FROM
> Region AS R
> LEFT JOIN City AS Ci
> LEFT JOIN Complaint AS Cm ON Ci.id = Cm.city_id
> ON R.id = C.region_id
> GROUP BY
> R.region_name;
Yup, it produces the s
on_name, Count(*) AS RegionComplaints
FROM Region AS R
LEFT JOIN City AS Ci
ON R.id = C.region_id
LEFT JOIN Complaint AS Cm
ON Ci.id = Cm.city_id
GROUP BY R.region_name;
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgr
LANGUAGE 'plpgsql' VOLATILE;
Oh well, I'm glad I tested the approach out before going too far down this
road. Thanks again for your timely help.
Richard
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
:
. . .
select into some_rec * from dd_test(some_rec) as (id int4, descr text);
. . .
Throws this:
ERROR: column "some_rec" does not exist
SQL state: 42703
Context: PL/pgSQL function "test1_trg" line 7 at select into variables
Sorry for the earlier typo(s), and t
), but throws the error on the machine I
am forced to work with, which is running version 7.4. I realize that
polymorphic functions were pretty new in v7.4, is there a workaround or am I
making a silly mistake? Or both?
Incidentally, I get the same error when I change the polymorphic function
Rob Sargent wrote:
Richard Huxton wrote:
If your functions are all called at the top-level then indeed it
doesn't matter. At a low level though, telling the planner function F1
costs 1000 times more than F2 is useful.
What scares me about this is that for function such as the one
Rob Sargent wrote:
Richard Huxton wrote:
Rob Sargent wrote:
pg-admin is showing 'COST 100' and 'ROWS 1000' for my explicitly
VOLATILE functions.
Thanks for the pointer back to CREATE FUNCTION docs. That would have
told me that those value are indeed the defaults.
store. Its kind-of like EAV for a column
instead of a table.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Hello
I have frequently encountered the need of combining two tables into one.
First, please take a look at the following table setups...
CREATE TABLE topics (
id SERIAL PRIMARY KEY,
topic TEXT NOT NULL
);
CREATE TABLE messages (
id SERIAL PRIMARY KEY,
topic INTEGER REFERENCES topics(
1 - 100 of 1221 matches
Mail list logo