« first day (2782 days earlier)      last day (2087 days later) » 

5:38 AM
Morning
 
6:03 AM
WHAT IS UP @hot2use
 
Don't know. What IS up?
Well for starters it's Friday! :-)
And I had a freshly pulled/poured Guinness and a half yesterday. :-)
 
it's a good point
friday++
 
7:07 AM
morning
 
7:24 AM
Morning
 
7:34 AM
morning
 
7:53 AM
Morning
 
 
2 hours later…
9:55 AM
-3
Q: pgplsql error(syntax)

sumit vadheraThis is giving me an error. Any help or clues? ERROR: syntax error at or near "foreign" LINE 19: where lower(tc.constraint_type)='foreign key' OR lower(tc.co... Here is my code: create or replace function help_constraint(schemaname text, tablename text) returns char as $body$ declare...

Sounds like the asker has no idea what they are doing.
 
 
1 hour later…
11:10 AM
@Colin'tHart Helped in a comment-answer. (@PaulWhite will love me for that)
This is a very basic syntax issue. You are starting the variable with query := 'SELECT... with a single quote. The variable is then finished because of the single quote at ...(tc.constraint_type)='foreign key... (the single quote before foreign key). You need to add an additional single quote so it looks like this: .... (tc.constraint_type)=''foreign key'' OR.... This will ensure your string is not broken and that a valid SELECT statement is generated. See: 36.2. Tips for Developing in PL/pgSQLhot2use 1 min ago
 
@hot2use It's OK when the question is closed (and probably doomed)
 
@hot2use It's postgres, they can but don't need to do this.
They can use different quotes for the different levels, e.g. query := $query$ SELECT ...
 
ugh links on sites with the new themes are underlined
 
Ugly. But it was turned on just now. I was on a meta question which didn't have the underlined links until I refreshed.
230
Q: What are the hidden features of Stack Exchange?

JosephStyonsWhat features of Stack Exchange sites do you consider "hidden"?

 
Yeah I can only imagine it is an error.
 
11:20 AM
So sumit is learning PostgreSQL the hard way.
@ypercubeᵀᴹ That's in the link I added to the comment. True. :-)
 
 
2 hours later…
1:32 PM
@hot2use He's way out of his depth. I have to wonder why he needs to do this.
 
2:06 PM
> "PostgreSQL, Microsoft SQL Server; it's all the same. Just do it."
 
2:48 PM
@TomV Hope you don't mind the UNION ALL case change:
2
A: Inner join with greater or equal VS where condition using a variable

Tom VYes there will be a (marginal) impact on performance, but if it's for debugging purposes I don't think you'll be able to tell the difference. You can easily test this yourself on your data by adding statistics IO and looking at the query plans Take this code for example: SET STATISTICS time ON...

 
 
1 hour later…
@MDCCL not at all. Thanks
 
 
3 hours later…
6:58 PM
Anyone else seeing [object Object] when they try to edit a comment?
Seeing this on both dba.se and so
 
@AaronBertrand Yep.
Tested on dba.se.
 
Thanks.
1
Q: Bug: Edit comment yields [object Object]

Aaron BertrandAt some point this afternoon the edit comment functionality was changed and now when you edit a comment you see [object Object] instead of the text. If I click edit here: I see this: This is happening on at least Database Administrators and Stack Overflow.

 
7:46 PM
@EvanCarroll I'm very curious for your benchmark results!
And I never realised that Postgres allows
exists (select from ... )
without any columns in the select clause!
Fantastic!
For anyone else following along, we're working on this question:
1
Q: How to most efficiently find out if a record has child records?

TheCatWhispererI am writing a query that returns a single record from the parent table. I would like to also return in this query if it has any children. This is a one to many relationship. parent: -parent_id -name child: -child_id -name -parent_id My first instinct is to write the following query: selec...

@EvanCarroll There goes Apple's trillion dollar market cap.
 
8:04 PM
@Colin'tHart SELECT 1 is great, Pg doesn't optimize SELECT *
 
8:20 PM
@Colin'tHart updated with the results and with the index
 

« first day (2782 days earlier)      last day (2087 days later) »