Your explanation goes here.;
If you need to hide this column from you uses, you can use a view.
--
Regards,
Richard Broersma Jr.
disable a check constraint.
Perhaps a staging table is advisable here?
--
Regards,
Richard Broersma Jr.
--
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
, 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
*
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@postgresql.org
= 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@postgresql.org)
To make
= SELECT (NULL::DATE = '2011-04-01'::DATE AND NULL::DATE =
'2011-04-30'::DATE) IS UNKNOWN;
?column?
--
t
(1 row)
--
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
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 make changes to your subscription:
http://www.postgresql.org/mailpref
/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@postgresql.org
On Tue, Dec 7, 2010 at 1:47 PM, Tony Capobianco
tcapobia...@prospectiv.com 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
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@postgresql.org)
To make
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. Have you already exhausted this option?
--
Regards,
Richard
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/
--
Regards,
Richard
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: ROLLBACK
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http
hard 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 Los Angeles
, 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
--
Regards,
Richard Broersma Jr.
Visit the Los
has a give-away that this is
a set returning function: jfcs_balancedue('%s') since it has a
parameter.
Notice the function name section taken from the from clause:
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-FROM
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles
with the newly discovered
itemnbr. */
2010-05-21 07:28:38 PDTLOG: statement: SELECT
itemnbr,action,startdate,completiondate
FROM public.actionitems
WHERE itemnbr = 49
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles
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.postgresql.org/lapug
--
Sent via pgsql
:= '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.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http
( WHERE n = 1)
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 (pgsql-sql@postgresql.org)
To make changes to your subscription:
http
to?
--
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
, 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 Angeles PostgreSQL Users Group (LAPUG)
http
constraints.
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
,
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
. 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 changes to your
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.org)
To make changes to your
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 queries. But his solution was
extremely hackish.
--
Regards,
Richard Broersma Jr.
Visit
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
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 via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes
--
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 Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http
On Wed, Nov 4, 2009 at 2:11 PM, Tom Lane t...@sss.pgh.pa.us wrote:
Richard Broersma richard.broer...@gmail.com 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 t...@sss.pgh.pa.us wrote:
Richard Broersma richard.broer...@gmail.com 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
for?
SELECT R.region_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
;
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 same result.
--
Regards,
Richard Broersma Jr
(*) 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
(other 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
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
unless the foreign key is set with ON UPDATE
CASCADE then the shifts will be cascaded to all references
automatically.
--
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
common solution is
to use optimistic locking, another solution that I know of is to use
serialized transaction isolation.
--
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
is an example how how ADODB.Stream class work in conjunction with
ADODB.command prepared statements to push binary data into a field.
The same should work with PostgreSQL.
http://www.databasedevelopment.co.uk/examples/StoredBlobs.zip
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL
can update the data with
copy, and otherwise not touch it.
One Idea that popped into my head that may-or-may-not work would be to
add a constraint trigger that checks if all of the detail records have
the same xmin as the order table record.
--
Regards,
Richard Broersma Jr.
Visit the Los
) AS closed
FROM ( SELECT start_date AS date
FROM Yourtable
GROUP BY start_date
UNION
SELECT end_date AS date
FROM Yourtable
GROUP BY end_date ) AS A
ORDER BY A.date;
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users
duplicates) across multiple relationships, then using natural primary
keys becomes very attractive.
--
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
that subscribe to www.utteraccess.com
get bitten. From what I've seen not one day has gone by without
someone posting a question to this site about how to both find and
remove all but one of the duplicates.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http
= D.id
OR A.id + 1 = D.id;
--
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
ON A.id - 1 = D.id
OR A.id + 1 = D.id;
--
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
to enforce business rules using
ordinary table DDL, I try to use natural keys as often as I can.
--
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
surrogate keys
(for me) are only way to go.
--
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
On Tue, Sep 16, 2008 at 6:37 AM, Frank Bax [EMAIL PROTECTED] wrote:
That pass the SQL into crosstab().
It might be interesting to look at this blog also:
http://okbob.blogspot.com/#7449458148004287481
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG
.
--
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
latency. He has configures a
revolving Master-Slave replication.
Perhaps you guys to share notes?
--
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
this is to create a named cursor of
the rows that you want to update, and then for each record call
UPDATE ... FROM ... WHERE CURRENT OF cursorname;
But why are you even having this problem to begin with? What you are
describing sounds like a database normalization problem.
--
Regards,
Richard Broersma
://www.commandprompt.com/blogs/joshua_drake/2007/08/how_many_rows_do_i_have_anyway/
--
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
.
--
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
of the postgresql.conf options are
shown as well as the compiler options used to build postgresql.
http://www.spec.org/jAppServer2004/results/res2007q3/jAppServer2004-20070703-00073.html
I hope this helps.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http
statement to perform this operation.
--
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
that everyone on the list can participate.
--
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
://www.postgresql.org/docs/8.3/interactive/indexes-expressional.html
This way all expression using where lower( column ) = 'a'. will always
use an index scan.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing
( v_ip_addr )) AS A( ip_addr )
LEFT JOIN Ip_addresses AS B
ON A.ip_addr = B.ip_addr
WHERE B.ip_addr IS NULL;
--
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
you could handle the null by
passing DEFAULTS to you INSERT or UPDATE statements. I don't know if
this would work for you in this case.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list
be encountering a bit of parallax. This shows both 38
and 36 *milliseconds*.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles 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
on PGfoundry. This project is just
getting started and could benefit from a lot of development help.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes
and would work automatically with transaction ids and
tuple ids.
On the other hand, temporal tables/schemes are implemented by the data
modeller. Also the associated temporal operations on the data would be
handled by client DML designed to simulate temporal data operations.
--
Regards,
Richard Broersma
AS minutes
FROM yourtable;
--
Regards,
Richard Broersma Jr.
Visit the Los Angles 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
not commit or at least
will be ignored on most databases. We database brand has incorporated
a different set of features.
How do I identify them?
This should get you started :
http://www.postgresql.org/docs/8.3/interactive/features.html
--
Regards,
Richard Broersma Jr.
Visit the Los Angles
and,
the log snippet for each query( one from ODBC and one from PGadmin )
(I would attach these as a txt file)
the EXPLAIN ANALYZE of your query ( on run from the ODBC client and on
from PGadmin) (I would attach these as a txt file)
--
Regards,
Richard Broersma Jr.
Visit the Los Angles
compare them It should at least tell us what the server is doing
differently that is causing the query mis-behavior.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql
back to the server. If it is trying
to perform the join on the client, it could be a big performance
killer.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org
,
Richard Broersma Jr.
Visit the Los Angles 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
interface to prefix
its select statements with explain analyze. And this, I don't thing
can be done. That's why you have to manually view the server logs to
see what query are being passed so that identify the problem queries
your self.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles
the query duration when issued by ODBC in the postgresql
log to see if it is really taking 2 minutes.
It would be nice to see the snippet of the PG log showing this ODBC
query with associate duration times.
--
Regards,
Richard Broersma Jr.
Visit the Los Angles PostgreSQL Users Group (LAPUG)
http
where criteria you might have
GROUP BY I1.name, ...
HAVING COUNT(*) 3
ORDER BY I1.name;
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http
--- On Mon, 1/7/08, Scott Marlowe [EMAIL PROTECTED] wrote:
select max(col1) from table
union all
select max(col2) from table
union all
select max(col3) from table
Would the following work also?
SELECT MAX( GREATEST( col1, col2, col3 ) )
FROM TABLE;
Regards,
Richard Broersma Jr
SELECT DISTINCT ON ( B.book_id, B.title ) B.book_id, B.title, A.Author
FROM Books AS B
INNER JOIN Authors AS A
ON A.book_id = B.book_id;
--- On Mon, 12/31/07, Josh [EMAIL PROTECTED] wrote:
From: Josh [EMAIL PROTECTED]
Subject: [SQL] Limit # of recs on inner join?
To:
components of the table that will also be needed in the SQL string that will be
executed?
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
.
If I didn't need to regularly provide this functionality, I would certainly use
an EAV history table.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe
of PostgreSQL people on IRC:
http://www.postgresql.org/community/irc
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
bottom posting
when we reply to an email. It is not preferred to put your replies at the top
of the email.
3) Try to use descriptive email subjects. For example, your email subject was
need help. This subject could be improved to say Need links to online
postgresql references.
Regards,
Richard
OS all platforms
and is easy to learn and use.
http://www.postgresql.org/docs/8.2/interactive/plpgsql.html
There are some nice examples in this documentation.
Your PGadmin will also have features to help the create these functions also.
Regards,
Richard Broersma Jr
the SQL prompt?
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
of functions into one?
Below is a sample of a typical logging trigger function.
Regards,
Richard Broersma Jr.
CREATE OR REPLACE FUNCTION project.log_managers_ops()
RETURNS trigger AS
$BODY$
BEGIN
IF TG_OP IN ( 'UPDATE', 'DELETE' ) THEN
UPDATE History.Managers AS M
that provide the same useful information as 'psql \d'. So instead,
I cheat:
start psql with the '-E' option to echo all sql strings psql sends to the
back-end server.
Simply copy and tailor each statement to suit your needs.
Regards,
Richard Broersma Jr.
---(end
--- On Mon, 12/10/07, Scott [EMAIL PROTECTED] wrote:
I am having trouble with an insert rule that also does an
update. It works
fine for a single insert but multiple inserts in a single
statement don't
behave as I expected.
Yup, that is the limitation of rules. They are only useful if you
Inventory
SET number = 0
FROM Things
WHERE Inventory.thing_fk = Things.thing_id
AND Things.color = 'red';
IIRC, Joe Celko referrers to this syntax as T-SQL.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 9: In versions below 8.0
ON UPDATE CASCADE);
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
] .
This mailing list ( pgsql-sql@postgresql.org ) is really intended for
discussions of how to construct SQL queries to achieve desired results in a
PostgreSQL database.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 2: Don't 'kill -9
/description#description
the only difference was that he was modeling employees and skillsets. IIRC,
the terminology for
the improved model was the full disjuctive model.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 3: Have you checked
?
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
. Not a big deal but it
complicates things :-)
The veil project already does this.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
with id_search 1 and
2 and 3. Therefore I use the following SQL query.
SELECT id_search
FROM Search_item
GROUP BY id_search
HAVING Count( * ) = 3
AND Max( id_item ) = 3
AND Min( id_item ) = 1;
Regards,
Richard Broersma Jr.
---(end of broadcast
/sql-createview.html
I've created large SQL scripts that employ:
DROP VIEW IF EXITS viewname;
CREATE VIEW ...
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 6: explain analyze is your friend
schema_name.view_name
was does it show as the definition of the column.
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
OOPS!
--- Richard Broersma Jr [EMAIL PROTECTED] wrote:
CREATE UNIQUE INDEX Only_one_row_true
ON Your_table ( featured )
WHERE featured = true;
Or if you want to only allow 1 featured article per catagory then:
CREATE UNIQUE INDEX Only_one_row_true_per_catagory
,
table1.col1,
CAST( NULL AS CHARACTER( 3 )),
table3.type2
FROM table1
JOIN table3 ON table3.fk_table1 = table1.id;
Would the above changes work?
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 7: You can help support
) a_id, b_id
FROM c ) AS c( a_id, b_id )
INNER JOIN a
ON c.a_id = a.id
INNER JOIN b
ON c.b_id = b.id;
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 6: explain analyze is your friend
oops...
I meant DISTINCT ON ( a_id )
--- Richard Broersma Jr [EMAIL PROTECTED] wrote:
SELECT a.x, b.x
FROM ( SELECT DISTINCT ON ( a_id ) a_id, b_id
^^
FROM c ) AS c( a_id, b_id )
INNER JOIN a
ON c.a_id = a.id
INNER JOIN b
[, ...] |
column_definition
[, ...] ) ]
Regards,
Richard Broersma Jr.
---(end of broadcast)---
TIP 6: explain analyze is your friend
--- Alvaro Herrera [EMAIL PROTECTED] wrote:
Any function declared as returning SETOF RECORD needs it, when you don't
use OUT params. Before OUT params existed, it was the only way to use
those functions.
Thanks everyone for the exposition! It makes sense.
Regards,
Richard Broersma Jr
1 - 100 of 233 matches
Mail list logo