David Johnston wrote
>
> JORGE MALDONADO wrote
>> I have a table as follows:
>>
>> Table Artist Colaborations
>>
>> * car_id (integer field, primary key)
>&
you?
Also, the car_id field becomes pointless since your new constraint is the
true and natural PK.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Question-about-index-constraint-definition-in-a-table-tp5773924p5773925.html
Sent from the PostgreSQL - sql
not pass a
cost-benefit analysis.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Unique-index-VS-unique-constraint-tp5773386p5773434.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-sql@postg
ionship.
CREATE TABLE list ( lst_source, lst_date, FOREIGN KEY (lst_source, lst_date)
REFERENCES source (src_id, src_date) ...;
If a unique constraint (in this case I'd suggest primary key) does not exist
for source(src_id, src_date) the create table with the foreign key will
fail.
David
should be
associated only with constraints.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Unique-index-VS-unique-constraint-tp5773386p5773427.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-s
the different text fields.
I would then add an index on art_bday and call it done. You can then write
a view/function that performs a full-text search against the functional
index (or just create an actual column) for most text searches and have
separate criteria filters for country/type/birthda
Create an array of all dates (tags in the example) that match with
positive amounts. Negative amounts get their matching tag added to the
array as NULL. The provided function looks into the generated array and
returns the last (closest to the current row in the frame) non-null date/tag
in the
and toss the temporary variables but that
should not impact the semantics.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/postgres-subfunction-return-error-tp5772407p5772627.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via
on variables. You must manually map the
output of the sub-function call query onto the parent variables.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/postgres-subfunction-return-error-tp5772407p5772408.html
Sent from the PostgreSQL - sql mailing list ar
otherwise your use of
"DISTINCT ON" begins to mal-function. I dislike DISTINCT ON generally but
do not wish to ponder how you can avoid it, so I'd suggest just turning your
query into a sub-query like I show above.
David J.
--
View this message in context:
http://postgresql.104569
ot;text[]" instead of a "setof text[]". It makes coding these kinds of
queries easier if you know/understand the fact that your matching will never
cause more than 1 row to be returned. If zero rows are returned I return an
empty array and the normal 1-row case returns the match
e, composite primary
key definitions but in this kind of star-schema setup simply have each
foreign key and whatever other searching fields you require maintain their
own individual index.
David J.
P.S.
Arguably, having a separate column for each kind of person is a poor design
at face value
Luca Vernini wrote
> 2013/7/8 David Johnston <
> polobo@
> >
>
>>
>> This may be a pl/pgsql limitation but you should probably provide a
>> complete
>> self-contained example with your attempt so that user-error can be
>> eliminated.
>>
read and in assign.
> How can I workaround this and update my values?
>
> Luca.
This may be a pl/pgsql limitation but you should probably provide a complete
self-contained example with your attempt so that user-error can be
eliminated.
David J.
--
View this message in context:
ht
the usual output. This is, I am pretty such, a usability
enhancement that makes easier something that can be done today using
CTE/WITH and/or sub-queries.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/UNNEST-result-order-vs-Array-data-tp5760087p5760126.ht
SELECT fldA, fldB, fldC, sum(fldD) AS sum_positive) q1
NATURAL FULL OUTER JOIN (SELECT fldA, fldB, fldC, sum(fldD)*-1 AS
sum_negative) q2
WHERE <...>
Food for thought.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Select-statement-with-except-clau
"tbl" within the query inside the where clause
GROUP BY col1, col2, col3
I do not follow your example enough to provide a more explicit
example/solution but this should at least help point you in the right
direction.
David J.
--
View this message in context:
http://postgresql.10
My prior comment simply answers your question. You likely can rewrite your
query so that a separate grouping layer is not needed (or rather the group
by would exist in the main query and you minimize the case/sub-select column
queries and use aggregates and case instead).
David J.
--
View
SELECT num_ads, sum(...), sum(...),
FROM ( your query here )
GROUP BY num_ads;
BTW, While "SELECT '1' "num_ads" is valid syntax I recommend you use the
"AS" keyword. '1' AS "num_ads"
David J.
--
View this message in context:
h
UNION
SELECT fields FROM tblTable WHERE condition
Respectfully,
Jorge Maldonado
Not using pure SQL. pl/pgsql provides you access to conditionals and flow
control so you should be able to create a function to do precisely what you
need.
David J.
a
0 b
0 c
1 a
1 b
How do I just choose a preferred element say value 'a' over any other
elements returned, that is the value returned is from a subquery to a larger
query?
Thanks.
ORDER BY
(with a LIMIT depending on circumstances)
David J.
Joining several rows into only one
>
> You need to use the array_agg() and array_to_string() functions.
>
Or you can skip directly to the "string_agg(expression, delimiter)" function.
See http://www.postgresql.org/docs/9.2/interactive/functions-aggregate.html for
more informa
turns its own record. Even though only
one record is ever returned without the "g" option the function itself is the
same and still is defined to return a set.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
On Mon, Nov 19, 2012 at 08:31:10AM +0800, Craig Ringer wrote:
> On 11/19/2012 01:11 AM, Louis-David Mitterrand wrote:
> > On Sun, Nov 18, 2012 at 07:27:54PM +0800, Craig Ringer wrote:
> >> On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote:
> >>> Hi,
> >>&g
On Sun, Nov 18, 2012 at 07:27:54PM +0800, Craig Ringer wrote:
> On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote:
> > Hi,
> >
> > I'm planning to centralize all db maintenance jobs from a single
> > pl/pgsql function called by cron every 15 minutes (highest fre
Hi,
I'm planning to centralize all db maintenance jobs from a single
pl/pgsql function called by cron every 15 minutes (highest frequency
required by a list of jobs). In pseudo code:
CREATE or replace FUNCTION cron_jobs() RETURNS void LANGUAGE plpgsql AS $$
DECLARE
rec record;
BEGIN
/*
.
Since you have not shared the true context of your request no alternatives
can be suggested. Also, your ability to implement certain algorithms is
influenced by the version of PostgreSQL that you are running and which you
have also not provided.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
rt/update/delete triggers. A boolean
flag along with a partial index can work instead of an actual table in some
cases. If using a table only the pkid needs to be stored, along with any
desired metadata.
It probably isn't worth the effort until you actually do encounter performance
proble
;colon" has nothing to do with it.
It appears that "wwn_end" is defined as an array and not a simple text
value.
You need to provide the table definition for "wwn".
This is a section in the documentation regarding arrays but I am guessing
the use of an array in this situatio
o
determine how a DELETE was issued.
The trigger itself would seem to be possibly exhibit concurrency issues,
meaning that in certain circumstances the last record could be deleted. You
may want to add explicit locking to avoid that possibility. That or figure
out a better way to accompl
zcount, 0) AS zcount
FROM (cal CROSS JOIN id_master) master
LEFT JOIN datavalues USING (id, stamp)
Also, the mixing of multiple FROM relations and JOINs is confusing. In
particular is the fact the JOIN takes precedence over the "," in FROM
"A JOIN clause combines two FROM items.
ions") as well as PostgreSQL's full text search capability
since both are "string" related.
http://www.postgresql.org/docs/9.2/interactive/functions.html
http://www.postgresql.org/docs/9.2/interactive/textsearch.html
My best guess is you want to learn about substring functions and/
L JOIN (SELECT ROW_NUMBER() OVER () AS index, generate_series(...) AS
long_high) long_high_rel
You may (probably will) need to move the generate_series into a FROM clause
in the sub-query but the concept holds.
Then in the main query you'd simply...
AND lat BETWEEN lat_low AND lat_hi
there. Each,
"unnest(array)" call explodes one dimension. Consider wraping things in a
function to make the code cleaner.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
one time per id and create a
materialized view - basically insert the results of the query into a physical
table and for live usage query that table. This is a cache and comes with all
the benefits and downsides thereof.
David J.
On Oct 1, 2012, at 21:13, Robert Buck wrote:
> So as you
.
As a second (not necessarily mutually exclusive) alternative: install and use
the hstore extension.
David J.
Thanks in advance,
Bob
select
t.id_name,
max(t.begin_time) as begin_time,
max(t.end_time) as end_time,
max(case when (m.id_name = 'package-version
..
FROM (
WITH final_result AS (
SELECT pkid,
FROM tbl
WHERE ...
) -- /WITH
SELECT pkid, FROM final_result
) src -- /FROM
WHERE src.pkid = tbl.pkid
;
If you provide an actual query better help may be provided.
David J.
--
Sent via pgsql-sql mailing list (pg
, syntax not tested)
Select objectid, name, coalesce(actuals.value, defaults.value)
From objects cross join (select ... From attributes ...) as defaults
Left join attributes as actuals on ...
Build up a master relation with all defaults then left join that against the
attributes taking the matche
are allowed to use a FROM clause with UPDATE so if you can figure out how
to write a SELECT query, including a CTE if needed, you can use that as your
cache.
An immutable function should also be optimized in theory though I've never
tried it.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
solve
> this issue without affecting the ORDER BY it already has ?
>
> Regards,
> Jorge Maldonado
Since you are forced to include the ON field(s) first in the ORDER BY if you
want a different final sort order you will have to use either a sub-select or a
CTE/WITH to execute the above query then in the outer/main query you can
perform a second sort.
David J.
d have the behavior, if
different section numbers.
In short the whole "NEW.name" is a variable and you need to build the statement
the same way you would with any user-defined variable.
David J.
well though if you are
going to filter/sort on initial date frequently (by itself) then it likely
wants its own index anyway and having two separate indexes would be better.
David J.
On Sep 9, 2012, at 20:56, JORGE MALDONADO wrote:
> Firstly, who should I reply to, you or the list?
> Yo
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of JORGE MALDONADO
Sent: Sunday, September 09, 2012 1:26 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Query with LIMIT clause
I have the following records that I get from a query, the fields are date
type in d
ments.html#PLPGS
QL-STATEMENTS-EXECUTING-DYN
Basically when you use "EXECUTE" you do not embed the "INTO" as part of the
SQL query but rather INTO becomes a modifier of the EXECUTE itself:
EXECUTE 'some query' INTO {variables}
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
he column name and lookup the corresponding
column on "test3_table" to determine the data type associated with the
value. I do not know the specific syntax to do this but the information is
available in the database.
It helps to provide the why behind what you are trying to accomplish and
just ask whether some behavior can be accomplished or emulated.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
NY ( split_to_array($$'1,3,5,7,11'$$,
',')::int[] )
In this case you pass a single delimited string (replacing the $-quoted literal
shown) with whatever values you want as a single parameter/input. Convert that
string to an array and then use the =ANY array operator to match th
tions that the triggers sets forth so the trigger performs
a "RAISE ERROR 'Template Id should be the identifier of a template'". You
will need to speak with someone responsible for maintaining the database.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org
t;1}. Zero you ignore, 1 you generally put on
the same table - though not always, and more-than-one you create a separate
table and store multiple values as separate rows instead of as columns.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
er. With a recursive CTE you can start at the
bottom of the trees and only evaluate the needed branches.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
.id_project, n1.name_auth, n2.name_auth
From pj
Left join t3 as n1 on (id_auth1 = id_auth)
Left join t3 as n2 on (id_auth2 = id_auth)
;
Full join the two project tables and give aliases to the duplicate id_auth
field. Then left join against t3 twice (once for eachid_auth) using yet a
another set of
te the partial index on that. You could also
consider creating an updatable view and avoid directly interacting with the
three individual tables.
You could also just turn event states into a history table and leave the
current state on the event table.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
How would I build a view for this that shows all flags for any company?
> When I create this view I'would not know how many flags exist at
> execution time.
>
>
> This must be a common issue.
>
> Is there a common solution, too?
>
>
You should look
ess) row while unmatched
records will have one of the two resultant columns NULLed
SELECT tableA.subid_a, tableB.subid_b
FROM tableA FULL OUTER JOIN tableB ON (tableA.subid_a = tableB.subid_b)
Requires at least version 8.4
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
should not meaningfully impact query plan
generation and thus it should be no slower than a more direct query.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
one is
> used as the default.
>
> Is this possible with plpgsql???
>
> Johnf
>
http://www.postgresql.org/docs/9.0/interactive/sql-createfunction.html
... param_n type DEFAULT value
OR
... param_n type = value
It is SQL DDL syntax and not specific to the language the function is
Mike
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
I would recommend using the "RANK" window function with an appropriate
partition clause in a sub-query then i
0/interactive/functions-aggregate.html
Assuming that the users_id field is an integer:
SELECT MAX(users_id) FROM users; --NO GROUP BY needed since no other fields
are being output...
That said, you really should create and attach a sequence so that you can
avoid race/concurrency issues.
Dav
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of Andreas
Sent: Tuesday, April 24, 2012 5:35 PM
To: Samuel Gendler
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] generic crosstab ?
Am 24.04.2012 22:08, schrieb Samuel Gendler:
On Tue, Apr 24, 2012 at
Documented behavior. Please read the section on UNION for the why and the
proper alternative syntax:
http://www.postgresql.org/docs/9.0/interactive/sql-select.html
On Mar 28, 2012, at 7:01, Gary Stainburn wrote:
> Hi folks.
>
> I have two selects which in themselves report what they should.
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of Richard Huxton
> Sent: Monday, March 19, 2012 4:59 PM
> To: David Johnston
> Cc: 'Rehan Saleem'; pgsql-sql@postgresql.org
> Subject: Re:
You would need to install the "HSTORE" extension to convert the record into
a key->value pair then perform the comparison on that.
Dave
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of Rehan Saleem
Sent: Monday, March 19, 2012 3:40 PM
To: pgsql-sq
> LANGUAGE plpgsql VOLATILE
>
> CREATE TRIGGER trg_check_PO_extra_date
> BEFORE INSERT OR UPDATE
> ON extra_values
> FOR EACH ROW
> EXECUTE PROCEDURE fnc_check_PO_extra_date();
>
>
You are suppressing the original exception so figuring out what is wrong is
very d
uot;"
SQL state: 22P02
Context: PL/pgSQL function "getsitesbytfid" line 6 at IF
The empty-string is not a valid syntax for an integer.
You probably want: IF (distance IS NULL)
.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
er doesn't make sense with a frame clause...frame is more useful for
stuff like calculating rolling sums/averages and the like - where you evaluate
fields in the surrounding frame as part of the aggregate.
Window functions do not affect the number of rows returned.
David J.
--
Sent via pgs
On Feb 15, 2012, at 21:05, Andreas wrote:
> Am 16.02.2012 02:13, schrieb David Johnston:
>> -Original Message-
>> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
>> On Behalf Of Andreas
>> Sent: Wednesday, February 15, 20
-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On
Behalf Of Andreas
Sent: Wednesday, February 15, 2012 8:03 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] need help with import
Hi
I get CSV files to import.
Th structure is like this.
main p
ere is not inherent linkage between the
"UPDATE" table and the "FROM" table. You can make a correlated sub-query
but in this case the is necessary.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
On Feb 2, 2012, at 0:32, tiplip wrote:
> I just need gid or id in increasing order start from 0 (or 1), fetching their
> original gid (or id) value is not necessary:)
> can I do that?
>
>
> David Johnston wrote
>>
>>
>> The general method is to use "
;name22' 'address22' 102356 2
>
> geom22
>5 5 'name31' 'address31' 102356 3
>
> geom31
>6 6 'name32' 'address32' 102356 3
>
> geom32
>- - - - --- -
>
> -
>
>
> can I achieve that results with a single query sentence? and how?
> any good ideas will be appricated?
>
> thanks
>
>
The general method is to use "UNION" but not sure about the changing of the gid
and id values...
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
nnot readily specify how.
Generally you'd simply operate off of "id" and then join in the
corresponding first/last names at the outer-most layer of the query. Since
you are grouping on "a.id" anyway I would suggest you try it.
David J.
--
Sent via pgsql-sql mai
he literal value "%ghostsoftware.com" - which obviously is not
an e-mail address - and the original "holyghost.org" email address would
have been gone beyond easy recovery.
Takeaway: test update queries on sample data (or at least within a
transaction block) and confirm your res
very simple queries that beginner reference materials cover adequately. Plus,
you didn't display any effort in attempting to solve the question yourself; you
can do this by showing and and asking what you did wrong as opposed to simply
asking for an answer.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
easier.
Write out your desired output columns, with table prefixes, and mark whether
each on is optional or mandatory. Tables with optional fields are outer joined
to other tables, ideally those with only mandatory fields. The corresponding
ON clauses should use simple equalities, though you may modify the the
comparison values using functions.
It sounds like you need to take a step back and do some serious reading on SQL
basics, though I'll give you credit for at least trying and being somewhat
descriptive of your goal.
David J.
ore
complicated to setup and execute compared to the more direct ON UPDATE
CASCADE modifier to the FOREIGN KEY. But learning both methods is good.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
f the same length.
There are many points-of-view regarding whether to use "serial" PRIMARY KEYs
but regardless of whether you add one or not you should try and define a
UNIQUE constraint on the table by using meaningful values. However, for
things like Orders this is generally not possible
On Jan 11, 2012, at 19:30, Carlos Mennens wrote:
> On Wed, Jan 11, 2012 at 7:13 PM, David Johnston wrote:
>> However, I will say again, you DO NOT WANT TO ACTUALLY DO THIS!
>>
>> The specific issue is that some US Postal Code begin with a zero ( 0 ) and
>> so whenev
as
numeric. If you deal with Canada (and maybe Mexico) at all then spaces and
letters become acceptable characters within the zip_code.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
and add additional phone numbers
> -- This is where things go awry.
> --
> update people
> set phone = CAST(ROW(CAST(ROW(111,'home') as
> phonenumber_type),ARRAY[(222,'office'),
> (333,'cell'),(444,'eve')]::phonenumber_type)
>
that transaction until that
> point.
>
> Any suggestions?
>
> Jan
>
>
Start a "savepoint" before each sub-update and rollback to the savepoint if the
update fails, and then try again with different data. If it succeeds you then
release the savepoint anad mov
be done in a container-independent way (*shudder*). I'm quite sure
> that using EJB timers is NOT the right way to do it - they're not
> supported by web profile containers and are really intended for
> "business level" timers that should be persistent across
> rede
ction and so must be sourced
from somewhere. 2011-11-20 is a literal being fed into a function and so does
not require a From clause in order to be evaluated.
David J.
On Dec 17, 2011, at 11:50, John Fabiani wrote:
> As always I respect your insights - Adrian. I do understand what I did wr
;
>
"select ... as week_date where week_date in ..."
You are missing a FROM clause for the main select; the only FROM you have is
part of the IN target subquery.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
FROM clause as the
> query will return unneccessary duplicate
> row...the same goes for port2node being Null or 0...
>
>
> thanx in advance
> richard
>
>
Two options (one of which may not work for you).
1. Write two queries, one for each table, and union the results.
2
parameter, please
regards
Pavel Stehule
--
Or, in lieu of readily passing arrays from your client API you can always pass
a string and modify the query to parse the string into an array.
... users = ANY ( regexp_split_to_array( $1, ',' )::integer[
ng all of: a test case, AND EXPLAIN ANALYZE
results, AND a description of what is taken as being a problem, is necessary
to provide suggestions.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ession.
Going by observation/inference here...
An array can never take on the "unknown" type whereas a scalar can. The
unknown type can be passed to the Insert where the target's column type can
then be used for casting. The array, needing immediate casting, chooses the
most
r data was
provided.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ON ppr_data(aarstall int, frauke int, tiluke int,
prosjektkode int[] ) -- Note the change to int[] from int for prosjektkode
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
x your process. Done
correctly there should be no difference in the end result regardless of how you
choose to identify your strings.
Don't use pgadmin3 myself so I don't know if what you are looking at would
include the E. If it is outputting DDL (I.e., INSERT statements) it might but
simple SELECT results should not.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
n explicit cast of a value to varchar(n) causes the value to be truncated to n
characters.
E.g., '1234567'::varchar(5) -> '12345'
How to integrate that knowledge into a type I do not know.
David J.
>
On Oct 22, 2011, at 10:07, Pavel Stehule wrote:
> 2011/10/22 David Johnston :
>> On Oct 22, 2011, at 6:41, Linos wrote:
>>
>>> Hi all,
>>>i need a little of advice on what could be the best way to store this
>>> information.
>>>
>&
l security, for that you need
functions. While a view itself will not provide the protected data a function
can be used to process data (via RAISE NOTICE) that would otherwise be filtered
out in the end result. This is because views are simply re-write rules.
David J.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
On Oct 22, 2011, at 11:39, Linos wrote:
> El 22/10/11 14:53, David Johnston escribió:
>> On Oct 22, 2011, at 6:41, Linos wrote:
>>
>>> Hi all,
>>> i need a little of advice on what could be the best way to store this
>>> information.
>>>
&
lumn and multiple category columns.
( amount_value, amount_unit, amount_category, vendor_id )
If necessary each "amount_value" data type should have it's own table since the
processing logic will vary (I.e., you cannot subtract text or Boolean values).
You are , in effect,
result FROM ...
)
SELECT (func.func_result).* FROM func
David J.
On Sep 25, 2011, at 12:37, "R. Smith" wrote:
> On Sat, Sep 17, 2011 at 2:56 PM, David Johnston wrote:
>> On Sep 17, 2011, at 9:32, "R. Smith" wrote:
>>
>>
>> What I want to do is do a query joining table A with B and sorting
>> firstly on
omefield = max_date.specialdate;
You can use a online query instead of the WITH if desired, same effect.
You could also drop the join and use the max_date CTE in a WHERE clause:
... FROM table WHERE table.somefield = (SELECT specialdate FROM max_date)
David J
--
Sent via pgsql-sql mailing
able value into a different variable.
DECLARE tbl_schema_copy VARCHAR; tbl_schema_copy := tbl_schema;
. WHERE tbl_schema_copy = e.tbl_schema .
David J.
> Thomas
>
>
Try sticking the recursive keyword after the "with" if any of the following
CTEs are recursive.
WITH RECURSIVE
normal1 AS ()
,recursine1 AS ()
,normal2 AS ()
,recursine2 AS ()
SELECT ...
David J.
also help if you actually provided a detailed
description of you goal instead of the generic one quoted above. Given your
stated need the query does exactly what you requested.
David J.
1 - 100 of 494 matches
Mail list logo