So, just before I get too far into this, I want to make sure you understand what this presentation is and what it isn't because I've already answered one question on PLPG SQL. I'm going to cover Postgres functions kind of in general and all the things that you can do with them and all the options in a fair amount of detail. But what I'm not going to do is go into a great deal of depth in writing PLPG SQL functions, for instance. There are some examples of that in here. The other thing I should mention is that this presentation derives from one that I've given several times before and I really need an hour and a half to do the full presentation. We only have 45 minutes, so there's no way to do that. So what I've done is I've moved a lot of the more detailed examples into an appendix in this slide deck and you can download the slides. I'm sure the conference will provide them somewhere. I've got a website, jocanway.com. By the way, my personal email address is just mail at jocanway.com. And I've got lists of presentations here and at the bottom of this list here. Not the fanciest website in the world, but it does for me. I've linked the PDF for this presentation. So there are a bunch of examples that we will definitely not get to today in there that go into more depth in some of the options.  I guess I should go to a bigger. Okay, so first of all, options in Postgres are full fledged SQL. Functions in Postgres are full fledged SQL objects, but they're also used as the underlying mechanism that implements a lot of other objects in Postgres. And they're built in to the architecture from the ground up. That's pretty much why Postgres is known for its extensibility. And the reason Postgres is so extensible is because so many of the underlying features are implemented with functions and you can write your own functions in a variety of languages. In terms of where you can use functions, it's also pretty flexible. You can use them in the target list, so like this where you say select some function, feed it the column from a table. You can use them in the from clause. So this is a so-called set returning function. So the function itself represents a relation. It's rows and columns, and it can be joined with other tables or other functions or whatever you want to do with it. And they can also be used, of course, in the where clause as part of your predicate. These are just, this is not an exhaustive list, but this is a pretty good list of the things that are implemented underneath the covers by functions in Postgres. So when you use the plus operator to say one plus one equals two, that plus operator actually has a function that implements it. And so when you call one plus one, the arguments on either side of the operator get fed to that function as the two arguments, and then it returns a value. And that's how you implement the plus operator. Data types are all implemented with functions. So there's always an in function and out function for every data type. So that will translate between what the string representation or rendering of a value is with the binary and how it's stored. So a timestamp is stored as a binary value, but it's printed out in a whole variety of formats depending on how you have things configured and so on. Index methods, every data type that can be indexed by VTRI indexes has to have a comparator function that returns minus one zero or plus one depending on whether one argument is greater than equal to or less than the other argument. And so on, triggers, aggregates, in more recent releases ordered set aggregates and window functions, all done through functions. In terms of the types of functions that you can write, there's basic SQL functions. There's a whole variety of procedural languages that are slightly different than SQL functions. Then there's internal functions, which are the ones that are really built statically into the Postgres binary itself. And then you can furthermore write your own functions in C language if you want and load those. Another thing I'll mention as I go through this, in the slide deck, I've tried in a number of places to provide a link into the documentation where the subject that I'm on on that slide is discussed. So if you want to drill into more detail afterwards, you can find your way into the documentation. So in terms of SQL functions, their behavior, basically SQL functions are an arbitrary list of straight SQL delimited by semicolons. And unless you've declared the function to return void, the last statement in the SQL function has to return something. And that's what will be returned by the function. So you could have several statements that do things, inserts, updates, deletes, but that final statement needs to either be a select or it needs to be some kind of DML with a returning clause. Are people generally familiar with returning clauses on, as you say, a show of hands? How many people have seen insert or returning, that sort of thing? That's good. The arguments for SQL functions, in the more recent releases, they can be named arguments, but you can also use dollar sign one, dollar sign two to reference the arguments. They cannot be used as an identifier. So you can't pass an argument into a SQL function and then use that as the name of a table or the name of a column. You can actually pass in a composite type. So a composite type is, if I use the word composite or a tuple type, what I'm talking about is basically a row definition. So that would be column names with data types associated with it. So you can pass an entire composite type as an argument into a function and in that case you would use the dollar sign dot column name notation or the arg name dot column name notation. And on return, if you create, some of these things we're going to talk about later on in the slides, but you designate for a Postgres function whether it's returning basically a singleton, a single value, single row, or a set, meaning potentially, but not necessarily, multiple rows. And so if you've defined the SQL function to return a singleton and the last query in the function doesn't return anything, then you're going to get a null.  It'll just have a null value in it. But if you've defined the function to return a set and the last thing, last statement returns no rows, then you're going to get an empty set. So there's kind of a subtle difference there. Procedural languages are written in something other than SQL and C. Basically, they're actually implemented through functions as well. So every procedural language has a function called the language handler that knows how to take the string that you've provided for the body of the function and pass it off to some kind of a compiler and executor that's going to turn that string into executable code. The library that implements the language handler is going to be loaded dynamically. So it's something that the first time you call a function in that language in a given session, that library has to get loaded. So there's some overhead associated with that. One thing to note, I don't actually have a slide that talks about it here, but there is a parameter in PostgreSQL.conf called preload shared libraries. And you can use that actually to cause one of these libraries to be loaded at the point when PostgreSQL first starts up. And the way Postgres works is that when you connect the back end that's listening for the connections will fork a back end for your connection. So if you've preloaded a library, at the time the fork happens, the library is already loaded and you've now eliminated some of that overhead. The procedural languages can be self-contained. So PLPG SQL is an example of one that's provided by the PostgreSQL project. It's maintained by the PostgreSQL project. It doesn't depend on anything external. But they can also be something that is externally linked. So PLPerl, PLpython, PLtickle, PLr, those are all examples of procedural languages that you've got this loadable language handler, but it in turn is also linked to some external dependency. So just a few words on PLPG SQL since it is kind of special. This is the one that is maintained by the PostgreSQL development group. It's self-contained. It's basically SQL plus procedural language elements that allow you to define variables, have conditionals, do loops, check for errors, have cursors, so on and so forth. So you have basically a full programming language there. And as was mentioned earlier before we actually got started, PLPG SQL is sort of loosely modeled after Oracle's PL SQL. So if you're familiar with PL SQL and Oracle, you'll find it looks pretty familiar. And if you're converting functions from Oracle, you'll find that if they're simple, they might just cut and paste. But if they're not simple, it won't be so simple. In all of the currently supported releases, PLPG SQL is automatically installed for you, so you don't have to install it. But you can uninstall it by using the drop extension syntax. And if you needed to reinstall it, you could use the create extension syntax. Now, I know I'm going pretty fast here, and I need to to get through the slides. But if someone has a question somewhere along the way, just stop me. So you said that ordinarily the first time that it's needed? That's right. So if you were to, say, install a newer version of one of these, would you have to tell Postgres somehow that you have a newer version? Or would you do a drop extension and a create extension? Or would you have to restart Postgres? I'm assuming you're talking about something that you've gotten externally. Because if it was one of the ones provided by Postgres, which I haven't actually covered yet, then the newer version would come with a newer version of Postgres, right? So if you're talking about something like PLR or PL Java or PL Ruby, then you would not need to do anything other than reconnect to Postgres. As long as that newer version was still compatible with the version of Postgres that you were running, it would simply get loaded the next time a session connected. Unless you're preloading shared libraries in which case you would have to restart Postgres. That's a very good point. This is something, as was mentioned, I develop PLR. So when I'm making changes to PLR and recompiling them, I basically just have to reconnect to Postgres and I see the effect of my change. Internal functions I mentioned are statically linked to the back end. So those are things that are provided with Postgres directly. And there's not a lot that you can do with these, but there is a syntax available so that you can essentially rename one of these things. So in the example here, there's an internal function called dsqrt for square root using double precision. And if you wanted to rename that as square root in this example here, you could do that by simply referencing that symbol and declaring this. So C language functions are obviously written in C. They're compiled into dynamically loadable objects, shared libraries, a link system, it would be a .so file. On Windows it would be a DLL. They're loaded, as we mentioned, on demand. There are a good number of examples of this in the contrib folder in the source. So if you have interest in writing a C function, there are plenty of examples. In order to really cover at any kind of depth, we would spend an entire day. So it's not something I can really cover here. Similar to PLPG SQL, to really give it due at any justice, you'd have to spend a half a day or a day covering it. So it's not something we can really cover in detail. I will point out that there's this PG module magic is a macro that you have to use, and this kind of applies to what you're just talking about. If the extension that you're trying to load was compiled against a different version of Postgres, a different major version of Postgres, that little bit is what ensures that you don't load it into a different version of Postgres, in order that you don't have unexpected crashes basically. Bad things can happen if you compile against one major version and then you try and load it in another, and so that prevents that from happening. In terms of what languages are available, PLPG SQL, PLPerl, PLpython, PLtickle are all in the main source tree for Postgres. They're all maintained by Postgres Development Group, and they're all distributed with Postgres, so those are kind of in all of your standard installations. There are a number of others available. There's a PLjava, actually I think at one point there were two different versions of PLjava. PLr, there's a PLv8, which v8 is Google's JavaScript engine, so that ties in nicely with some of the recent JSON capabilities that Postgres has, and there's even a PLshell written by Peter Eisenkraut, who's somewhere here at the, somewhere here at the conference, yeah. But potentially very dangerous. They're reasonably stable, and it's only on major versions. I don't know to what extent people are aware of the versioning in Postgres. But Postgres like 9.4.1, which is the current most recent release, the point one is what Postgres community generally calls a dot release. The dot release is just bug fixes. It's no enhancements, no new features, and they're intended to be, they're considered to be safer to upgrade than to not upgrade when we come out with a dot release. So those are completely backward compatible. Anything that loads in 9.4.0 is gonna load in 9.4.1 and 9.4.2. The issue that you would have is if it's compiled against 9.3, and then you try to use it in 9.4. But to get back to your question, you know, as I said, maintaining PLr, I have to keep it compatible with Postgres as major versions come out. And I can tell you that in the last two or three major versions, I may have had to modify half a dozen lines of code, if that, in order to keep it compiling against newer versions. So they're pretty stable. There's no guarantee, and occasionally there are some significant changes to the APIs in the back end, but it also depends on how deep you're reaching in and how fancy the things are that you're doing. So before we get into actual function creation, I wanna talk about dollar quoting. Who here is familiar with dollar quoting? So when you're creating a string variables as part of your SQL that need to have single quotes around, right? Well, the whole statement that you're trying to compile is also a string. So it would have to have single quotes around it. So years ago, you dealt with that by escaping the quotes, so inside your main string, you'd have doubled up quotes, and then if you had something that was being called in there that was calling another function, you might have quadrupled up quotes, and then you might even, I've written functions myself years ago, where I had eight and 16 single quotes. So it gets pretty hard to read and pretty ugly, pretty fast. Dollar quoting is a wonderful thing. Basically, you have double dollar sign, and you have an optional tag in between it, and you just match the tag at the beginning and the end of the string that you're quoting. So now everything inside there can actually have a different tag in it, and you can nest these things. Plus, you can have, at the very deepest level, you can have just single quoted things that look like normal and are easier to read. So you can see in this example here, I've used the dollar, underscore dollar as my dollar quote, but now I can just, and I have another dollar quote here with no tag at all, but then my string, hello, is just kind of single quoted around it. Another little side thing I wanted to touch on is anonymous functions. So this was added, again, I'm not sure it's in, was it 9.3? I was gonna say, I don't think it's in 9.0 or 9.1. I think it's in 9.2, though. It's a fairly recent addition is an anonymous function. So these things basically let you write a one-time use function. Now they're limited in that you can't pass arguments to them and they can't return anything, but they can be useful to do like administrative work. So here's an example of one, or in this example, what I'm doing is I'm looping through the Postgres internal tables to find all of the users who belong to a certain group. So my group I'm looking for is admin. I'm finding all the members of the group admin, and then I'm taking that string, the roll name, and I'm concatenating it to an alter a roll statement to set a custom configuration variable for all those users that are in the admin group, and I'm looping through them all. So I can do this as a kind of a one-time, I wanna assign the same value to all of these users, or I wanna do the same grant to all of these users. You can write one of these things, execute it, and then here's just a query that I'll show you how to prove that what I just did worked. So there's this roll name Rockstar, he belongs to the group admins, and now he's got this custom setting for workmen with 512 megs. And then one more thing, before we go into actual creation of functions, I just wanna mention replacing existing functions. There's quite a few of the Postgres objects that can be created also support this notion of create or replace. The reason for that is that objects in Postgres end up with dependencies. So if you've got a function that is implementing a trigger, and then you've got a trigger on a table that uses the function, if I wanted to update that function, I needed to fix it, fix a bug, change something. Without create or replace, you would have to then cascade that drop of the function and then recreate the function. So that could get also pretty ugly because that chain of dependencies could be quite long. So as long as you're not essentially changing the API of the function, you can do create or replace. And all of the things that refer to it actually refer to it by an underlying object identifier instead of the name. And we allow you to just replace the function without affecting all the things that depend on it. Yeah. The type hasn't changed, you're saying. And is the argument an in argument or just rename it. It's probably something we could do better, but I can't say that there's a good rationale for it. Well, you can call functions with named arguments now. In fact, I'm gonna show you examples. You can call a function with a named argument and you can supply the value and then call the function with the arguments out of the original order as long as you've named them. They're technically not because the, again, I've got a slide on this later on, but functions in Postgres can be overloaded. And the way that they're identified is based on the name of the function and the signature of the data types of the input arguments. And that name is actually not part of that. So we could resolve the function as long as you don't change the return type or the signature that defines which function it is we're talking about. I should think that we would be able to deal with that, but without looking at the code, I can't tell you why we don't. Any other questions around that? Okay, so this is the syntax for creating a function. You know, there's quite a bit going on here and by the end of this presentation, hopefully if I don't run out of time, I wanna touch on basically every bit of this so you understand at least at some level what all of these things do. And I'll tell you, as long as I've been using Postgres, I've been using Postgres for 16 or 17 years. And when I first sat down to put together the slides for this based on this premise of going through all these things, I learned stuff. So Postgres changes so fast over the years, things have been added, things have been changed. It's impossible to keep up with it all. So there are some, hopefully all of you will take away some new learnings from this. The arg mode, this is what's defining whether the argument is going into the function, coming out of the function. You can actually declare an argument to be going both in and out, and you declare an argument to be very dick, which means it can be one or more arguments that it represents. The default is in, so if you're not specifying an arg mode, you're getting an in argument, which is kind of the standard thing that people would expect with a function is that arguments go into it. And it's, although it's not required, it is good style to kind of line up your arguments so that the in arguments are first and then the in out and then the out arguments. As I just mentioned a minute ago, the function name plus the data types of all of the input arguments are what identify a function to Postgres. So when you call a function, those elements are what gets used to look up in the catalog and figure out precisely which function it is you're calling. So in this example, I've got an in argument, an in out argument, and an out argument, and I don't know how many people are familiar with this syntax, but you can use this values clause just like you have with an insert statement. When you use it like that, it's equivalent to a sub-slide. So this values with these arguments basically just produces a row. And for that matter, you'll see other examples later on where you can say comma, parentheses, and another set. You can actually produce multiple rows this way. Definitely useful for test and it can be useful for unusual production environments as well. For this case, these two arguments are going to define what comes back out of the function. So the next part of the function arguments is the arg name, not all languages necessarily have to support this. If you go way back, none of them did. I forget when it was added, but it's certainly in all, I think it was added in 9084. I think all really, all currently supported versions of Postgres do support argument naming. I think what is different is that SQL functions only started accepting argument names about nine one. So but other PLPG SQL could take argument names in 90. Yes? Well, you have to explicitly declare the in-out arguments. I'll cover that in a few slides. I'm actually starting to run out of time, so I'm gonna have to speed up a little bit, but I think you'll see that covered in when I get to the returns. So in this case, it's the same exact example, except I've named the arguments and now you can see that the columns when I do the select actually give me those, those named columns. And if I was joining on this with something else, I could refer to those. The argument types, this is the actual data type that I'm passing. They can be base array, composite or domain types. They can reference the type of a column using this kind of syntax. And they can also be these pseudo types, any element, any array. One of the things I'll mention here is that if you do use a pseudo type, let's say any element, any array for the arguments, the way those work is that whatever type gets used at runtime in a position that uses a pseudo type like that, the other positions that also use pseudo types have to be the same data type or a compatible one. So in other words, if I have any element in one position, any array as the return type for the function, then at runtime when I call that function, if I've passed an integer in that first position, then the return is gonna be an array of an integer. You can assign default expressions. So if an argument is not provided, the default expression will get used. And so you would do that by you can say default or you can say equals a value here. And then if you call the function without supplying that argument, it just gets defaulted to that value. Now once you've used a default on a column, on an argument, all of the following arguments also have to have defaults. And that's to aid in this reconciliation of which function it is we're trying to call. So if there's one default, then the following ones all have to have defaults. We talked about function overloading. Here's an example of it. I've created the same function called foo. One of them takes text, one takes int. They can each do something different. And when I call that same function name, in one case with a string, in one case with a number, it's going to choose the function based on the function name and the argument signature. Now this same thing actually could be done with a single function today if you wanted to using the pseudotex that I was just talking about. Okay, in terms of return types, you can say returns a particular type, or you can say returns table and provide a column definition list. So if you're using the return type method, again, you can have base scalar types. You can have composite types, domain types. You can specify the type of a column using the same syntax as you did for arguments. You can have these polymorphic types. And you can also have these special pseudotypes. So these, as I mentioned, a function implements each one of these procedural languages. And if you write one of those, it needs to return this language handler. If you write a foreign data wrapper, it needs to return fdw handler. Triggers, if you write a function that's going to implement a trigger, then your function needs to return trigger. And you can also have a function that returns voids. So if you have a function that's just being used for its side effects, don't want to return anything, you can have a return void. If you do return a return type, it has to match any in-out or out arguments that you've provided. But it doesn't necessarily return a set. So you can omit the returns clause entirely if you have out arguments. But if you do that, there's no way to specify that it's going to return a set and therefore it won't. And so in this example here, what I've said is these are both out arguments. I'm not supplying a return clause. Now, this time you see the values clause that I'm using actually has two rows in it, but I only get one row back and that's because this thing can't return a set. So now I'm going to give you a bunch of different examples of different ways, different styles to return things. And the only explanation I have for why you're going to see four or five different ways basically to do the same thing. And the only explanation I have for that is the fact that different people wanted to do things in different ways over the years and so functionality kept getting added to Postgres that allowed you to do the same thing in different ways. So some of these things have existed all the way back to the beginning of set returning functions in 7.3 and some of them are only in recent releases. So in this example, I'm doing two out arguments. I'm saying return set of record and when I select from the function, I get my two rows. In this case, this is kind of the way we did it at the very beginning of the set returning functions is you can actually create a type which is just a composite type. It represents a column definition list. Column names, column types. And then you can actually say you're returning that type. So that's the exact same function again when I call it. I still get the same result but I've just defined it in a different way. Here's an example where I'm saying it returns table and I'm giving it this column definition list in my function definition. So this is a way to do again the exact same thing but without the overhead of having to create the extra type because now the type is basically being created on the fly as we need it. And this is one of the original ways that we would have to do this is if you didn't specify when you created the function, it returns set of record but we haven't provided any kind of information about what that couple looks like. So in that case, you have to actually specify it at runtime. And although there's other ways now that obviously this example you don't need to do this method and this is kind of inconvenient at times. However, some functions that you write you won't know in advance what kinds of columns they're gonna return. So an example of that is dv-link. If you ever use dv-link, you use that to connect to another database, pull back data from it. It can have any number of rows and columns of any different kinds of types. And so the only way to deal with that is to specify it at runtime. You can't actually return set of scaling. So in this case I've said I'm returning a set of in and I just, I get multiple rows but obviously it's just one column. You can alias when you're returning even if you don't provide actual data types just like you can alias the table name you can actually alias the column names. So if you wanted to know that this column was gonna be called F1, you could alias like that. I do this all the time myself. If you ever used generate series, generate series just puts out a list of numbers basically, right? Well, if you don't alias a function like this when you call it, the column name is whatever the function by default.  So what I typically do is I say as G parentheses I and then I can reference it as G dot I. And you can actually call these things in the target list as long as it's in a language that supports it. So SQL functions can be called in the target list like this even if they're set returning. But what you get is not individual elements, you get the entire couple. So this is the way a tuple looks like when it's been rendered as a single entity. And if you wanted to split it back up, you could do this. If you put parentheses around it and say dot star, then you'd actually get those columns split back up. Now, why would you wanna do this? Back when set returning functions were first designed we anticipated the fact that you might wanna have two styles. Basically, one style is called materialized. In that case, whatever the function is doing to produce all the rows happens all at once and then the whole set gets returned. The other style is pipeline. Pipeline means as soon as I produce a row, I send it out. Now, if you've got a very big result set, that's gonna take a lot of room and memory and it's gonna take a while before it starts sending rows out. Now, PLPG SQL does not support pipelining at this point that's still something on the list of things to do. But SQL functions can be pipelined and this is the only way you get it pipelined is to call it in the target list. Okay, so now I'm gonna go through the attributes. We've already talked about all the different languages. You basically just specify the language that you wanna use. The main thing to mention here is that some of these procedural languages come in both a trusted and untrusted version. And PLPG SQL is considered trusted. And the difference is that a trusted language should not be able to get out to the system and do something dangerous. So therefore, you should be able to allow an untrusted user to write functions in a trusted language. Whereas an untrusted language, something like Perl, if you're using the untrusted version of Perl, whoever's writing the function could do a system call and they could do literally anything that Perl can do at the command line in your system, at least in terms of running as the user Postgres. So if they wanted to delete your entire data directory, they could do it. Window functions are kinda like aggregates in that they allow you to work on a set of rows, but instead of returning one row per group, they basically return a row for every item in the group. But it gives you access to the data in the other rows in terms of doing calculations. So you can do things like running sums, you can do ranks, you can do other sophisticated types analytics. Not enough time to really go into it at any depth here. But I do have examples in the appendix. Volatility, this is an important concept. Certain functions will provide a different result every time you call them, even if it's within one SQL statement. That's a volatile function. Certain functions are stable, meaning within a given SQL statement, with the same set of arguments, it's always gonna produce the same result. But from one call to another, that same function may produce a different result. And an immutable function is one that always produces the same result for the same arguments. If you wanna create an expressional index using over a function, it's gotta be immutable, but you can't have your index spitting out a different value the next time you call it. Here's just a quick example of the three different types just to illustrate it. The lower function is actually immutable. Whenever I call that, it always produces the same ABC for capital ABC. The now function is actually stable. So you see I've got one time for all three of these rows here, but a different time for these three rows in the second time I call this function. This clock time stamp is actually volatile. So every single row in these two different calls are going to produce a different value. Called on null input or returns null on null input are also, I don't mention it here, but there's an older syntax called strict for that one. Basically this has to do with, one of my arguments is a null, how am I gonna handle it? By default, if my function gets called with a null, the function's gonna execute, and if your function doesn't know how to deal with null, because nulls are sort of special in SQL, then it may produce surprising results. So if you're not gonna define the function to be returns null on null input, your function better be prepared to deal with nulls. And if you're writing a C function, it's doubly important because if you don't handle a null and a C function, you're gonna get a crash, and any kind of crash is potentially a route for an exploit, right? The other thing you should know is that if you define this as returns null on null input, then if there's a null argument, the function doesn't even get called, so you get no overhead from it. This is notion of leak proof. This has to do with security barrier views. The idea here is that if a function is defined as being sufficiently cheap, the planner could potentially push that function call down inside of a view, and it could occur before some filtering that's going on inside the view. And so if you allow a user who's trying to get at data they shouldn't be able to get at to write a function, it would get pushed into the view potentially if they make it look cheap enough to the planner, and it could do something like raise a notice in PLPG SQL that would show them information from rows that they weren't otherwise allowed to see. If you define a function, if you have a view that's defined as security barrier, then functions will not get pushed down by the planner unless they're marked as leak proof. And the reason that you might wanna do that is because of performance. If you can push the function down as low as possible, which is why Postgres might attempt to do that in the first place, you could improve performance. So if you know that a function has no risk of leaking information, you can define it as leak proof. But this is one where Postgres is gonna trust what you say, so you better be careful. Security invoker and security definer, this has to do with when the function is called at runtime, whose privileges is it going to run as? So if it's security invoker, then whoever's running the function, the function's gonna run as that user. If it's security definer, then whoever created the function, regardless of who uses it, as long as they've been granted access to execute that function, when they execute that function, it's sort of like a set UID function in a Linux or a Unix system where they suddenly get escalated privileges just for the length of the execution of that function. So you can allow them to do something they may not otherwise be able to do. And here's an example of that. Well, basically I've got this table. I don't wanna give the user direct access to the table, but I create this function that's gonna return some data from the table. I can set it as security definer, create that as Postgres, and then the user guest can't select from foo, but he can select from this function and you can see some data that I allow them to see. As I mentioned earlier, as far as the optimizer goes, functions are kind of a black box. The optimizer can't know how to parse every potential language function there is, and so it can't know how expensive it is nor how many rows it's expected to return. So the cost and the number of rows are defaulted to 100 units of cost and 1,000 rows. Sometimes that can be grossly off. And if you know that it's grossly off and it's affecting your query plan, you can actually set these values for the function, but you can only set them to one set of values. So this has some limited use. I've actually never run into a real life use case where I've done this, I'm sure there are people who have. And so this query just shows you how you could see what those optimizer hints were by looking in the system catalog for a particular function. I can set a local config. So any config that's able to be changed at session time, I can bind that to a function and have that value apply whenever that function gets called. So in this case, I want this particular function to always execute with a work mem of 512 meds. And this query will show you how to prove to yourself that looking in the system catalog that I've set work mem to 512 for this particular function. The function body, we've talked a lot about the string that makes up the function body, but it actually can also represent other things. So normally it's a string literal, it's parsed by whatever the language, if you're using a procedural language handler, it'll be parsed by that language. It can be just a single internal function name, as you saw an example earlier in the slide deck. In that case, it'll just be mapped to that symbol in C, in the C library. And it actually can be a path to a loadable library as well, as long as the function name itself matches exactly the C symbol that you're trying to call. And the body, as we talked about earlier, can be dollar quoted or it can be used single quotes with escaping. It can also be this other form, object file and link symbol. And this is more common when you're loading something that's been written in C. The object file is a pointer to the loadable object, and then the symbol is the actual name of the function in C that you're calling. And you can find, usually you wanna, if you're gonna do this, you usually want to, I assume I have a few minutes for questions at the end, right? Actually, we have about one minute officially left and our lunch starts in 10 minutes. So, in about a minute after Joe wraps up officially, feel free to leave and get in line or whatever. But if you'd like to stay. I've got just like two or three more slides. So I'm gonna try and hammer through them. If you wanna leave, I won't be offended. Just one thing to know here, when you do reference this object file, you typically, I've got an example on the next slide. You typically wanna use this libder, which is sort of a built-in symbol that knows where Postgres expects to find. It's objects. If you don't do that, you could have a hard coded absolute path, but then it makes what you've done non-portable, right? If you take, now dump this and try and load it on another server that's been configured for a different location, it won't work. But if you use libder, it will. And you can find out where that location is using this utility that comes with Postgres called pgconfig, dash-package libder. And that will tell you the location that's been bound to this libder symbol. So these are two examples of function bodies. You've seen lots of this first type. This one is for the, actually, for one of the functions in PLR, you reference it as libder slash plr. You don't even give it the .so. And again, this is to make it portable. Postgres will figure out if you're on a Linux system, it's .so. If you're on a Mac, I think it's .do or something like that. Windows system, it's .dll. But if you don't specify it, Postgres will figure it out based on what platform you're running on. Okay, so just two more slides. I wanted to give a couple of slightly more advanced examples. So this is an example of creating your own custom operator. If you've come from some other databases, you can use the plus symbol to concatenate strings, right? So in this case, I've created a function called sum that takes text, two arguments of text. And all it's gonna do is concatenate them with a space. And then by using this create operator call, I'm saying that the plus symbol is gonna use the procedure called sum with a left argument of text and a right argument of text. So now I've just extended Postgres so that I can say select hello plus world and it will concatenate those strings for me. Now this is an example of a custom aggregate. This concat ws comma is a function that's gonna take a text in any element. And it's gonna use concat with separator, which is a built-in function in Postgres. It's using a separator of a comma and it's taking two arguments. So now when I say create aggregate string ag that accepts any element, I'm gonna use that function and my state type, which is the type that's gonna get passed on from row to row within the group is text. And that's because this thing returns text. And so now when I say select string ag f1 from foo or I could group it if I wanted to, it's just gonna give me that column concatenated with commas as a string. So I am out of time.  If you go to www.joeconway.com, you can get the slide deck immediately. If you wanna look through those and ask me any questions I'm here until Saturday, feel free to find me in the hallway. Send me an email, mail at joeconway.com or joe.conwayatcreditive.com. Either one and I'll do my best to answer your questions.


Now post-toasties the heat good cornflakes is proud to present gun smoke Brown Dodd City and in the territory on West There's just one way to handle the killers and the spoilers And that's with a US Marshal and the smell of gun smoke The story of the violence that moved West with young America the story of a man who moved with it Matt Dillon United States Marshal It's easy to be a whole tribe of big favor mother Just pour every big and little Indian in your camp a breakfast bowl full of post-toasties Post-toasties, you know are the heat good cornflakes They're the best thing that's happened to corn since the Indians discovered it fresh as fresh can be Say post-toasties are crackling crisp Sweet Colonel corn flavor Toasted that's post-toasties Post-toasties are packed with nourishment to a bowl of post-toasties with sugar and milk Helps your big braves and little Indians start the day right get post-toasties soon and now gun smoke Starring William Conrad I and my son got ranch up in the South Fork the Solomon. Oh, what can I do for you, Mr. Brad? Well, I Ain't no ways responsibly understand. It's been kind of put on me. You might say, huh? What has well marshal that well the engine started it They was riding for horses just a couple of days ago and they'd have got them and probably me too But for this kid they had a long a kid Yeah, and he tried to come in ahead the rest of the Indians and he showed herself too soon as what happened My son saw him in time to warn me and we put up a stand-off fight and the Marapa hose didn't get a single horse Well, what's the trouble then? We got the kid. He's still there wilder and a deer He got shot in the leg a little we brought him into the house after I Want to know what to do with him marshal. Oh Well, how old's the boy mr. Brunt? Hard to say. I bet he's you 12 or under that's pretty young to be on a Raiden party. It sure is but he's awful wild He's tried to kill me twice already. Well, then why don't you turn him over to a reservation somewhere? They'll take care of him. I can't do that marshal. It wouldn't have them Why not? Well, he ain't a Indian.   Well, I think well I don't know what I can do about it. Mr. Bryant one thing is sure marshal I can't keep them no more and you don't seem right, you know for a white boy to go back living among the Marapa hose So you got to come up there with me and do something about him that mr. Bryant you ask marshal. I'm hired to keep the peace not to play nurse made the orphans Yeah You're the only man I've heard of around here. I thought might help that boy If you want you won't I'll just run him off into the prairie. I guess all right. All right, mr. Bryant We'll ride back with you in the morning Don't see nobody around mr. Brandt. Oh, oh my son will be out of the cattle this family day I told my lock that kid in the potato cellar when they have to leave the house. Is that it over there? That's it. He'll be in there Open the door marshal maybe you'll come out. All right Chester grab him if he runs up. Yes, you watch out for him. He'll do anything that kid. Hey kid Come on out Stand back now What well look at him you'd hardly know he was a white boy mr. Dillon.  Oh my good.  We're here to help you.  It's easier to be tortured on an empty stomach. I'm not son.  I'm all right Come on. Let's go in the house. I'll see for sure No Well, he's made it. I got it.  I tried marshal He wouldn't let me near it tried to bite me. Well, he can't fight now Come on. Show me where to put him. I carried the boy into the house Layed him out on a bed and went to work He came to in the middle of it But he didn't move a muscle or utter a sound The bullet wasn't very very deep. I dug it up Cleaned the wound as best I could When it was over I got some strong tea down him and then he went to sleep Couple of hours later. I noticed he'd waked up and I went over to the bed. You fixed my leg Sure, of course I did Why?  Yorkie Well, is that all? It's all I remember. Is that what the Rappahors told you?  Killed in a raid they told me I've been a Rappahore ever since What was your father's name? Do you know I? Was too young Well, then how come you remember English so well an old man of the tribe makes me talk every day Don't know where he learned, but he says it'll come to use later when I'm a brave in our wars against the white man You're a white man Yorkie Yes, but I live with the Rappahors.  I have to make a big coup like a big coup What for? I'll be killed if I don't What are you talking about I?   Why did I take that bullet out of your leg? I?  Well, we'll argue about that later But what were you doing on this raid in the first place? A white boy must prove himself many times. It's harder than for an Indian. That's why they let me come See now you've got quite a problem.  I'll have some soup for you when you wake up Good morning, mr. Brand. Good morning Chester Marshall good morning your son left a few minutes ago. He said he wouldn't be back to leave me And I ought to be out with him We're all through but I'll cook you some eggs. Oh just coffee for me. All right Well, what are you gonna do about that kid Marshall? Now there's not much I can do brant. You can't leave him here Well, I didn't bring him here here.  I'm serious Even if it was ordinary kid I got no way to raise him and this one is bad I told you he'd been after me twice already. He needs a scalp to take back It's a matter of life or death with him. He ain't taking mine.  Dylan left alone. Yes, but he's so young. Well, I heard Billy the kid killed a man when he was 12 Age doesn't seem to matter much Well, can't you talk him out of it? Show me it's wrong. I've tried but Yorkie thinks like an Indian He doesn't know anything about the white man's world How's he Feeling this morning. Well, I'd hoped his fever be down but it isn't he needs a doctor. That's what yeah By the way, Brian is this one of your guns? Where'd you get it Yorkie had it when I went in there this morning, but he was too weak to use it I told you he's a bad one Marshall.   Well, you can take it from me the best thing that can go on your breakfast table is post toasties Yes, sir post toasties the heat good corn flakes Those golden crisp corn flakes are the best thing that's happened to corn since the Indians discovered it You know how to prove it Well, just pour out breakfast bowlfuls of post toasties for your whole tribe then watch how they enjoy him Post toasties are crisp and tasty from the first bite down to the last spoonful that sweet kernel corn flavor Makes your breakfast so always ask for post toasties the heat good corn flakes Post toasties heat good corn flakes the best thing that's happened to corn since the Indians discovered it Eat good corn flakes post toasties heat good corn flakes Remember post toasties is one of the famous triple wrap post cereals Guaranteed fresh or triple your money back Now back to gun smoke On the drive into dodge Yorkie never moved or never said a word Look back at him from time to time and tried to put myself in his place Here was a boy whose only experience of life had been with a war-like tribe of Indians a Tribe which he couldn't even go back to without a white man's scalp or some stolen horses Now this in itself would be a problem for a grown man But little Yorkie also called himself a prisoner Sooner or later to be killed There was no wonder that you're on the next few days as he lay on the couch in Doc's office. He watched us with wild restless eyes In spite of his obvious courage, I think he was a little frightened And when Doc was suddenly called out on a case in the country for several days. I had an idea And I sent Chester to find kitty You want me to nurse him is that it Matt? Well partly but also I thought maybe you could talk to him a little it's No, it's hard for him to trust a man. I know just to tell me about him. Yeah, he'll be well enough pretty soon to get into trouble bad trouble I'll do what I can Where is he in the front room? Yeah on Doc's couch and the kitty Try to get him to eat something. I Haven't had much luck. All right, but you stay here. Yeah, sure Hello Yorkie Who are you my name's kitty. I'm gonna take care of you Why?  Not an enemy We're not enemies Yorkie Even if we were I'd take care of you Prisoners get will by themselves or they die. No, I'm either don't Anyway, you're not a prisoner. You can leave anytime you want to Is that the truth? Of course it is Unless you do something wrong like killing or stealing But let's not talk about all that I Want to know about you all sorts of things what it was like with the arapahoes or What you remember about when you were younger? I won't tell any secrets. I don't want to know any secrets Yorkie But maybe you can tell me well Did you have a mother in the tribe?  I didn't need one. Do you ever want one Yorkie? I don't know. I guess so sometimes Better to have a mother Mine was killed in a raid when they found me. I know Do you remember her at all? No Sometimes I think I do Sometimes when I'm asleep then What do you remember about it then? I don't know Just a feeling I guess Sort of like being warm Is that what it's like? Yeah, I think that's what it's like Yorkie Very much like that. I'm hungry kitty Do you let me have something to eat? Of course I will Yorkie. Of course I will Kitty spent as much time with Yorkie as she could manage And whenever she'd been with him he always seemed calmer and less frightened And we began to have hopes that maybe the boy would take to his new life after all Chester and I were busy and except for taking some food up now And then we turned Yorkie's care over to kitty completely What'll that be back mr. Dillon I forgot to tell you Chester He sent word he'd have to be out there another day.  Ah, I don't know what to do with him Chester. We sure got to do something Where's Yorkie? What? Oh, he's upstairs kitty. Have you been up there today? Have you seen him? No, I I thought you were with him. I couldn't get here till now York is gone Matt. What I'll go take a look I've already searched the place. He isn't there. Well, let's look in the street Chester Maybe somebody's seen you better find him. That's all I can say. Yeah, we'll find him kitty. Don't worry Maybe he's got hold of the gun. I hope not Anyway, if he's as smart as I think he is he'll locate a horse to get away on first Maybe a couple of them dog gone Just an hour to begin to think he was gonna settle down a little You never know But I still got faith in that kid somehow Chester Now here let's cross over to moss grimmick stable there, huh? All right, there's moss now. It's in the side there. Yeah Moss. Oh marshal Chester. Oh moss. Yeah, I was going to come see you marshal Oh that kid you brought in the other day. I caught him trying to steal one of my horses. You got Yorkie That is name. Where is he moss back here?  Oh don't untie him. I'll handle him moss Here you are. What's she doing? Yorkie I'm sorry this happened I'd have given you a horse if you'd have asked me I Wasn't going to steal him and what was you doing riding him out of that stall young fellow wait a minute moss Yorkie you say you weren't gonna steal him No What what were you doing then? Kitty didn't come and I got lonely I don't know I think I do Yorkie You just wanted to be around something familiar something you know It isn't that right I guess so and you've lived with horses all your life. You know, I'm pretty well So you came over here I wasn't gonna steal him. I just wanted to get on him You know, I have to believe the boy moss is telling the truth moss Yorkie. I'm sorry.   I'll give you a horse to ride You will sure I got lots of horses. You can take your pick What if I steal them I've had horses stole before I don't understand you He trusts you Yorkie We all do You shouldn't You shouldn't trust anybody. Oh, maybe not, but we do anyway Uh moss and I got an idea. No, I um I don't suppose you could use a stable boy around here Some kid who really knows horses and who's used to hard work. Well, I don't have much money marshal I could feed him a little and maybe fix him in bed in the saddle room here Of course a good boy's like a good horse. There's bound to be some hot blood Try to lift my hair. I'll wop him good That clear young fella You're talking about me. Of course they're talking about you Yorkie one thing Can't hire nobody less than he has a whole name. Well Yorkie don't know his last name. Well call him anything Uh Kelly Kelly that's a good name Yorkie Kelly grimmick Kelly Yeah, sounds all right me You people get out of here now. I got work to do when doc says you're fitting Yorkie you come back I'll be back moss In just a moment we'll tell you about next week's adventure on gun smoke Say exciting things happen to breakfast when there's sugar crinkles at every place Sure new sugar crinkles make breakfast more fun than a circus. You know why sugar crinkles is the sugar rice treat That's just right sweet Not too sweet the way some sugar coated cereals seem to be and not like others that aren't sweet enough Sugar crinkles every gold and crisp nugget of them is just right sweet So try starting your day off just right with new sugar crinkles And don't forget when you're listening to the radio or watching television Sugar crinkles make great snacks from the bowl or from the pack for your breakfast or a snack Sugar crinkles are more fun than a circus Try sugar crinkles soon. They're the sugar rice treat. That's just right sweet So better get several packages Gun smoke under the direction of norman mcdonald stars william conrad as matt dillon us marshall Tonight's story was especially written for gun smoke by john meston with music composed and conducted by rex quarry Featured in the cast were richard beals larry dobkin and john daner parley bearer is chester and georgia ellis is kitty ken peter speaking Join us again next week as matt dillon us marshall Spend some time on a road branch during his fight to bring law and order out of the wild violence of the west in gun smoke Listen next week at this time when gun smoke will be brought to you by sugar crinkles The sugar rice treat. That's just right sweet Saka coffee and instant saka the two delicious coffees that let you sleep bring you saka salutes And this is win alley at transcribe saluting our people of the week the everyday people who help make america and even nicer place in which to live This is for all fathers listening in got a question for your dad Suppose you got a hurry call from home saying that a certain stork which had been hovering around your house for weeks Finally had started coming in for a landing. Can you imagine yourself stopping for anything? No, well then you pull up a chair dad and hear all about a navy vet named charles yule You see this week charles was rushing home so he could get his wife to the hospital in time to have their very first child But on the way charles saw a terrible thing a woman had gone off a bridge A woman was floundering in the freezing water of a new york city river Well charles yule knew a thing or two about the horrors of people fighting death in the water During the war he'd rescued two drowning shipmates and just a few years ago He pulled a little girl out of the surf of course now it was different. There was the stork charlie wavered and then he made his decision Into the water he dived he reached the woman. He held her and he saved her life and then of course the hero dashed home Well, fortunately the stork had cooperated and daddy was able to greet his first son And so tonight charles yule stands in a hospital corridor and looks proudly through a glass at a little boy He certainly set him a real example of manhood and so to papa yule a koeing gurgling sankasudu And now here the story of the men of the uss george e davis and a nine-year-old italian war orphan named maria carmela Levecchia the davis is an american destroyer escort and about a year ago the men aboard her decided to adopt maria They didn't know they'd never seen her But they knew what kids like maria were going through so they they filled out the papers and collected money Enough for schooling enough for food even for her very first doll And then some time ago they decided to give her the finest gift of all a trip to america A chance to see a decent and happy world a chance to be just a little girl Well, she's here now and she's having the time of her life with her 200 fathers And so in her name to the wonderful young men of the george e davis this very proud sankasudu In a moment a story about a lonely forgotten hero, but first Say what is it you look for most in a coffee? Is it a full-bodied flavor or is it the ease of preparation you get from an instant coffee?  Orville Ratliff did down in Louisville this week? And when it was all over would you feel the way he does? Well, mr. Ratliff was a bystander when a car crashed and the gas tank exploded He didn't know the man inside the car the whole thing wasn't his affair But he went into those flames and he pulled out the man and he saved his life The result Orville Ratliff went to the hospital severely burned in terrible pain The other man fortunately was hardly hurt at all and up to the middle of this week at least Do you know how many visitors this hero has had? Zero not one He might be bitter this brave but lonely man, but he isn't he says when the pain allows him to talk I'd do it again. How about somebody going in and seeing Orville Ratliff for you and me and say to him for you and me Here sir is a saka salute I'll be back next week when saka coffee and instant saka both delicious and both caffeine free will again present saka salutes In the meantime, this is win ellie. It's suggesting you try saka.


Hi everybody it's Sam at Mixed Up Craft. Thank you for watching my tutorial today. I'm going to be showing you a Recycle and Reuse project. So this is the article that I have in the September issue of the Social Paper Crafter magazine. So this is my tutorial to sit side by side to the pictorial that you'll find in that magazine and all those links will be shared in the video description box below and also over on my blog. So I have done these before and I thought it was a really good way and there's a couple of other bits that I'm using that I'm recycling as well but this is making tassels out of your old magazines. So I have lots of craft magazines and not all the bits I want to cut up because I want to keep it for inspiration but they're great magazines to reuse because they're always so colorful. So these are the tassels so I'll just bring this one up here and what I've done is I've stuck this is foiled sellotape that you can buy in a lot of craft shops and again all those links will be shared of all the supplies that I use and then I've just popped it on some baker's twine and popped a loop on it so you can just thread it through your gift bags and yeah okay so now I've got this really fun trim with all these tassels hanging. So now just flip it over now whenever you're working with a shiny surface so for example I've folded this over on the top because it's going to roll even if this didn't this wasn't folded over it was just plain magazine paper because you're going to be rolling this shiny side and it's going to touch that it's always best to use the red tape unless you have a very very strong double sided but this red tape will stick anything it's pretty good stuff so I'm just using a little quarter of an inch wide there and again just go over making sure you squeeze all the air and all the bubbles out so it's all nicely stuck down and then I'm going to take off my backing and this is going to be the end that we end with okay so I'm going to grab some twine and what color do I want to use because it's all kinds there at the end so I'm going to bring in just looking down at my twine I'm going to have the green I think or do I want to have let's bring in let's do a different one here yeah I think the green I look nice so I've just got a bundle of this it's up to you how much you want to cut off I'm just going to do what I got here this is 17 inches but again it doesn't matter and then just fold it over so it's all nice and lined up even and then I'm just going to stick this onto this end okay so it's just attached there and then I find just using a poke tool and just stick your poke tool onto the very end there or just somewhere and you can use that just get it in there to start rolling your tassel it's only to kind of start it off once it's in place then you can do it yourself and you just want to get it to start to attach to that red tape it will stick really well so you can see now my twine is completely encased inside the bit that we're rolling okay so I'm just going to keep wrapping that around keeping the silver all lined up with this okay try not to go off course you want to end up just each time you roll it just kind of brush out your tassels there keeping everything lined up so don't rush it and just keep doing that until you get to the very end okay and then the very end but just neatly wrap around and there you have a really really fun tassel if I lie against the yellow there you can see how fun they look now you could have both of those together so what I can do now is just cut the end and let's take this one back off okay I've just tied a little knot there I've got them both kind of hanging at different heights and then I can just tie it around this piece here so I'm just gonna do it like so so I've got one of each color on each side and there you have it and see now how cute that looks so it just needs a little gift tag or I might put a little sentiment down the bottom there but how you know you get such a great effect which is cost you know very little to do so that's that way of doing it with the foiled salatate now if you don't have that and you have foils and just double sided tape I've just cut another strip of from the magazine I've said I like this I want this to be the piece that we end with so this is again this is three and a half by ten so it's a little bit bigger and then I'm just going to bring in let's try um what kind of I've got there so let's bring in the red foil so I've got some of my red foil here I'm just going to take off do one at a time so do the bottom first I've just ran a half inch double sided tape along the bottom there and then I'm going to stick my foil directly on there I know the length that I've got and take that off and just trim this piece off here and I'm going to take this one off and stick that one over there like so and then with all foils it's exactly the same just grab your finger and just rub over it okay sometimes it will start to lift in areas and that means it's obviously all nicely stuck down I also like to go over mine with my bone folder just to really make sure see now that's what you want see when it starts to lift off naturally and it goes completely clear and now I can peel that off and you get that really cool bring this up foiled edge so again just rub that one over that one's really quick and then just peel that one off like so so now I've got that lovely red foil and then if you've got any sticky bits that you can feel there's a couple there you just go over it again like so okay so I'm really pleased with that and then just do exactly the same thing again so you're just going to cut strips again about a quarter of an eight quarter of an inch sorry all the way up like that I'm now going to carry on with my scissors because it's much much quicker okay and there we have all of our tassels again so just flip it over and along the top I'm going to add that strip of red tape there's green in this one so I'm bringing in the green twine done this one a bit shorter so this one is 10 inches and just do exactly the same process again so make sure you pop your twine at the end where there isn't any color and you want to make sure that the end that's free is the one that you're is the color is that the one that's free because that's obviously what you're going to end with and again just start wrapping it all around okay and there you have it using the foil and I think these are really fun to make they're really good to do with the kids as well especially with the glitter because it's always fun to get the glitter out um as I showed you there and you just do exactly the same that's double-sided and then just sprinkled glitter over and you get really really cool cool effects so there is with the foil these ones are with the sellotape and this one's with the glitter I think the sellotape ones are my favorite maybe it's just because that silver's so shiny and it's already on the gift bag but I think they look really great so that is my recycle and reuse tutorial I hope I've inspired you and yeah if you're short on maybe some pattern papers and you've got loads of magazines use them up it's great ways to uh yeah recycle so please check out the social papercraft magazine the links to everything will be shared below and also in my blog if you've enjoyed today please give me a thumbs up and subscribe to my channel to see more thanks for watching bye


Hey smart Christians welcome back One of the most popular television shows on cable over the last 10 years or so has been the walking dead If you've ever seen it, you'll come to find out that it's not so much about the zombies Or the walkers as they're called it's really more about how they navigate through life And these walkers are kind of just part of the scenery like trees or shrubbery And they have to obviously get around and navigate around them, but there's other issues Affecting them like the rest of us do One of the things that they discovered though One way that they can kind of move around the walkers and and not be bothered by them is if they in this story They take the the guts the the dead blood and so forth as inside them and just cover themselves with it And when they do that it kind of masks them from the walkers wanting to attack them So I want you to kind of get the picture of this They take what's inside the walkers Put it on them on their outside and and when they do that They look like the walkers. They smell like the walkers They walk like the walkers kind of grunting sound like the walkers They move like the walkers in all appearances. They seem just like the walking dead just like the walkers What you'll notice in that is that there is a striking similarity between how Christians today operate in the world today What do we do? We take what some of the world is doing and Try to emulate that we take what's on the inside of some of these celebrities some of these famous people just regular people in general and We cover ourselves with that we walk like them we talk like them we act like them we move like them We go in the same circle and oftentimes it's hard to distinguish between the Christians and those that are in the world a lot of will do this because You don't want to be attacked by the world just like in the walking dead They didn't want to be attacked by the walkers and so they would want to appear like them So they can move around and not be harmed. Well, that presents a problem because this isn't a television show This is the real world with lasting and spiritual implications Paul tells us in Romans chapter 12 do not be conformed to this world But be transformed by the renewal of your mind that by testing you may discern What is the will of God what is good and acceptable and perfect? The problem is many people have conformed themselves to this world and in most cases Voluntarily and happily many Christians have adopted like the world this kind of live and let live sort of philosophy And you'll hear some of these catchphrases that kind of go along with this this love love love love love I just want to love everyone. I want to I want to be kind. I want to be considered I want to be tolerant of other people. I want to be accepted by the world I don't want any static many people don't want most folks don't want any problems with the world They don't want to be attacked or to be demonized Especially by those close around and all that sounds good And and then you begin to start looking like them and and dressing like them and talking like them and going all the places That they go to or why why would a person who professes to understand What's happening to this world? What is going to be the result of people who don't have faith in Christ who know what God has done For them. Why would you want to go back to that old way or to the way that you know leads to death? Why well for many Because we all struggle other people don't want to be exposed as an hypocrite Maybe a lot of folks are leading a sinful life anyway And so since the lines are of their Godly calling and they'll and and their worldly living have been blurred It's easier than to step back into that and so there's this fear of being exposed as By many as a hypocrite.  What if they find out that I'm that I'm struggling with my with porn or sexuality or I'm I'm not being faithful to my wife or I've got a temper problem. I've got this going on What if they find out about me and they know I'm a Christian and I don't want to be held accountable because see it's gotten to the point that Nobody wants to be a Christian Christian being a Christian has become a pejorative being a Christian has become something that's that's not a good thing even though Most people claim Christianity But they won't claim it in the truest sense in the way that the Bible calls us to be as Christians Because what are Christians to the world? Christians are hypocritical. They are judgmental. They're liars. They're back sabers They're just like us. They think they're holier than now, right? Christianity is outdated. It's not cool. And can we be honest? Come on, bring the camera closer Being worldly and living in sin is exciting It's fun Remember how you were when before you confess Christ how you enjoyed sin how how fun it was for us, right? There's this immediate gratification from sin and worldly living You don't have to worry about the world coming at you. You can kind of be at ease and comfort it And but though there's this immediate gratification and comfort There's also this long-lasting consequence to sin Some of you can testify to what happens because of sinful worldly living You cannot stride off offense and serve to master you cannot be a compromising Christian because in the end They still eat their own Many believers have bought into this Non-offensive style of being a Christian to where I don't want what I believe to affect you And so we've adopted this worldly philosophy But look at what Paul says in Colossians 2 8 he says seek to it that no one takes you captive by Philosophy and into deceit according to human tradition according to the elemental spirits of the world and not according to Christ So there's going to be this philosophy this this way of thinking that is the antithesis the opposite of what the Bible teaches It's always has been that way It always will be that way the world is enemies with God and if you are a Christian That means the world is naturally your enemy now what you want to do What we ought to do is bring more people on our side the goal is not to become more like there It's not like the old saying if you can't beat them join them No, if you can't beat them avoid it if you can't beat them grow your side We are not the on the losing side The world is and what you want to do a love of him as well as a love for man Would want you or compel you to bring people into it? Everyone's not going to come that we know But to give up on it might indicate something about matter of fact not indicate not may indicate But it does indicate something about you. There are those who love this world who understand the truth But love the world too much. They're not going to Commit fully they'll give lip service to this faith, but still their heart is somewhere else You can tell what's in a person by what comes out if you squeeze a lemon what comes out Whatever's on the inside squeeze a sponge whatever that's fun to soaked up That's what's coming out and too often for us as believers or profess believers What comes out is what's in us and all too often it's the world notice some of our So-called Christian celebrities who have decided that they want to be Christian in some cases name only But still advocate the philosophies and the principles of the world You've got here this Christian rapper who wants to be a political advocate for a Democrat candidate who calls himself a pastor who advocates for abortion. I believe that health care is a human right And I believe that it is something that the richest nation in the world provides for its citizens And for me reproductive justice is consistent with my commitment to that I believe unequivocally and a woman's right to choose and that the decision It's something that we you don't want government engaged in Clearly abortion is ungodly and wrong, but here's a person who is Seemingly it's okay abortion is fine as long as we get the right person in Homosexuality is okay as long as you know, I'll kind of live and let live you've got Christian artists or Celebrities who call themselves Christian who advocate for the LGBTQ inclusion and and policies and so forth You've got Christians who also call themselves or who I say professing Christians who live away or act away That's just completely ungodly maybe from the clothes that they wear from the style and so forth things They advocate and it's gotten to the point that even well meaning Christians people who are without question believers Are allowing some of those things to infiltrate us? Look at the way we dress sometimes Think about this you go back 20 30 years the way the way we dress Would be would be considered sinful and ungodly but now because everyone's doing it It's the acceptable thing and so no one wants to go out there and dress like they're in the 80s or the 90s We don't want to dress like we're we're some sort of prude or something like that And so we might dress a little bit more provocatively because hey, that's what the world is doing That's what fashion is saying, but you don't have to you don't have to conform to this world That's the point that Paul is making John says don't love this world if anyone loves this world the love of the father is not in them and so We need to be real careful. Are we really? on the side of the Lord or Are we really just walking around like the walking dead? We've taken on their qualities their characteristics is just so we can make it here on this earth And so a passage that's been misunderstood I'm gonna use this in the correct way in Matthew 10 22 Jesus says this that you will be hated for his sake But he says the enduring ones to the end shall be safe His point is you guys who are enduring you guys that are better fighting off this world you guys you're gonna be saved It's not that if you endure or whoso ever shall do at the end shall be saved the English Kind of muddles it up a little bit, but Jesus's point is you guys that are enduring you'll be saving the end You'll be fine. It's those folks who are compromising who are being more like the world who? Cherish and love this world. You're the ones who're gonna find it Find yourself in trouble because we'll find yourself in danger of literally of hell Hey, man